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; }
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)); }
public function outputForm($wintype = "") { global $wysiwyg_desc; global $CKPath; global $CKBasePath; global $IconPath; global $PublicPath; global $guide_types; $action = htmlentities($_SERVER['PHP_SELF']) . "?faq_id=" . $this->_faq_id; if ($wintype != "") { $action .= "&wintype=pop"; } $faq_title_line = _("Edit FAQ") . " <span class=\"smallgrey\">{$this->_faq_id}</span>\n <div style=\"float: right; margin-left: 2em;font-size: 12px;\"><a href=\"" . $PublicPath . "faq.php?faq_id={$this->_faq_id}\" target=\"_blank\">" . _("see live") . "</a></div>"; echo "\n<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" class=\"pure-form pure-form-stacked\" accept-charset=\"UTF-8\">\n<input type=\"hidden\" name=\"faq_id\" value=\"" . $this->_faq_id . "\" />\n<div class=\"pure-g\">\n <div class=\"pure-u-2-3\">\n <div class=\"pluslet\">\n <div class=\"titlebar\">\n <div class=\"titlebar_text\">{$faq_title_line}</div>\n <div class=\"titlebar_options\"></div>\n </div>\n <div class=\"pluslet_body\">\n\n<label for=\"question\">" . _("Question") . "</label>\n<textarea name=\"question\" rows=\"4\" cols=\"50\" class=\"required_field\">" . stripslashes($this->_question) . "</textarea>\n\n<label for=\"answer\">" . _("Answer") . "</label>"; if ($wysiwyg_desc == 1) { include $CKPath; global $BaseURL; // Create and output object $oCKeditor = new CKEditor($CKBasePath); $oCKeditor->timestamp = time(); $config['toolbar'] = 'SubsPlus_Narrow'; // Default shows a much larger set of toolbar options $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php"; echo $oCKeditor->editor('answer', $this->_answer, $config); } else { echo "<textarea name=\"answer\" rows=\"4\" cols=\"70\">" . stripslashes($this->_answer) . "</textarea>"; } echo "\n<label for=\"keywords\">" . _("Keywords (comma separated please)") . "</label>\n<input type=\"text\" name=\"keywords\" size=\"40\" value=\"" . $this->_keywords . "\" />\n</div>\n</div>\n</div>\n<!-- right hand column --> "; $last_mod = _("Last modified: ") . lastModded("faq", $this->_faq_id); $title_save_box = "<div id=\"last_edited\">{$last_mod}</div>"; echo "<div class=\"pure-u-1-3\">\n <div class=\"pluslet\">\n <div class=\"titlebar\">\n <div class=\"titlebar_text\">{$title_save_box}</div>\n <div class=\"titlebar_options\"></div>\n </div>\n <div class=\"pluslet_body\">\n\t\t<input type=\"submit\" name=\"submit_record\" class=\"button pure-button pure-button-primary save-button\" value=\"" . _("Save Now") . "\" />"; // if a) it's not a new record, and b) we're an admin or c) we are listed as a librarian for this guide, show delete button if ($this->_faq_id != "") { if (isset($_SESSION["admin"]) && $_SESSION["admin"] == "1") { echo "<input type=\"submit\" name=\"delete_record\" class=\"button pure-button pure-button-warning delete-button\" value=\"" . _("Delete Forever!") . "\" />"; } else { echo "<input type=\"submit\" name=\"recommend_delete\" class=\"button pure-button pure-button-warning\" value=\"" . _("Recommend Delete") . "\" />"; } } echo "</div></div>"; ///////////////// // Collections ///////////////// // All collections in array $querier4 = new Querier(); $q4 = "SELECT faqpage_id, name FROM faqpage ORDER BY name"; $this->_all_collections = $querier4->query($q4); $collection_list = ""; if ($this->_collections == FALSE) { // No results $collection_list = ""; } else { // loop through results foreach ($this->_collections as $value) { $collection_list .= self::outputCollection($value); } } $collection_string = ""; //get our string if ($this->_all_collections) { foreach ($this->_all_collections as $value) { $collection_string .= "<option value=\"{$value['0']}\">{$value['1']}</option>"; } } else { $collection_string = ""; } ///////////////// // Subjects ///////////////// $subject_list = ""; if ($this->_subjects == FALSE) { // No results $subject_list = ""; } else { // loop through results foreach ($this->_subjects as $value) { $subject_list .= self::outputSubject($value); } } $subject_string = getSubBoxes('', 50); echo "\n <div class=\"pluslet\">\n <div class=\"titlebar\">\n <div class=\"titlebar_text\">" . _("Relevant Subjects") . "</div>\n <div class=\"titlebar_options\"></div>\n </div>\n <div class=\"pluslet_body\">\n\n <select name=\"subject_id[]\"><option value=\"\">-- " . _("Select") . " --</option>\n {$subject_string}\n </select>\n\t <div id=\"subject_list\">{$subject_list}</div> <!-- subjects inserted here -->\n <br />\n </div></div>\n\n <div class=\"pluslet\">\n <div class=\"titlebar\">\n <div class=\"titlebar_text\">" . _("Relevant Collections") . "</div>\n <div class=\"titlebar_options\"></div>\n </div>\n <div class=\"pluslet_body\">\n\n <select name=\"collection_id[]\"><option value=\"\">-- " . _("Select") . " --</option>\n {$collection_string}\n </select>\n <div id=\"collection_list\">{$collection_list}</div> <!-- subjects inserted here -->\n <br />\n </div></div>\n </form>"; }
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(); }
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); }
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; } }
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 . "¤tpath=" . $currentpath; $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=image&path=" . $path . "¤tpath=" . $currentpath; $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=flash&path=" . $path . "¤tpath=" . $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¤tpath=" . $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¤tpath=" . $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¤tpath=" . $currentpath; } $val = nv_unhtmlspecialchars($val); return $CKEditor->editor($textareaname, $val); }
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); }
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 ''; }
/** * 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 . "¤tpath=" . $currentpath; $CKEditor->config['filebrowserImageBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=image&path=" . $path . "¤tpath=" . $currentpath; $CKEditor->config['filebrowserFlashBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&type=flash&path=" . $path . "¤tpath=" . $currentpath; if (!empty($admin_info['allow_files_type'])) { $CKEditor->config['filebrowserUploadUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&" . NV_OP_VARIABLE . "=quickupload¤tpath=" . $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¤tpath=" . $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¤tpath=" . $currentpath; } $val = nv_unhtmlspecialchars($val); return $CKEditor->editor($textareaname, $val); }
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); }
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'); }
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"); }
/** * 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(); }
/** * 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(); }
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> <input type="text" name="iOrderBy" size="40" value="<?php echo $iOrderBy; ?> "> </td> </tr> <tr> <td> </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> </td> <td>Status</td> <td>:</td> <td> <select name="eStatus" id="eStatus"> <option value="Active" <?php if ($eStatus == 'Active') { echo 'selected'; } ?>
} ?> </textarea></dd> </dl></fieldset> <fieldset> <legend>Content</legend> <dl class="inline" > <dt><label for="name">Content<span class="required">*</span></label></dt> <dd ><?php if (isset($cmscontent[0]['content'])) { $content_new = $cmscontent[0]['content']; } else { $content_new = ''; } $ckeditor->editor('contentvalue', $content_new); ?> </dd> </dl> </fieldset> <div class="buttons" > <input type="submit" class="button" id="submit_btn" value="Update" /> </div> </fieldset> </form> </div> </div> <script> function changeurl(val)
/** * 获取编辑器 * * @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(); } */ } } }
$fee_min_bid = $row['value'] / 100 * $minimum_bid; } } if ($row['type'] == 'buyout_fee' && $buy_now_price > 0) { $fee_bn = $row['value']; } if ($row['type'] == 'rp_fee' && $reserve_price > 0) { $fee_rp = $row['value']; } if ($row['type'] == 'subtitle_fee' && strlen($subtitle) > 0) { $subtitle_fee = $row['value']; } if ($row['type'] == 'relist_fee' && strlen($relist) > 0) { $relist_fee = $row['value']; } } $fee_javascript .= 'var current_fee = ' . (isset($_SESSION['SELL_current_fee']) ? $_SESSION['SELL_current_fee'] : '0') . ';'; $relist_options = '<select name="autorelist" id="autorelist">'; for ($i = 0; $i <= $system->SETTINGS['autorelist_max']; $i++) { $relist_options .= '<option value="' . $i . '"' . ($relist == $i ? ' selected="selected"' : '') . '>' . $i . '</option>'; } $relist_options .= '</select>'; $template->assign_vars(array('TITLE' => $MSG['028'], 'ERROR' => $ERR == 'ERR_' ? '' : ${$ERR}, 'CAT_LIST1' => $category_string1, 'CAT_LIST2' => $category_string2, 'ATYPE' => $TPL_auction_type, 'ATYPE_PLAIN' => $atype, 'CURRENCY' => $system->SETTINGS['currency'], 'DURATIONS' => $TPL_durations_list, 'PAYMENTS' => $payment_methods, 'PAGE' => 0, 'MINTEXT' => $atype == 2 ? $MSG['038'] : $MSG['020'], 'FEE_JS' => $fee_javascript, 'AUC_TITLE' => $title, 'AUC_SUBTITLE' => $subtitle, 'AUC_DESCRIPTION' => $CKEditor->editor('sdescription', stripslashes($sdescription)), 'ITEMQTY' => $iquantity, 'MIN_BID' => $system->print_money_nosymbol($minimum_bid, false), 'BN_ONLY' => $buy_now_only == 'y' ? 'disabled' : '', 'SHIPPING_COST' => $system->print_money_nosymbol($shipping_cost, false), 'ADDITIONAL_SHIPPING_COST' => $system->print_money_nosymbol($additional_shipping_cost, false), 'RESERVE_Y' => $with_reserve == 'yes' ? 'checked' : '', 'RESERVE_N' => $with_reserve == 'yes' ? '' : 'checked', 'RESERVE' => $system->print_money_nosymbol($reserve_price, false), 'START_TIME' => $TPL_start_date, 'BN_ONLY_Y' => $buy_now_only == 'y' ? 'checked' : '', 'BN_ONLY_N' => $buy_now_only == 'y' ? '' : 'checked', 'BN_Y' => $buy_now == 'yes' ? 'checked' : '', 'BN_N' => $buy_now == 'yes' ? '' : 'checked', 'BN_PRICE' => $system->print_money_nosymbol($buy_now_price, false), 'INCREMENTS1' => $increments == 1 || empty($increments) ? 'checked' : '', 'INCREMENTS2' => $increments == 2 ? 'checked' : '', 'CUSTOM_INC' => $customincrement > 0 ? $system->print_money_nosymbol($customincrement, false) : '', 'SHIPPING1' => intval($shipping) == 1 ? 'checked' : '', 'SHIPPING2' => intval($shipping) == 2 || empty($shipping) ? 'checked' : '', 'SHIPPING3' => intval($shipping) == 3 ? 'checked' : '', 'INTERNATIONAL' => !empty($international) ? 'checked' : '', 'SHIPPING_TERMS' => $shipping_terms, 'ITEMQTYD' => $atype == 2 || $buy_now_only == 'y' ? '' : 'disabled', 'START_NOW' => !empty($start_now) ? 'checked' : '', 'IS_BOLD' => $is_bold == 'y' ? 'checked' : '', 'IS_HIGHLIGHTED' => $is_highlighted == 'y' ? 'checked' : '', 'IS_FEATURED' => $is_featured == 'y' ? 'checked' : '', 'NUMIMAGES' => count($_SESSION['UPLOADED_PICTURES']), 'RELIST' => $relist_options, 'MAXRELIST' => $system->SETTINGS['autorelist_max'], 'TAX_Y' => $is_taxed == 'y' ? 'checked' : '', 'TAX_N' => $is_taxed == 'n' ? 'checked' : '', 'TAXINC_Y' => $tax_included == 'y' ? 'checked' : '', 'TAXINC_N' => $tax_included == 'n' ? 'checked' : '', 'MAXPICS' => sprintf($MSG['673'], $system->SETTINGS['maxpictures'], $system->SETTINGS['maxuploadsize'] / 1024), 'FEE_VALUE' => get_fee($minimum_bid), 'FEE_VALUE_F' => number_format(get_fee($minimum_bid), $system->SETTINGS['moneydecimals']), 'FEE_MIN_BID' => $fee_min_bid, 'FEE_BN' => $fee_bn, 'FEE_RP' => $fee_rp, 'FEE_SUBTITLE' => $subtitle_fee, 'FEE_RELIST' => $relist_fee, 'FEE_DECIMALS' => $system->SETTINGS['moneydecimals'], 'B_CAN_TAX' => $can_tax, 'B_GALLERY' => $system->SETTINGS['picturesgallery'] == 1, 'B_BN_ONLY' => $system->SETTINGS['buy_now'] == 2 && $system->SETTINGS['bn_only'] == 'y' && ($system->SETTINGS['bn_only_disable'] == 'y' && $user->user_data['bn_only'] == 'y' || $system->SETTINGS['bn_only_disable'] == 'n'), 'B_BN' => $system->SETTINGS['buy_now'] == 2, 'B_EDITING' => $_SESSION['SELL_action'] == 'edit', 'B_CUSINC' => $system->SETTINGS['cust_increment'] == 1, 'B_EDIT_STARTTIME' => $system->SETTINGS['edit_starttime'] == 1, 'B_MKFEATURED' => $system->SETTINGS['ao_hpf_enabled'] == 'y', 'B_MKBOLD' => $system->SETTINGS['ao_bi_enabled'] == 'y', 'B_MKHIGHLIGHT' => $system->SETTINGS['ao_hi_enabled'] == 'y', 'B_FEES' => $system->SETTINGS['fees'] == 'y', 'B_SHIPPING' => $system->SETTINGS['shipping'] == 1, 'B_SUBTITLE' => $system->SETTINGS['subtitle'] == 'y', 'B_AUTORELIST' => $system->SETTINGS['autorelist'] == 'y')); break; } include 'header.php'; $template->set_filenames(array('body' => 'sell.tpl')); $template->display('body'); include 'footer.php'; //if ($_SESSION['action'] != 3) makesessions();
$ERR = $ERR_025; } else { // Update database $query = "UPDATE " . $DBPrefix . "maintainance SET\n\t\t\t\tsuperuser = '******',\n\t\t\t\tmaintainancetext = '" . htmLawed($_POST['maintainancetext'], array('safe' => 1)) . "',\n\t\t\t\tactive = '" . $_POST['active'] . "'"; $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__); $ERR = $MSG['_0005']; } $system->SETTINGS['superuser'] = $_POST['superuser']; $system->SETTINGS['maintainancetext'] = $_POST['maintainancetext']; $system->SETTINGS['active'] = $_POST['active']; } else { $query = "SELECT * FROM " . $DBPrefix . "maintainance LIMIT 1"; $res = mysql_query($query); $system->check_mysql($res, $query, __LINE__, __FILE__); $data = mysql_fetch_assoc($res); $system->SETTINGS['superuser'] = $data['superuser']; $system->SETTINGS['maintainancetext'] = $data['maintainancetext']; $system->SETTINGS['active'] = $data['active']; } loadblock('', $MSG['_0002']); loadblock($MSG['_0006'], '', 'yesno', 'active', $system->SETTINGS['active'], array($MSG['030'], $MSG['029'])); loadblock($MSG['003'], '', 'text', 'superuser', $system->SETTINGS['superuser'], 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['_0004'], '', $CKEditor->editor('maintainancetext', stripslashes($system->SETTINGS['maintainancetext']))); $template->assign_vars(array('ERROR' => isset($ERR) ? $ERR : '', 'SITEURL' => $system->SETTINGS['siteurl'], 'TYPENAME' => $MSG['5436'], 'PAGENAME' => $MSG['_0001'])); $template->set_filenames(array('body' => 'adminpages.tpl')); $template->display('body');
<div class="row"> <div class="col-md-12"> <?php echo form_open('', 'method="post"'); ?> <div> <?php $config = CKEditorConfig::get('user'); $config['config']['height'] = '150'; $ckeditor = new CKEditor($config['basePath']); $ckeditor->textareaAttributes = $config['textareaAttributes']; $ckeditor->initialized = true; $ckeditor->editor('content', $content, $config['config']); ?> </div> <br class="clear" /> <button type="submit" class="btn btn-primary">Submit Content</button> <?php echo form_close(); ?> <h2>Result:</h2> <div><?php echo $content;
?> " /> </div> <div class="form-item"> Nội Dung: <!-- <textarea name="Content" cols="30"><?php echo set_value('Content', $videoNotification_model->Content); ?> </textarea>--> <?php include_once "lib/ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->basePath = '/ckeditor/'; // Create a textarea element and attach CKEditor to it. $CKEditor->editor("Content", set_value('Content', $videoNotification_model->Content), $this->config->item('config_admin_ck_editor')); ?> </div> <div class="form-item"> <label> Video </label> <select name="IdVideoOption"> <?php if (isset($videos)) { foreach ($videos as $video) { ?> <option value="<?php echo $video->Id; ?>
// 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; ?> <p> <label>Editor 2:</label><br/> </p> <?php // Configuration that will be used only by the second editor. $config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor')); $config['skin'] = 'v2'; // Create second instance. echo $CKEditor->editor("editor2", $initialValue, $config);
* 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');
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); ?> </div> </div> <style type="text/css"> table{ background-color:#E7E7E7; border-spacing:1px; color:#666666; width:100%; } table thead th { background:none repeat scroll 0 0 #F0F0F0; border-bottom:1px solid #999999; border-left:1px solid #FFFFFF; color:#666666;
// 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 // the 'instanceReady' listener defined a couple of lines above. $CKEditor->clearEventHandlers(); ?> <p> <label>Editor 2:</label><br/> </p> <?php // Configuration that will be used only by the second editor. $config['width'] = '600'; $config['toolbar'] = 'Basic'; // Add some global event handlers (for all editors). CKEditorHideLinkTargetTab($CKEditor); CKEditorNotifyAboutOpenedDialog($CKEditor);
?> </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 { echo "<input type=\"hidden\" name=\"kondisi\" value=\"tambah\">"; } echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\">"; ?> <button type="submit" class="btn btn-success">Submit</button> <button type="button" class="btn btn-info" onClick=javascript:window.location.href="../" >Back</button>
* 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');