• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CKEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CKEditor的典型用法代码示例。如果您正苦于以下问题:PHP CKEditor类的具体用法?PHP CKEditor怎么用?PHP CKEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CKEditor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ckeditor

 function ckeditor($fieldName, $options = array())
 {
     //CakePHP 1.2.4.8284
     $options = $this->_initInputField($fieldName, $options);
     //If you have probelms, try adding a second underscore to _initInputField.  I haven't tested this, but some commenters say it works.
     //$options = $this->__initInputField($fieldName, $options);
     $value = null;
     $config = null;
     $events = null;
     if (array_key_exists('value', $options)) {
         $value = $options['value'];
         if (!array_key_exists('escape', $options) || $options['escape'] !== false) {
             $value = h($value);
         }
         unset($options['value']);
     }
     if (array_key_exists('config', $options)) {
         $config = $options['config'];
         unset($options['config']);
     }
     if (array_key_exists('events', $options)) {
         $events = $options['events'];
         unset($options['events']);
     }
     require_once WWW_ROOT . 'js' . DS . 'ckeditor' . DS . 'ckeditor.php';
     $CKEditor = new CKEditor();
     $CKEditor->basePath = $this->webroot . 'js/ckeditor/';
     return $CKEditor->editor($options['name'], $value, $config, $events);
 }
开发者ID:raddicle,项目名称:bluecaffeine,代码行数:29,代码来源:cksource.php


示例2: Render

 /**
  * Renders the rich text editor.
  * @param string $name
  * @param string $value
  */
 function Render($name, $value = '')
 {
     $baseUrl = $this->baseUrl;
     $grantResult = $this->guard->Grant(Action::UseIt(), $this);
     $disabled = (string) $grantResult != (string) GrantResult::Allowed();
     $_SESSION['KCFINDER']['disabled'] = $disabled;
     $_SESSION['KCFINDER']['uploadURL'] = $this->uploadUrl;
     $_SESSION['KCFINDER']['uploadDir'] = $this->uploadDir;
     $oCKeditor = new \CKEditor();
     $oCKeditor->basePath = IO\Path::Combine($baseUrl, 'ckeditor/');
     $oCKeditor->config['skin'] = 'v2';
     $oCKeditor->config['filebrowserBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=files');
     $oCKeditor->config['filebrowserImageBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=images');
     $oCKeditor->config['filebrowserFlashBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=flash');
     $oCKeditor->config['filebrowserUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=files');
     $oCKeditor->config['filebrowserImageUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=images');
     $oCKeditor->config['filebrowserFlashUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=flash');
     foreach ($this->config as $key => $val) {
         $oCKeditor->config[$key] = $val;
     }
     ob_start();
     echo '<div class="phine-cke">';
     $oCKeditor->editor($name, $value);
     echo '</div>';
     return ob_get_clean();
 }
开发者ID:agentmedia,项目名称:phine-framework,代码行数:31,代码来源:CKEditorRenderer.php


示例3: nv_aleditor

 function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '')
 {
     // Create class instance.
     $editortoolbar = array(array('Link', 'Unlink', 'Image', 'Table', 'Font', 'FontSize', 'RemoveFormat'), array('Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent', 'TextColor', 'BGColor', 'Source'));
     $CKEditor = new CKEditor();
     // Do not print the code directly to the browser, return it instead
     $CKEditor->returnOutput = true;
     $CKEditor->config['skin'] = 'v2';
     $CKEditor->config['entities'] = false;
     //$CKEditor->config['enterMode'] = 2;
     $CKEditor->config['language'] = NV_LANG_INTERFACE;
     $CKEditor->config['toolbar'] = $editortoolbar;
     // Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
     //   $CKEditor->basePath = '/ckeditor/'
     // If not set, CKEditor will try to detect the correct path.
     $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
     // Set global configuration (will be used by all instances of CKEditor).
     if (!empty($width)) {
         $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
     }
     if (!empty($height)) {
         $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
     }
     // Change default textarea attributes
     $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
     $val = nv_unhtmlspecialchars($val);
     return $CKEditor->editor($textareaname, $val);
 }
开发者ID:ngoctu2008,项目名称:nv4_module_laws,代码行数:28,代码来源:content.php


示例4: ckeditor

    function ckeditor($name, $value = '', $required = false, $rows = 10, $cols = 50, $params = null)
    {
        $app =& Factory::getApplication();
        $config =& Factory::getConfig();
        // set script source path
        $baseURL = $config->baseURL;
        $baseURL = str_replace(@$config->admin_path, '', $baseURL);
        $app->set('js', $baseURL . 'assets/editors/ckeditor/ckeditor.js');
        $basePath = BASE_PATH . DS . 'assets' . DS . 'editors' . DS . 'ckeditor';
        $admin_path = str_replace('/', '', @$config->admin_path);
        $basePath = str_replace($admin_path, '', $basePath);
        include_once $basePath . DS . 'ckeditor.php';
        $CKEditor = new CKEditor();
        $config = array();
        $config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor'));
        $config['width'] = $width ? $width : 500;
        $config['height'] = $height ? $height : 400;
        $events['instanceReady'] = 'function(ev) {
		}';
        if ($required) {
            $CKEditor->textareaAttributes = array("class" => "required");
        }
        ob_start();
        $CKEditor->editor($name, $value, $config, $events);
        $html = ob_get_clean();
        return $html;
    }
开发者ID:rudenyl,项目名称:kcms,代码行数:27,代码来源:editor.php


示例5: output

 public function output($action = "", $view)
 {
     global $CKPath;
     global $CKBasePath;
     parent::establishView($view);
     if ($action == "edit") {
         // make an editable body and title type
         global $title_input_size;
         // alter size based on column
         //
         //////////////////////
         // New or Existing?
         //////////////////////
         if ($this->_pluslet_id) {
             $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
             $this->_pluslet_bonus_classes = "basic-pluslet";
             $this->_pluslet_name_field = "";
             $clean_title = addslashes(htmlentities($this->_title));
             $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$clean_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-update-body-{$this->_pluslet_id}";
         } else {
             $new_id = rand(10000, 100000);
             $this->_pluslet_bonus_classes = "unsortable basic-pluslet";
             $this->_pluslet_id_field = $new_id;
             $this->_pluslet_name_field = "new-pluslet-Basic";
             $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-new-body-{$new_id}";
         }
         include $CKPath;
         global $BaseURL;
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         //$oCKeditor->config['ToolbarStartExpanded'] = true;
         $config['toolbar'] = 'SubsPlus_Narrow';
         $config['height'] = '300';
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         // Create and output object
         print parent::startPluslet();
         $this->_body = $oCKeditor->editor($this_instance, $this->_body, $config);
         print parent::finishPluslet();
         return;
     } else {
         // notitle hack
         if (!isset($this->_hide_titlebar)) {
             if (trim($this->_title) == "notitle") {
                 $this->_hide_titlebar = 1;
             } else {
                 $this->_hide_titlebar = 0;
             }
         }
         // Look for tokens, tokenize
         parent::tokenizeText();
         parent::assemblePluslet($this->_hide_titlebar);
         return $this->_pluslet;
     }
 }
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:56,代码来源:Basic.php


示例6: nv_aleditor

function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '', $path = '', $currentpath = '')
{
    global $module_name, $admin_info, $client_info;
    if (empty($path) and empty($currentpath)) {
        $path = NV_UPLOADS_DIR;
        $currentpath = NV_UPLOADS_DIR;
        if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
            $currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
            $path = NV_UPLOADS_DIR . '/' . $module_name;
        } elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
            $currentpath = NV_UPLOADS_DIR . '/' . $module_name;
        }
    }
    $CKEditor = new CKEditor();
    $CKEditor->returnOutput = true;
    if (preg_match("/^(Internet Explorer v([0-9])\\.([0-9]))+\$/", $client_info['browser']['name'], $m)) {
        $jwplayer = $m[2] < 8 ? false : true;
    } else {
        $jwplayer = true;
    }
    if ($jwplayer) {
        $CKEditor->config['extraPlugins'] = 'jwplayer';
        $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'jwplayer', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    } else {
        $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    }
    $CKEditor->config['skin'] = 'v2';
    $CKEditor->config['entities'] = false;
    $CKEditor->config['enterMode'] = 2;
    $CKEditor->config['language'] = NV_LANG_INTERFACE;
    $CKEditor->config['toolbar'] = $editortoolbar;
    $CKEditor->config['pasteFromWordRemoveFontStyles'] = true;
    $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
    if (!empty($width)) {
        $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
    }
    if (!empty($height)) {
        $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
    }
    $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
    $CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=image&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=flash&path=" . $path . "&currentpath=" . $currentpath;
    if (!empty($admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&currentpath=" . $currentpath;
    }
    if (in_array('images', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserImageUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&type=image&currentpath=" . $currentpath;
    }
    if (in_array('flash', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserFlashUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=quickupload&type=flash&currentpath=" . $currentpath;
    }
    $val = nv_unhtmlspecialchars($val);
    return $CKEditor->editor($textareaname, $val);
}
开发者ID:VoDongMy,项目名称:VoDongMy,代码行数:55,代码来源:nv.php


示例7: ckeditor

 function ckeditor($name = 'edit_content', $value = '', $config = array(), $events = array())
 {
     if (empty($config)) {
         $config = Config::get('ckeditor');
     }
     if (empty($config)) {
         $config = array();
     }
     $ckeditor = new CKEditor(Config::get('ckeditor.basepath'));
     return $ckeditor->editor($name, $value, $config, $events);
 }
开发者ID:khoapossible,项目名称:vision_system,代码行数:11,代码来源:core.php


示例8: smarty_modifier_ck

function smarty_modifier_ck($id, $name = '', $defaultValue = '')
{
    if (!$id) {
        return;
    }
    $CKEditor = new CKEditor();
    $CKEditor->basePath = CKBASEPATH;
    $config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor'));
    $config['name'] = $name;
    //$CKEditor->returnOutput = true;
    // Create a textarea element and attach CKEditor to it.
    $CKEditor->editor($id, $defaultValue, $config);
    return '';
}
开发者ID:cmooony,项目名称:d4d-studio,代码行数:14,代码来源:modifier.ck.php


示例9: nv_aleditor

/**
 * nv_aleditor()
 * 
 * @param mixed $textareaname
 * @param string $width
 * @param string $height
 * @param string $val
 * @return
 */
function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '')
{
    global $module_name, $admin_info;
    $currentpath = NV_UPLOADS_DIR;
    $path = NV_UPLOADS_DIR;
    if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
        $currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
        $path = NV_UPLOADS_DIR . '/' . $module_name;
    } elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
        $currentpath = NV_UPLOADS_DIR . '/' . $module_name;
    }
    // Create class instance.
    $editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
    $CKEditor = new CKEditor();
    // Do not print the code directly to the browser, return it instead
    $CKEditor->returnOutput = true;
    $CKEditor->config['skin'] = 'kama';
    $CKEditor->config['entities'] = false;
    //$CKEditor->config['enterMode'] = 2;
    $CKEditor->config['language'] = NV_LANG_INTERFACE;
    $CKEditor->config['toolbar'] = $editortoolbar;
    // Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
    //   $CKEditor->basePath = '/ckeditor/'
    // If not set, CKEditor will try to detect the correct path.
    $CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
    // Set global configuration (will be used by all instances of CKEditor).
    if (!empty($width)) {
        $CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
    }
    if (!empty($height)) {
        $CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
    }
    // Change default textarea attributes
    $CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
    $CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=image&path=" . $path . "&currentpath=" . $currentpath;
    $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=flash&path=" . $path . "&currentpath=" . $currentpath;
    if (!empty($admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&currentpath=" . $currentpath;
    }
    if (in_array('images', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserImageUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&type=image&currentpath=" . $currentpath;
    }
    if (in_array('flash', $admin_info['allow_files_type'])) {
        $CKEditor->config['filebrowserFlashUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload&type=flash&currentpath=" . $currentpath;
    }
    $val = nv_unhtmlspecialchars($val);
    return $CKEditor->editor($textareaname, $val);
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:58,代码来源:nv.php


示例10: create

 function create($elementId, $content, $basePath)
 {
     // Create a class instance.
     $CKEditor = new CKEditor();
     // Path to the CKEditor directory.
     $CKEditor->basePath = $basePath;
     // Set global configuration (used by every instance of CKEditor).
     $CKEditor->config['width'] = 700;
     $CKEditor->config['hight'] = 600;
     $CKEditor->config['language'] = "en";
     $config = array();
     $config['toolbar'] = array(array('Source', '-', 'Preview'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'RemoveFormat'), array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'), array('Bold', 'Italic', 'Underline', 'Strike'), array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'), array('Styles', 'Format', 'Font', 'FontSize'), array('TextColor', 'BGColor'), array('Maximize', 'ShowBlocks', '-', 'About'));
     // Create a textarea element and attach CKEditor to it.
     $CKEditor->editor($elementId, $content, $config);
 }
开发者ID:meghv999,项目名称:cdshop-php,代码行数:15,代码来源:class.Editor.php


示例11: onEditOutput

 protected function onEditOutput()
 {
     global $CKPath;
     global $CKBasePath;
     include $CKPath;
     global $BaseURL;
     $oCKeditor = new CKEditor($CKBasePath);
     $oCKeditor->timestamp = time();
     //$oCKeditor->config['ToolbarStartExpanded'] = true;
     $config['toolbar'] = 'ImageOnly';
     $config['height'] = '300';
     $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
     $this_instance = "cardEditor";
     $this->_editor = $oCKeditor->editor($this_instance, $this->_body, $config);
     $this->_body = $this->loadHtml(__DIR__ . '/views/CardEdit.php');
 }
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:16,代码来源:Card.php


示例12: create

 function create($fieldName, $options = array(), $id_replace = '')
 {
     // Mặc định nếu ko định nghĩa chọn toolbar loại nào sẽ sử dụng loại simple
     // Mặc định nếu ko định nghĩa chọn ngôn ngữ nào loại nào sẽ sử dụng ngôn ngữ tiếng việt
     $options += array('toolbar' => 'simple', 'language' => 'vi', 'width' => 900);
     //định nghĩa trước một số kiểu toolbar trước
     switch ($options['toolbar']) {
         case 'extra':
             $options['toolbar'] = array(array('Source'), array('Preview'), array('PasteFromWord', '-', 'Print'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'RemoveFormat'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'), array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('Link', 'Anchor'), array('Image', 'Flash', 'oembed', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'), array('Styles', 'Format', 'Font', 'FontSize'), array('TextColor', 'BGColor'), array('ShowBlocks', 'Maximize'));
             /*
              * Nếu bạn khai báo phần tử image,flash,file và cho phép người sử dụng upload lên server thì phải cài đặt các chức năng tương ứng sau
              */
             /* File upload url */
             $options['filebrowserUploadUrl'] = $this->webroot . "js/ckeditor/kcfinder/upload.php?type=files";
             /* Image upload url */
             $options['filebrowserImageUploadUrl'] = $this->webroot . "js/ckeditor/kcfinder/upload.php?type=images";
             /* Flash upload url */
             $options['filebrowserFlashUploadUrl'] = $this->webroot . "js/ckeditor/kcfinder/upload.php?type=flash";
             /* Xem file đã upload */
             $options['filebrowserBrowseUrl'] = $this->webroot . "js/ckeditor/kcfinder/browse.php?type=files";
             /* Xem images đã upload */
             $options['filebrowserImageBrowseUrl'] = $this->webroot . "js/ckeditor/kcfinder/browse.php?type=images";
             /* Xem flash đã upload */
             $options['filebrowserFlashBrowseUrl'] = $this->webroot . "js/ckeditor/kcfinder/browse.php?type=flash";
             break;
         case 'users':
             $options['toolbar'] = array(array('Preview', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Anchor', 'Image', 'Table', 'Smiley'), array('FontSize', 'TextColor', 'BGColor'), array('Undo', 'Redo', 'RemoveFormat', 'PasteFromWord'), array('Maximize'));
             break;
             /* your case here ... */
         /* your case here ... */
         default:
             $options['toolbar'] = array(array('Preview', 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', 'Smiley', 'SpecialChar'), array('FontSize', 'TextColor', 'BGColor'), array('RemoveFormat'));
     }
     require_once WWW_ROOT . 'js' . DS . 'ckeditor' . DS . 'ckeditor.php';
     $CKEditor = new CKEditor();
     $CKEditor->basePath = $this->webroot . 'js/ckeditor/';
     $CKEditor->config = $options;
     //$attributes = $this->Form->_initInputField($fieldName, array());
     //return $CKEditor->editor($fieldName,$value);
     return $CKEditor->replace($id_replace);
     //return $CKEditor->replace($attributes['id'],$options);
     //$attributes = $this->Form->_initInputField($fieldName, array());
     //return $this->Html->scriptBlock("CKEDITOR.replace('" . $attributes['id'] . "',{{$this->Js->_parseOptions($options)}});");
 }
开发者ID:hotanlam,项目名称:japansource,代码行数:44,代码来源:TvFckHelper.php


示例13: create_editor

 function create_editor($id, $value = '', $config = array())
 {
     // Include the CKEditor class.
     include_once "Public/Admin/Ckeditor/ckeditor.php";
     // Create a class instance.
     $CKEditor = new CKEditor('http://' . $_SERVER['HTTP_HOST'] . PROJECT_RELATIVE_PATH . '/Public/Admin/Ckeditor/');
     // Path to the CKEditor directory, ideally use an absolute path instead of a relative dir.
     //   $CKEditor->basePath = '/ckeditor/'
     // If not set, CKEditor will try to detect the correct path.
     // Replace a textarea element with an id (or name) of "editor1".
     $_config['filebrowserBrowseUrl'] = PROJECT_RELATIVE_PATH . '/Public/Admin/Ckfinder/ckfinder.html';
     $_config['filebrowserImageBrowseUrl'] = PROJECT_RELATIVE_PATH . '/Public/Admin/Ckfinder/ckfinder.html?Type=Images';
     //$_config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
     //$_config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
     if (!empty($config)) {
         $_config = array_merge($_config, $config);
     }
     $CKEditor->editor("describe", $value, $_config);
     //$CKEditor->replace("describe");
 }
开发者ID:qinzhi,项目名称:taoj,代码行数:20,代码来源:function.php


示例14: wysiwyg

 /**
 * CKEditor для textarea
 *
 * @param $name
 * @param string $value
 * @param string $height
 * @param string $width
 * @return string
 
 HTML::wysiwyg('test', $value = '');	 
 
 Исходные тексты автора AmberLEX - http://forum.kohanaframework.su/viewtopic.php?f=38&t=347
 Форкнуто - RuslanCC - http://ruslan.cc/
 */
 public static function wysiwyg($name, $value = '', $css = '/css/ckeditor.css', $height = '260', $width = '98%')
 {
     $url_base = URL::base();
     include_once DOCROOT . 'public/js/ckeditor/ckeditor.php';
     include_once DOCROOT . 'public/js/ckfinder/ckfinder.php';
     $CKEditor = new CKEditor();
     $CKEditor->basePath = $url_base . 'public/js/ckeditor/';
     $CKEditor->config['height'] = $height . 'px';
     $CKEditor->config['width'] = $width;
     $CKEditor->config['filebrowserBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html';
     $CKEditor->config['filebrowserImageBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html?type=Images';
     $CKEditor->config['filebrowserFlashBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html?type=Flash';
     $CKEditor->config['filebrowserUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
     $CKEditor->config['filebrowserImageUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
     $CKEditor->config['filebrowserFlashUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
     $config['uiColor'] = '#efefef';
     $config['contentsCss'] = $css;
     // Кнопки (добавляем/убираем)
     $config['toolbar'] = array(array('Source', '-', 'Maximize', 'ShowBlocks'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'), '/', array('Format', 'Bold', 'Italic', 'Underline', 'Strike'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'NumberedList', 'BulletedList'), array('Outdent', 'Indent', '-', 'TextColor', 'BGColor', '-', 'Subscript', 'Superscript'), array('uiColor'));
     ob_start();
     $CKEditor->editor($name, $value, $config);
     return ob_get_clean();
 }
开发者ID:alex-bro,项目名称:test-vezom,代码行数:37,代码来源:HTML.php


示例15: CK

 /**
  * CKEditor WYSIWYG redactor
  * @param $name
  * @param $body
  * @param array $attributes
  * @param string $type
  * @return string
  */
 public static function CK($name, $body, array $attributes = null, $type = 'standard')
 {
     $settings = Config::get('ckeditor.' . $type);
     $url_base = URL::base();
     $ckeditor = 'media/vendor/ckeditor/';
     include_once DOCROOT . $ckeditor . 'ckeditor.php';
     $CKEditor = new CKEditor();
     $CKEditor->basePath = $url_base . $ckeditor;
     if ($settings['ckfinder']) {
         $ckfinder = 'media/vendor/ckfinder/';
         include_once DOCROOT . $ckfinder . 'ckfinder.php';
         $CKEditor->config['filebrowserBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html';
         $CKEditor->config['filebrowserImageBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html?type=Images';
         $CKEditor->config['filebrowserFlashBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html?type=Flash';
         $CKEditor->config['filebrowserUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Files';
         $CKEditor->config['filebrowserImageUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Images';
         $CKEditor->config['filebrowserFlashUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Flash';
     }
     unset($settings['ckfinder']);
     $config = ['language' => Config::get('settings.language'), 'uiColor' => '#f5f5f5', 'format_tags' => 'p;h1;h2;h3;pre'] + $settings;
     ob_start();
     $CKEditor->editor($name, $body, $config);
     return ob_get_clean();
 }
开发者ID:eok8177,项目名称:shopCMS,代码行数:32,代码来源:Editor.php


示例16: CKEditor

</div>
<!-- This <fieldset> holds the HTML code that you will usually find in your pages. -->
<form action="../sample_posteddata.php" method="post">
    <p>
        <label for="editor1">
            Editor 1:</label>
    </p>

    <p>
        <?php 
// Include the CKEditor class.
include_once "../../ckeditor.php";
// The initial value to be displayed in the editor.
$initialValue = '<p>This is some <strong>sample text</strong>.</p>';
// Create a class instance.
$CKEditor = new CKEditor();
// Path to the CKEditor directory, ideally use an absolute path instead of a relative dir.
//   $CKEditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
$CKEditor->basePath = '../../';
// Create a textarea element and attach CKEditor to it.
$CKEditor->editor("editor1", $initialValue);
?>
        <input type="submit" value="Submit"/>
    </p>
</form>
<div id="footer">
    <hr/>
    <p>
        CKEditor - The text editor for the Internet - <a class="samples"
                                                         href="http://ckeditor.com/">http://ckeditor.com</a>
开发者ID:werwolf1000,项目名称:market.on.key,代码行数:31,代码来源:standalone.php


示例17: define

 *   sold. If you have been sold this script, get a refund.
 ***************************************************************************/
define('InAdmin', 1);
$current_page = 'contents';
include '../common.php';
include $include_path . 'functions_admin.php';
include 'loggedin.inc.php';
include $main_path . 'ckeditor/ckeditor.php';
unset($ERR);
if (isset($_POST['action']) && $_POST['action'] == 'update') {
    // clean submission
    $system->SETTINGS['aboutus'] = ynbool($_POST['aboutus']);
    $system->SETTINGS['aboutustext'] = $system->cleanvars($_POST['aboutustext']);
    // Update database
    $query = "UPDATE " . $DBPrefix . "settings SET\n\t\t\t  aboutus = :aboutus,\n\t\t\t  aboutustext = :aboutustext";
    $params = array();
    $params[] = array(':aboutus', $system->SETTINGS['aboutus'], 'str');
    $params[] = array(':aboutustext', $system->SETTINGS['aboutustext'], 'str');
    $db->query($query, $params);
    $ERR = $MSG['5079'];
}
loadblock($MSG['5077'], $MSG['5076'], 'yesno', 'aboutus', $system->SETTINGS['aboutus'], array($MSG['030'], $MSG['029']));
$CKEditor = new CKEditor();
$CKEditor->basePath = $main_path . 'ckeditor/';
$CKEditor->returnOutput = true;
$CKEditor->config['width'] = 550;
$CKEditor->config['height'] = 400;
loadblock($MSG['5078'], $MSG['5080'], $CKEditor->editor('aboutustext', $system->uncleanvars($system->SETTINGS['aboutustext'])));
$template->assign_vars(array('ERROR' => isset($ERR) ? $ERR : '', 'SITEURL' => $system->SETTINGS['siteurl'], 'TYPENAME' => $MSG['25_0018'], 'PAGENAME' => $MSG['5074']));
$template->set_filenames(array('body' => 'adminpages.tpl'));
$template->display('body');
开发者ID:keramist,项目名称:WeBid,代码行数:31,代码来源:aboutus.php


示例18: CKEditor

		<legend>Output</legend>

		<form action="../sample_posteddata.php" method="post">

			<p>

				<label>Editor 1:</label><br/>

			</p>

<?php 
// Include CKEditor class.
include "../../ckeditor.php";
// Create class instance.
$CKEditor = new CKEditor();
// Do not print the code directly to the browser, return it instead
$CKEditor->returnOutput = true;
// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
//   $CKEditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
$CKEditor->basePath = '../../';
// Set global configuration (will be used by all instances of CKEditor).
$CKEditor->config['width'] = 600;
// Change default textarea attributes
$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
// The initial value to be displayed in the editor.
$initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>';
// Create first instance.
$code = $CKEditor->editor("editor1", $initialValue);
echo $code;
开发者ID:abhaygmit,项目名称:testprj,代码行数:30,代码来源:advanced.php


示例19: outputBioForm

 function outputBioForm()
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     if ($wysiwyg_desc == 1) {
         include $CKPath;
         global $BaseURL;
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         $config['toolbar'] = 'Basic';
         // Default shows a much larger set of toolbar options
         $config['height'] = '300';
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         echo $oCKeditor->editor('bio', $this->_bio, $config);
         echo "<br />";
     } else {
         echo "<textarea name=\"answer\" rows=\"6\" cols=\"70\">" . stripslashes($this->_answer) . "</textarea>";
     }
 }
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:20,代码来源:Staff.php


示例20: CKEditor

																<td>:</td>
																<td>
																	<input type="text" name="iOrderBy" size="40" value="<?php 
echo $iOrderBy;
?>
">
																</td>
															</tr>
															<tr>
																<td>&nbsp;</td>
																<td valign="top">Message</td>
																<td valign="top">:</td>
																<td height="300">
																	<span id="html"> <?php 
include_once $CFG->dirroot . "/lib/components/ckeditor/ckeditor.php";
$CKEditor = new CKEditor();
$CKEditor->editor('tContents', $tContents, $config);
?>
																	</span>
																</td>
															</tr>
															<tr>
																<td>&nbsp;</td>
																<td>Status</td>
																<td>:</td>
																<td>
																	<select name="eStatus" id="eStatus">
																		<option value="Active" <?php 
if ($eStatus == 'Active') {
    echo 'selected';
}
开发者ID:redeyes1024,项目名称:medlii_mlm_backend,代码行数:31,代码来源:page_settingadd.inc.php



注:本文中的CKEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CKFinder类代码示例发布时间:2022-05-23
下一篇:
PHP CJuiWidget类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap