Beispiel #1
2
    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;
    }
Beispiel #2
1
function show_wysiwyg_editor($name, $id, $content, $width = '100%', $height = '350px')
{
    // create new CKeditor instance
    include_once WB_PATH . '/modules/ckeditor/ckeditor/ckeditor.php';
    $ckeditor = new CKEditor($name);
    $ckeditor->basePath = WB_URL . '/modules/ckeditor/ckeditor/';
    $ckeditor->config['height'] = $height;
    $ckeditor->config['width'] = $width;
    // obtain template name of current page for editor.css (if empty, no editor.css files exists)
    $css_template_name = get_css_template_name();
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.css')) {
        $ck_editor_files = WB_URL . '/modules/ckeditor/wb_config/custom/editor.css';
    } else {
        $ck_editor_files = WB_URL . '/modules/ckeditor/wb_config/default/editor.css';
    }
    $ckeditor->config['contentsCss'] = $css_template_name == 'none' ? $ck_editor_files : $css_template_name;
    // obtain template name of current page for editor.styles.js (if empty, no editor.styles.js files exists)
    $styles_template_name = get_styles_template_name();
    // editor.styles.js file exists in default template folder, or template folder of current page
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.styles.js')) {
        $ck_styles_files = WB_URL . '/modules/ckeditor/wb_config/custom/editor.styles.js';
    } else {
        $ck_styles_files = WB_URL . '/modules/ckeditor/wb_config/default/editor.styles.js';
    }
    $styles_url = $styles_template_name == "none" ? $ck_styles_files : $styles_template_name;
    // The Styles dropdown in the editor. The styles_set needs to be set in each editor.styles.js!
    $ckeditor->config['stylesSet'] = 'wb:' . $styles_url;
    // The Templates list ("presets" like two columns with a picture) in the editor.
    // The templates definition set to use. It accepts a comma separated list.
    $ckeditor->config['templates'] = 'default';
    // The list of templates definition files to load.
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.templates.js')) {
        $ck_templates_files[] = WB_URL . '/modules/ckeditor/wb_config/custom/editor.templates.js';
    } else {
        $ck_templates_files[] = WB_URL . '/modules/ckeditor/wb_config/default/editor.templates.js';
    }
    $ckeditor->config['templates_files'] = $ck_templates_files;
    // The filebrowser are called in the include, because later on we can make switches, use WB_URL and so on
    $connectorPath = $ckeditor->basePath . 'filemanager/connectors/php/connector.php';
    $ckeditor->config['filebrowserBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Connector=' . $connectorPath;
    $ckeditor->config['filebrowserImageBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Type=Image&Connector=' . $connectorPath;
    $ckeditor->config['filebrowserFlashBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Type=Flash&Connector=' . $connectorPath;
    // The Uploader has to be called, too.
    $uploadPath = $ckeditor->basePath . 'filemanager/connectors/php/upload.php?Type=';
    $ckeditor->config['filebrowserUploadUrl'] = $uploadPath . 'File';
    $ckeditor->config['filebrowserImageUploadUrl'] = $uploadPath . 'Image';
    $ckeditor->config['filebrowserFlashUploadUrl'] = $uploadPath . 'Flash';
    // Setup the CKE language
    $ckeditor->config['language'] = strtolower(LANGUAGE);
    // Get the config file
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/wb_ckconfig.js')) {
        $ckeditor->config['customConfig'] = WB_URL . '/modules/ckeditor/wb_config/custom/wb_ckconfig.js';
    } else {
        $ckeditor->config['customConfig'] = WB_URL . '/modules/ckeditor/wb_config/default/wb_ckconfig.js';
    }
    $ckeditor->editor($name, reverse_htmlentities($content));
}
Beispiel #3
0
 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);
 }
Beispiel #4
0
 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);
 }
 /**
  * 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();
 }
Beispiel #6
0
 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;
     }
 }
Beispiel #7
0
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);
}
Beispiel #8
0
 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);
 }
Beispiel #9
0
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 '';
}
Beispiel #10
0
/**
 * 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);
}
Beispiel #11
0
 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);
 }
Beispiel #12
0
 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');
 }
Beispiel #13
0
 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)}});");
 }
Beispiel #14
0
 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");
 }
Beispiel #15
0
 function __construct($basePath = '')
 {
     if (is_null($basePath) || $basePath == '') {
         $basePath = base_url() . '/ckeditor/';
     }
     parent::__construct($basePath);
     $this->config['height'] = 100;
     $this->config['width'] = 465;
     $this->config['resize_enabled'] = false;
     $this->config['toolbar'] = array(array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'Cut', 'Copy', 'Paste', 'Undo', 'Redo', '-', 'Link', 'Unlink'));
 }
Beispiel #16
0
 /**
 * 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();
 }
Beispiel #17
0
 /**
  * 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();
 }
Beispiel #18
0
 public function __construct($editor_type, $contenttypeid, $contentid, $parentcontentid, $userid, $toolbartype)
 {
     global $stylevar, $vbphrase, $vbphrasegroup, $show;
     $this->vbphrasegroup = $vbphrasegroup;
     $this->vbphrase = $vbphrase;
     $this->stylevar = $stylevar;
     $this->show = $show;
     $this->contenttypeid = $contenttypeid;
     $this->contentid = $contentid;
     $this->parentcontentid = $parentcontentid;
     $this->userid = $userid;
     $this->editor_type = $editor_type;
     $this->returnOutput = true;
     $this->toolbartype = $toolbartype;
     $this->setGlobalConfig();
     $this->setToolbar($toolbartype);
     // To add plugins, do this in the editor_construct hook:
     //$this->config['_extraPlugins'] .= ',splitquote';
     // To remove plugins:
     //$this->config['_removePlugins'] .= ',contextmenu';
     ($hook = vBulletinHook::fetch_hook('editor_construct')) ? eval($hook) : false;
     parent::__construct(vB::$vbulletin->options['bburl'] . '/clientscript/ckeditor/');
 }
Beispiel #19
0
		<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;
Beispiel #20
0
 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>";
     }
 }
																<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';
}
<?php

$view->extend('::admin.html.php');
?>
<link rel="stylesheet" type="text/css" href="<?php 
echo $view['assets']->getUrl('js/ckeditor/ckeditor.js');
?>
"/>
<script src="<?php 
echo $view['assets']->getUrl('js/uniform/jquery.uniform.js');
?>
" type="text/javascript"></script>

<?php 
include $view['assets']->getUrl('/js/ckeditor/ckeditor.php');
$ckeditor = new CKEditor();
$ckeditor->basePath = $view['assets']->getUrl('js/ckeditor/');
$ckeditor->config['filebrowserBrowseUrl'] = $view['assets']->getUrl('js/ckfinder/ckfinder.html');
$ckeditor->config['filebrowserImageBrowseUrl'] = $view['assets']->getUrl('js/ckfinder/ckfinder.html?type=Images');
$ckeditor->config['filebrowserFlashBrowseUrl'] = $view['assets']->getUrl('js/ckfinder/ckfinder.html?type=Flash');
$ckeditor->config['filebrowserUploadUrl'] = $view['assets']->getUrl('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files');
$ckeditor->config['filebrowserImageUploadUrl'] = $view['assets']->getUrl('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images');
$ckeditor->config['filebrowserFlashUploadUrl'] = $view['assets']->getUrl('js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash');
?>

<div id="mainContainer"> 	

<div id="content" class="clearfix"> 
<div class="container">
    <div class="tablefooter clearfix"> 
  <!--  <div align="right" style="padding-right:50px;"><a href="/project/backyards/adminpanel/staticpage" class="button white">Back to Static page</a></div> -->
Beispiel #23
0
/**
 *  获取编辑器
 *
 * @access    public
 * @param     string  $fname 表单名称
 * @param     string  $fvalue 表单值
 * @param     string  $nheight 内容高度
 * @param     string  $etype 编辑器类型
 * @param     string  $gtype 获取值类型
 * @param     string  $isfullpage 是否全屏
 * @return    string
 */
function SpGetEditor($fname, $fvalue, $nheight = "350", $etype = "Basic", $gtype = "print", $isfullpage = "false", $bbcode = false)
{
    global $cfg_ckeditor_initialized;
    if (!isset($GLOBALS['cfg_html_editor'])) {
        $GLOBALS['cfg_html_editor'] = 'fck';
    }
    if ($gtype == "") {
        $gtype = "print";
    }
    if ($GLOBALS['cfg_html_editor'] == 'fck') {
        require_once DEDEINC . '/FCKeditor/fckeditor.php';
        $fck = new FCKeditor($fname);
        $fck->BasePath = $GLOBALS['cfg_cmspath'] . '/include/FCKeditor/';
        $fck->Width = '100%';
        $fck->Height = $nheight;
        $fck->ToolbarSet = $etype;
        $fck->Config['FullPage'] = $isfullpage;
        if ($GLOBALS['cfg_fck_xhtml'] == 'Y') {
            $fck->Config['EnableXHTML'] = 'true';
            $fck->Config['EnableSourceXHTML'] = 'true';
        }
        $fck->Value = $fvalue;
        if ($gtype == "print") {
            $fck->Create();
        } else {
            return $fck->CreateHtml();
        }
    } else {
        if ($GLOBALS['cfg_html_editor'] == 'ckeditor') {
            require_once DEDEINC . '/ckeditor/ckeditor.php';
            $CKEditor = new CKEditor();
            $GLOBALS['cfg_cmspath'] = '/cms';
            $CKEditor->basePath = $GLOBALS['cfg_cmspath'] . '/include/ckeditor/';
            $config = $events = array();
            $config['extraPlugins'] = 'dedepage,multipic,addon';
            if ($bbcode) {
                $CKEditor->initialized = true;
                $config['extraPlugins'] .= ',bbcode';
                $config['fontSize_sizes'] = '30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%';
                $config['disableObjectResizing'] = 'true';
                $config['smiley_path'] = $GLOBALS['cfg_cmspath'] . '/images/smiley/';
                // 获取表情信息
                require_once DEDEDATA . '/smiley.data.php';
                $jsscript = array();
                foreach ($GLOBALS['cfg_smileys'] as $key => $val) {
                    $config['smiley_images'][] = $val[0];
                    $config['smiley_descriptions'][] = $val[3];
                    $jsscript[] = '"' . $val[3] . '":"' . $key . '"';
                }
                $jsscript = implode(',', $jsscript);
                echo jsScript('CKEDITOR.config.ubb_smiley = {' . $jsscript . '}');
            }
            $GLOBALS['tools'] = empty($toolbar[$etype]) ? $GLOBALS['tools'] : $toolbar[$etype];
            $config['toolbar'] = $GLOBALS['tools'];
            $config['height'] = $nheight;
            $config['skin'] = 'kama';
            $CKEditor->returnOutput = TRUE;
            $code = $CKEditor->editor($fname, $fvalue, $config, $events);
            if ($gtype == "print") {
                echo $code;
            } else {
                return $code;
            }
        } else {
            /*
            // ------------------------------------------------------------------------
            // 当前版本,暂时取消dedehtml编辑器的支持
            // ------------------------------------------------------------------------
            require_once(DEDEINC.'/htmledit/dede_editor.php');
            $ded = new DedeEditor($fname);
            $ded->BasePath        = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ;
            $ded->Width        = '100%' ;
            $ded->Height        = $nheight ;
            $ded->ToolbarSet = strtolower($etype);
            $ded->Value = $fvalue ;
            if($gtype=="print")
            {
                $ded->Create();
            }
            else
            {
                return $ded->CreateHtml();
            }
            */
        }
    }
}
Beispiel #24
0
 } else {
     $gmdate_string = 'd-m-Y H:i:s';
 }
 if ($_SESSION['SELL_action'] != 'edit') {
     if (empty($a_starts)) {
         $TPL_start_date = date($gmdate_string, $system->ctime);
     } else {
         if (strpos($a_starts, '-') === false) {
             $a_starts = date($gmdate_string, $a_starts);
         }
         $TPL_start_date = $a_starts;
     }
 } else {
     $TPL_start_date = date($gmdate_string, $a_starts);
 }
 $CKEditor = new CKEditor();
 $CKEditor->basePath = $main_path . 'ckeditor/';
 $CKEditor->returnOutput = true;
 // build the fees javascript
 $fees = array('setup' => 1, 'hpfeat_fee' => 0, 'bolditem_fee' => 0, 'hlitem_fee' => 0, 'rp_fee' => 0, 'picture_fee' => 0, 'buyout_fee' => 0, 'subtitle_fee' => 0, 'relist_fee' => 0);
 $feevarsset = array();
 $fee_javascript = '';
 $relist_fee = $subtitle_fee = $fee_rp = $fee_bn = $fee_min_bid = 0;
 $query = "SELECT * FROM " . $DBPrefix . "fees ORDER BY type, fee_from ASC";
 $db->direct_query($query);
 while ($row = $db->fetch()) {
     if (isset($fees[$row['type']]) && $fees[$row['type']] == 0) {
         $fee_javascript .= 'var ' . $row['type'] . ' = ' . $row['value'] . ';' . "\n";
     }
     if (isset($fees[$row['type']]) && $fees[$row['type']] == 1) {
         if (!isset($feevarsset[$row['type']])) {
Beispiel #25
0
 *   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');
</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>
Beispiel #27
0
<?php

require_once 'ckeditor/ckeditor.php';
$config = array();
$config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor'));
$events['instanceReady'] = 'function (ev) {
	     	
	 	}';
$CKEditor = new CKEditor('http://server.com/minisite/editor/ckeditor/');
$CKEditor->Height = '900px';
?>
 
<style type="text/css">
		.cke_skin_kama .cke_wrapper {   
			height:480px;  
			width:700px;
		}
		#cke_contents_content
		{
			height:420px !important;
		}
		#cke_content{
			width:710px;
		}
</style>    
<h1>	Nhập Bài viết</h1>
<div class="colleft">
	<div style="margin: 0 0 0 10px; height: 500px;">
		<?php 
$CKEditor->editor("content", 'content here', $config, $events);
?>
Beispiel #28
0
    $CKEditor->addGlobalEventHandler('dialogDefinition', $function);
}
/**
 * Adds global event, will notify about opened dialog.
 */
function CKEditorNotifyAboutOpenedDialog(&$CKEditor)
{
    $function = 'function (evt) {
		alert("Loading dialog: " + evt.data.name);
	}';
    $CKEditor->addGlobalEventHandler('dialogDefinition', $function);
}
// Include CKEditor class.
include "../../ckeditor.php";
// Create class instance.
$CKEditor = new CKEditor();
// Set configuration option for all editors.
$CKEditor->config['width'] = 750;
// 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 = '../../';
// 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>';
// Event that will be handled only by the first editor.
$CKEditor->addEventHandler('instanceReady', 'function (evt) {
	alert("Loaded editor: " + evt.editor.name);
}');
// Create first instance.
$CKEditor->editor("editor1", $initialValue);
// Clear event handlers, instances that will be created later will not have
Beispiel #29
0
                                                            </script>      

															<?php 
if ($id != "") {
    echo "<input class=\"form-control\" id=\"waktu\" name=\"waktu\" type=\"text\" value=\"{$waktu}\" placeholder=\"Click to open calender\" readonly/>";
} else {
    echo "<input class=\"form-control\" id=\"waktu\" name=\"waktu\" type=\"text\" value=\"{$waktu}\" placeholder=\"Click to open calender\" readonly/>";
}
?>
                                                       </div>
                                                       
														<div class="form-group">
                                                            <label>Content</label>
                                                            <?php 
include_once "library/ckeditor/ckeditor.php";
$CKEditor = new CKEditor();
$CKEditor->basePath = "{$url_rewrite}/library/ckeditor/";
$CKEditor->config['filebrowserBrowseUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/browse.php?type-files";
$CKEditor->config['filebrowserImageBrowseUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/browse.php?type=images";
$CKEditor->config['filebrowserFlashBrowseUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/browse.php?type=flash";
$CKEditor->config['filebrowserUploadUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/upload.php?type=files";
$CKEditor->config['filebrowserImageUploadUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/upload.php?type=images";
$CKEditor->config['filebrowserFlashUploadUrl'] = "{$url_rewrite}/library/ckeditor/kcfinder/upload.php?type=flash";
$CKEditor->editor("content", $content);
?>
                                                          </div>

															<?php 
if ($id != "") {
    echo "<input type=\"hidden\"  name=\"kondisi\" value=\"edit\">";
} else {
Beispiel #30
-1
 *   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['privacypolicy'] = ynbool($_POST['privacypolicy']);
    $system->SETTINGS['privacypolicytext'] = $system->cleanvars($_POST['privacypolicytext']);
    // Update database
    $query = "UPDATE " . $DBPrefix . "settings SET\n\t\t\tprivacypolicy = :privacypolicy,\n\t\t\tprivacypolicytext = :privacypolicytext";
    $params = array();
    $params[] = array(':privacypolicy', $system->SETTINGS['privacypolicy'], 'str');
    $params[] = array(':privacypolicytext', $system->SETTINGS['privacypolicytext'], 'str');
    $db->query($query, $params);
    $ERR = $MSG['406'];
}
loadblock($MSG['403'], $MSG['405'], 'yesno', 'privacypolicy', $system->SETTINGS['privacypolicy'], 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['404'], $MSG['5080'], $CKEditor->editor('privacypolicytext', $system->uncleanvars($system->SETTINGS['privacypolicytext'])));
$template->assign_vars(array('ERROR' => isset($ERR) ? $ERR : '', 'SITEURL' => $system->SETTINGS['siteurl'], 'TYPENAME' => $MSG['25_0018'], 'PAGENAME' => $MSG['402']));
$template->set_filenames(array('body' => 'adminpages.tpl'));
$template->display('body');