本文整理汇总了PHP中CKEditor::editor方法的典型用法代码示例。如果您正苦于以下问题:PHP CKEditor::editor方法的具体用法?PHP CKEditor::editor怎么用?PHP CKEditor::editor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKEditor
的用法示例。
在下文中一共展示了CKEditor::editor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputForm
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>";
}
示例2: ckeditor
function ckeditor($name, $value = '', $required = false, $rows = 10, $cols = 50, $params = null)
{
$app =& Factory::getApplication();
$config =& Factory::getConfig();
// set script source path
$baseURL = $config->baseURL;
$baseURL = str_replace(@$config->admin_path, '', $baseURL);
$app->set('js', $baseURL . 'assets/editors/ckeditor/ckeditor.js');
$basePath = BASE_PATH . DS . 'assets' . DS . 'editors' . DS . 'ckeditor';
$admin_path = str_replace('/', '', @$config->admin_path);
$basePath = str_replace($admin_path, '', $basePath);
include_once $basePath . DS . 'ckeditor.php';
$CKEditor = new CKEditor();
$config = array();
$config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor'));
$config['width'] = $width ? $width : 500;
$config['height'] = $height ? $height : 400;
$events['instanceReady'] = 'function(ev) {
}';
if ($required) {
$CKEditor->textareaAttributes = array("class" => "required");
}
ob_start();
$CKEditor->editor($name, $value, $config, $events);
$html = ob_get_clean();
return $html;
}
示例3: array
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);
}
示例4: Render
/**
* Renders the rich text editor.
* @param string $name
* @param string $value
*/
function Render($name, $value = '')
{
$baseUrl = $this->baseUrl;
$grantResult = $this->guard->Grant(Action::UseIt(), $this);
$disabled = (string) $grantResult != (string) GrantResult::Allowed();
$_SESSION['KCFINDER']['disabled'] = $disabled;
$_SESSION['KCFINDER']['uploadURL'] = $this->uploadUrl;
$_SESSION['KCFINDER']['uploadDir'] = $this->uploadDir;
$oCKeditor = new \CKEditor();
$oCKeditor->basePath = IO\Path::Combine($baseUrl, 'ckeditor/');
$oCKeditor->config['skin'] = 'v2';
$oCKeditor->config['filebrowserBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=files');
$oCKeditor->config['filebrowserImageBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=images');
$oCKeditor->config['filebrowserFlashBrowseUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/browse.php?type=flash');
$oCKeditor->config['filebrowserUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=files');
$oCKeditor->config['filebrowserImageUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=images');
$oCKeditor->config['filebrowserFlashUploadUrl'] = IO\Path::Combine($baseUrl, 'kcfinder/upload.php?type=flash');
foreach ($this->config as $key => $val) {
$oCKeditor->config[$key] = $val;
}
ob_start();
echo '<div class="phine-cke">';
$oCKeditor->editor($name, $value);
echo '</div>';
return ob_get_clean();
}
示例5: ckeditor
function ckeditor($fieldName, $options = array())
{
//CakePHP 1.2.4.8284
$options = $this->_initInputField($fieldName, $options);
//If you have probelms, try adding a second underscore to _initInputField. I haven't tested this, but some commenters say it works.
//$options = $this->__initInputField($fieldName, $options);
$value = null;
$config = null;
$events = null;
if (array_key_exists('value', $options)) {
$value = $options['value'];
if (!array_key_exists('escape', $options) || $options['escape'] !== false) {
$value = h($value);
}
unset($options['value']);
}
if (array_key_exists('config', $options)) {
$config = $options['config'];
unset($options['config']);
}
if (array_key_exists('events', $options)) {
$events = $options['events'];
unset($options['events']);
}
require_once WWW_ROOT . 'js' . DS . 'ckeditor' . DS . 'ckeditor.php';
$CKEditor = new CKEditor();
$CKEditor->basePath = $this->webroot . 'js/ckeditor/';
return $CKEditor->editor($options['name'], $value, $config, $events);
}
示例6: output
public function output($action = "", $view)
{
global $CKPath;
global $CKBasePath;
parent::establishView($view);
if ($action == "edit") {
// make an editable body and title type
global $title_input_size;
// alter size based on column
//
//////////////////////
// New or Existing?
//////////////////////
if ($this->_pluslet_id) {
$this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
$this->_pluslet_bonus_classes = "basic-pluslet";
$this->_pluslet_name_field = "";
$clean_title = addslashes(htmlentities($this->_title));
$this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$clean_title}\" size=\"{$title_input_size}\" />";
$this_instance = "pluslet-update-body-{$this->_pluslet_id}";
} else {
$new_id = rand(10000, 100000);
$this->_pluslet_bonus_classes = "unsortable basic-pluslet";
$this->_pluslet_id_field = $new_id;
$this->_pluslet_name_field = "new-pluslet-Basic";
$this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
$this_instance = "pluslet-new-body-{$new_id}";
}
include $CKPath;
global $BaseURL;
$oCKeditor = new CKEditor($CKBasePath);
$oCKeditor->timestamp = time();
//$oCKeditor->config['ToolbarStartExpanded'] = true;
$config['toolbar'] = 'SubsPlus_Narrow';
$config['height'] = '300';
$config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
// Create and output object
print parent::startPluslet();
$this->_body = $oCKeditor->editor($this_instance, $this->_body, $config);
print parent::finishPluslet();
return;
} else {
// notitle hack
if (!isset($this->_hide_titlebar)) {
if (trim($this->_title) == "notitle") {
$this->_hide_titlebar = 1;
} else {
$this->_hide_titlebar = 0;
}
}
// Look for tokens, tokenize
parent::tokenizeText();
parent::assemblePluslet($this->_hide_titlebar);
return $this->_pluslet;
}
}
示例7: nv_aleditor
function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '', $path = '', $currentpath = '')
{
global $module_name, $admin_info, $client_info;
if (empty($path) and empty($currentpath)) {
$path = NV_UPLOADS_DIR;
$currentpath = NV_UPLOADS_DIR;
if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
$currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
$path = NV_UPLOADS_DIR . '/' . $module_name;
} elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
$currentpath = NV_UPLOADS_DIR . '/' . $module_name;
}
}
$CKEditor = new CKEditor();
$CKEditor->returnOutput = true;
if (preg_match("/^(Internet Explorer v([0-9])\\.([0-9]))+\$/", $client_info['browser']['name'], $m)) {
$jwplayer = $m[2] < 8 ? false : true;
} else {
$jwplayer = true;
}
if ($jwplayer) {
$CKEditor->config['extraPlugins'] = 'jwplayer';
$editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'jwplayer', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
} else {
$editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
}
$CKEditor->config['skin'] = 'v2';
$CKEditor->config['entities'] = false;
$CKEditor->config['enterMode'] = 2;
$CKEditor->config['language'] = NV_LANG_INTERFACE;
$CKEditor->config['toolbar'] = $editortoolbar;
$CKEditor->config['pasteFromWordRemoveFontStyles'] = true;
$CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
if (!empty($width)) {
$CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
}
if (!empty($height)) {
$CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
}
$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
$CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&path=" . $path . "¤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);
}
示例8: ckeditor
function ckeditor($name = 'edit_content', $value = '', $config = array(), $events = array())
{
if (empty($config)) {
$config = Config::get('ckeditor');
}
if (empty($config)) {
$config = array();
}
$ckeditor = new CKEditor(Config::get('ckeditor.basepath'));
return $ckeditor->editor($name, $value, $config, $events);
}
示例9: smarty_modifier_ck
function smarty_modifier_ck($id, $name = '', $defaultValue = '')
{
if (!$id) {
return;
}
$CKEditor = new CKEditor();
$CKEditor->basePath = CKBASEPATH;
$config['toolbar'] = array(array('Source', '-', 'Bold', 'Italic', 'Underline', 'Strike'), array('Image', 'Link', 'Unlink', 'Anchor'));
$config['name'] = $name;
//$CKEditor->returnOutput = true;
// Create a textarea element and attach CKEditor to it.
$CKEditor->editor($id, $defaultValue, $config);
return '';
}
示例10: nv_aleditor
/**
* nv_aleditor()
*
* @param mixed $textareaname
* @param string $width
* @param string $height
* @param string $val
* @return
*/
function nv_aleditor($textareaname, $width = "100%", $height = '450px', $val = '')
{
global $module_name, $admin_info;
$currentpath = NV_UPLOADS_DIR;
$path = NV_UPLOADS_DIR;
if (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . date("Y_m"))) {
$currentpath = NV_UPLOADS_DIR . '/' . $module_name . '/' . date("Y_m");
$path = NV_UPLOADS_DIR . '/' . $module_name;
} elseif (!empty($module_name) and file_exists(NV_UPLOADS_REAL_DIR . '/' . $module_name)) {
$currentpath = NV_UPLOADS_DIR . '/' . $module_name;
}
// Create class instance.
$editortoolbar = array(array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteWord', '-', 'Undo', 'Redo', '-', 'Link', 'Unlink', 'Anchor', '-', 'Image', 'Flash', 'Table', 'Font', 'FontSize', 'RemoveFormat', 'Templates', 'Maximize'), array('Bold', 'Italic', 'Underline', 'StrikeThrough', '-', 'Subscript', 'Superscript', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-', 'TextColor', 'BGColor', 'SpecialChar', 'Smiley', 'PageBreak', 'Source', 'About'));
$CKEditor = new CKEditor();
// Do not print the code directly to the browser, return it instead
$CKEditor->returnOutput = true;
$CKEditor->config['skin'] = 'kama';
$CKEditor->config['entities'] = false;
//$CKEditor->config['enterMode'] = 2;
$CKEditor->config['language'] = NV_LANG_INTERFACE;
$CKEditor->config['toolbar'] = $editortoolbar;
// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
// $CKEditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
$CKEditor->basePath = NV_BASE_SITEURL . '' . NV_EDITORSDIR . '/ckeditor/';
// Set global configuration (will be used by all instances of CKEditor).
if (!empty($width)) {
$CKEditor->config['width'] = strpos($width, '%') ? $width : intval($width);
}
if (!empty($height)) {
$CKEditor->config['height'] = strpos($height, '%') ? $height : intval($height);
}
// Change default textarea attributes
$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
$CKEditor->config['filebrowserBrowseUrl'] = NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?nv=upload&popup=1&path=" . $path . "¤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);
}
示例11: create
function create($elementId, $content, $basePath)
{
// Create a class instance.
$CKEditor = new CKEditor();
// Path to the CKEditor directory.
$CKEditor->basePath = $basePath;
// Set global configuration (used by every instance of CKEditor).
$CKEditor->config['width'] = 700;
$CKEditor->config['hight'] = 600;
$CKEditor->config['language'] = "en";
$config = array();
$config['toolbar'] = array(array('Source', '-', 'Preview'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'RemoveFormat'), array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'), array('Bold', 'Italic', 'Underline', 'Strike'), array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'), array('Styles', 'Format', 'Font', 'FontSize'), array('TextColor', 'BGColor'), array('Maximize', 'ShowBlocks', '-', 'About'));
// Create a textarea element and attach CKEditor to it.
$CKEditor->editor($elementId, $content, $config);
}
示例12: onEditOutput
protected function onEditOutput()
{
global $CKPath;
global $CKBasePath;
include $CKPath;
global $BaseURL;
$oCKeditor = new CKEditor($CKBasePath);
$oCKeditor->timestamp = time();
//$oCKeditor->config['ToolbarStartExpanded'] = true;
$config['toolbar'] = 'ImageOnly';
$config['height'] = '300';
$config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
$this_instance = "cardEditor";
$this->_editor = $oCKeditor->editor($this_instance, $this->_body, $config);
$this->_body = $this->loadHtml(__DIR__ . '/views/CardEdit.php');
}
示例13: array
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");
}
示例14: wysiwyg
/**
* CKEditor для textarea
*
* @param $name
* @param string $value
* @param string $height
* @param string $width
* @return string
HTML::wysiwyg('test', $value = '');
Исходные тексты автора AmberLEX - http://forum.kohanaframework.su/viewtopic.php?f=38&t=347
Форкнуто - RuslanCC - http://ruslan.cc/
*/
public static function wysiwyg($name, $value = '', $css = '/css/ckeditor.css', $height = '260', $width = '98%')
{
$url_base = URL::base();
include_once DOCROOT . 'public/js/ckeditor/ckeditor.php';
include_once DOCROOT . 'public/js/ckfinder/ckfinder.php';
$CKEditor = new CKEditor();
$CKEditor->basePath = $url_base . 'public/js/ckeditor/';
$CKEditor->config['height'] = $height . 'px';
$CKEditor->config['width'] = $width;
$CKEditor->config['filebrowserBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html';
$CKEditor->config['filebrowserImageBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html?type=Images';
$CKEditor->config['filebrowserFlashBrowseUrl'] = $url_base . 'public/js/ckfinder/ckfinder.html?type=Flash';
$CKEditor->config['filebrowserUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$CKEditor->config['filebrowserImageUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$CKEditor->config['filebrowserFlashUploadUrl'] = $url_base . 'public/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$config['uiColor'] = '#efefef';
$config['contentsCss'] = $css;
// Кнопки (добавляем/убираем)
$config['toolbar'] = array(array('Source', '-', 'Maximize', 'ShowBlocks'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'), '/', array('Format', 'Bold', 'Italic', 'Underline', 'Strike'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'NumberedList', 'BulletedList'), array('Outdent', 'Indent', '-', 'TextColor', 'BGColor', '-', 'Subscript', 'Superscript'), array('uiColor'));
ob_start();
$CKEditor->editor($name, $value, $config);
return ob_get_clean();
}
示例15: CK
/**
* CKEditor WYSIWYG redactor
* @param $name
* @param $body
* @param array $attributes
* @param string $type
* @return string
*/
public static function CK($name, $body, array $attributes = null, $type = 'standard')
{
$settings = Config::get('ckeditor.' . $type);
$url_base = URL::base();
$ckeditor = 'media/vendor/ckeditor/';
include_once DOCROOT . $ckeditor . 'ckeditor.php';
$CKEditor = new CKEditor();
$CKEditor->basePath = $url_base . $ckeditor;
if ($settings['ckfinder']) {
$ckfinder = 'media/vendor/ckfinder/';
include_once DOCROOT . $ckfinder . 'ckfinder.php';
$CKEditor->config['filebrowserBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html';
$CKEditor->config['filebrowserImageBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html?type=Images';
$CKEditor->config['filebrowserFlashBrowseUrl'] = $url_base . $ckfinder . 'ckfinder.html?type=Flash';
$CKEditor->config['filebrowserUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Files';
$CKEditor->config['filebrowserImageUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Images';
$CKEditor->config['filebrowserFlashUploadUrl'] = $url_base . $ckfinder . 'core/connector/php/connector.php?command=QuickUpload&type=Flash';
}
unset($settings['ckfinder']);
$config = ['language' => Config::get('settings.language'), 'uiColor' => '#f5f5f5', 'format_tags' => 'p;h1;h2;h3;pre'] + $settings;
ob_start();
$CKEditor->editor($name, $body, $config);
return ob_get_clean();
}