extend/think/template/taglib/Html.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 人人站CMS
 * ============================================================================
 * 版权所有 2015-2030 山东康程信息科技有限公司,并保留所有权利。
 * 网站地址: http://www.rrzcms.com
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 */

namespace think\template\taglib;

use think\template\TagLib;


class Html extends Taglib
{
    // 标签定义
    protected $tags = [
        // 标签定义: attr 属性列表 close 是否闭合(0 或者1 默认1) alias 标签别名 level 嵌套层次
        'editor' => ['attr' => 'id,name,style,width,height,type', 'close' => 1],
        'imgspace' => ['attr' => 'id,width,height,class,src,value', 'close' => 0],
        'select' => ['attr' => 'id,name,value,class,placeholder', 'close' => 1],
    ];

    static $_ui_id = 0;

    /**
     * 生成domid
     * @return string
     */
    private function newDomId() {
        return 'dom_el_' . substr(md5(microtime()), 0, 6) . intval(self::$_ui_id++);
    }

    /**
     * editor标签解析 插入可视化编辑器
     * 格式: <html:editor id="editor" name="remark" type="FCKeditor" style="" >{$vo.remark}</html:editor>
     * @param array $tag 标签属性
     * @param string $content 标签内容
     * @return string
     */
    public function tagEditor(array $tag, string $content) {
        $id = !empty($tag['id']) ? $this->varOrvalue($tag['id']) : $this->newDomId();
        $name = $this->varOrvalue($tag['name']);
        $style = !empty($tag['style']) ? $tag['style'] : '';
        $width = !empty($tag['width']) ? $tag['width'] : '100%';
        $height = !empty($tag['height']) ? $tag['height'] : '320';
        $config = [];
        $height and $config['initialFrameHeight'] = $height;
        $width and $config['initialFrameWidth'] = $width;
        $config and $config = htmlentities(json_encode($config));
        //   $content    =   $tag['content'];
        $type = $tag['type'];
        switch (strtoupper($type)) {
            case 'UEDITOR':
                $parseStr = '<textarea id="' . $id . '" name="' . $name . '" data-config="' . ($config ?: '') . '" style="' . $style . '">' . $content . '</textarea><div class="pt5 pb15"><button type="button" data-id="' . $id . '" data-type="imgrtol" class="layui-btn layui-btn-sm ueditor_footbtn">远程图片本地化</button><button type="button" data-id="' . $id . '" data-type="clearlink" class="layui-btn layui-btn-sm ueditor_footbtn">清除非本站链接</button></div><script type="text/javascript">(function(){ $.getEditor("' . $id . '"); })();</script>';
                break;
            default :

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。