public function cmsEditor($name, $value, $options = null, $width = '100%', $height = '350') { //1. Nhung tap tin fckeditor vao file chay require_once SCRIPTS_PATH . "/fckeditor/fckeditor_php5.php"; //2. Khai bao duong dan URL den thu muc fckeditor $sBasePath = SRCIPTS_URL . '/fckeditor/'; //3. Khoi tao doi tuong FCKeditor $oFCKeditor = new FCKeditor($name); //4. Thiet lap duong den cho thuong BasePath $oFCKeditor->BasePath = $sBasePath; //Dua gia tri vao Editor $oFCKeditor->Value = $value; //Thay doi kich thuoc cua Editor $oFCKeditor->Width = $width; $oFCKeditor->Height = $height; if (!isset($options['toolbar'])) { $oFCKeditor->ToolbarSet = 'Default'; } else { $oFCKeditor->ToolbarSet = $options['toolbar']; } if (!isset($options['language'])) { $oFCKeditor->Config['AutoDetectLanguage'] = false; $oFCKeditor->Config['DefaultLanguage'] = 'en'; } else { $oFCKeditor->Config['AutoDetectLanguage'] = false; $oFCKeditor->Config['DefaultLanguage'] = $options['language']; } //5. Tao FCKeditor return $oFCKeditor->Create(); }
function get_edit_page() { $list = ""; if ($this->session->justloggedin == 1) { $query = "select id, content from mdl_about where id=1"; $result = $this->db->query($query); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $content = $row['content']; } $list = $list . "<table class='table table-hover' border='0'>"; $list = $list . "<tr>"; $oFCKeditor = new FCKeditor('editor'); $oFCKeditor->BasePath = $this->editor_path; $oFCKeditor->Value = $content; $editor = $oFCKeditor->Create(false); $list = $list . "</td > {$editor}</td>"; $list = $list . "</tr>"; $list = $list . "<tr>"; $list = $list . "<td align='left' style='padding-left:0px'><button type='button' id='save_about' class='btn btn-primary' style='spacing-left:0px;'>Save</button></td>"; $list = $list . "</tr>"; $list = $list . "</table>"; } else { $list .= "<p>You are not authenticated. <a href='https://medical2.com/login'><button class='btn btn-primary' id='relogin'>Login</button></a></p>"; } return $list; }
/** * Get the current user * * @return NovemberUser */ public function FCKEditor($name, $value = '', $basePath = '') { $oFCKeditor = new FCKeditor($name); $oFCKeditor->BasePath = $basePath . '/'; $oFCKeditor->Value = $value; $oFCKeditor->Create(); }
function SpGetEditor($fname,$fvalue,$nheight="350",$etype="Basic",$gtype="print",$isfullpage="false") { if(!isset($GLOBALS['cfg_html_editor'])) $GLOBALS['cfg_html_editor']='fck'; if($gtype=="") $gtype = "print"; if($GLOBALS['cfg_html_editor']=='fck'){ require_once(dirname(__FILE__)."/../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{ require_once(dirname(__FILE__)."/../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(); } }
/** * i know it is not well liked to output this here, but for integration purposes it makes sense */ public function FckEditor($instance = 'content', $value = 'Enter text here', $height = 600, $width = 600, $fullToolbar = true) { $view = $this->view; include 'Digitalus/editor/fckeditor.php'; ?> <script> function FCKeditor_OnComplete( editorInstance ) { } </script> <?php $sBasePath = '/scripts/fckeditor/'; $oFCKeditor = new FCKeditor($instance); $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/office2003/'; $oFCKeditor->Width = $width; $oFCKeditor->Height = $height; if ($fullToolbar) { $oFCKeditor->ToolbarSet = 'Digitalus'; } else { $oFCKeditor->ToolbarSet = 'Basic'; } $oFCKeditor->Value = $value; $oFCKeditor->Create(); }
/** * Метод создания объекта FCKeditor * * @param string $val значение поля ввода * @param int $height высота поля ввода * @param string $name наименование поля ввода * @param string $toolbar панель управления * @return object объект FCKeditor */ function _newsletterFckObjectCreate($val, $height = 300, $name, $toolbar = 'Default') { $oFCKeditor = new FCKeditor($name); $oFCKeditor->Height = $height; $oFCKeditor->ToolbarSet = $toolbar; $oFCKeditor->Value = $val; $obj = $oFCKeditor->Create(); return $obj; }
function render_editor() { include_once FCKeditor_DIR . 'fckeditor.php'; $editor = new FCKeditor($this->_process_name_attribute($this->get_attribute('name'))); $editor->BasePath = FCKeditor_BasePath; $editor->Value = $this->get_value(); $editor->Width = $this->get_attribute('width'); $editor->Height = $this->get_attribute('height'); $editor->Create(); }
/** * 创建 FCKeditor 编辑器 * @param $initInfo :初始化的值 * @param $fckName :Fckeditor提交后的表单域名称 * @param $width :Fckeditor编辑器的宽度 * @param $height :Fckeditor编辑器的高度 */ function getFckeditor($initInfo = '', $fckName = 'fckEditInfo', $width = '100%', $height = '600') { include_once SITEWEB_PATH . "/fckeditor/fckeditor.php"; $oFCKeditor = new FCKeditor($fckName); $oFCKeditor->BasePath = "fckeditor/"; $oFCKeditor->Width = $width; $oFCKeditor->Height = $height; $oFCKeditor->Value = $initInfo; //默认的内容 return $oFCKeditor->Create(); }
public function action_edit() { exit; include_once "ext/fckeditor/fckeditor.php"; $oFCKeditor = new FCKeditor('FCKeditor2'); $oFCKeditor->Height = 190; $oFCKeditor->BasePath = '/ext/fckeditor/'; $oFCKeditor->Config['AutoDetectLanguage'] = false; $oFCKeditor->Config['DefaultLanguage'] = "ru"; $oFCKeditor->Value = ""; $oFCKeditor->Create(); }
public function TextBox($name, $value = "") { $sBasePath = join_path(Registry::get('base_dir'), 'system/editor/fckeditor/'); $oFCKeditor = new \FCKeditor($name); $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value = $value; $oFCKeditor->Width = 800; $oFCKeditor->Height = 700; ob_start(); $oFCKeditor->Create(); unset($oFCKeditor); return ob_get_clean(); }
/** * creates an fckeditor textarea * * @param array $namepair - used to build textarea name for views, array('Model', 'fieldname') * @param stirng $basepath - base path of project/system * @param string $content */ public function fckeditor($namepair = array(), $basepath = '', $content = '', $width = '100%', $height = '200') { $editor_name = 'data'; foreach ($namepair as $name) { $editor_name .= "[" . $name . "]"; } $oFCKeditor = new FCKeditor($editor_name); $oFCKeditor->BasePath = $basepath . '/js/fckeditor/'; $oFCKeditor->Value = $content; ///code by praveen $oFCKeditor->Height = $height; $oFCKeditor->Width = $width; $oFCKeditor->Create(); }
/** * Smarty function plugin * Requires PHP >= 4.3.0 * ------------------------------------------------------------- * Type: function * Name: fckeditor * Version: 1.1 * Author: gazoot (gazoot care of gmail dot com) * Purpose: Creates a FCKeditor, a very powerful textarea replacement. * ------------------------------------------------------------- * @param InstanceName Editor instance name (form field name) * @param BasePath optional Path to the FCKeditor directory. Need only be set once on page. Default: /js/fckeditor/ * @param Value optional data that control will start with, default is taken from the javascript file * @param Width optional width (css units) * @param Height optional height (css units) * @param ToolbarSet optional what toolbar to use from configuration * @param CheckBrowser optional check the browser compatibility when rendering the editor * @param DisplayErrors optional show error messages on errors while rendering the editor * * Default values for optional parameters (except BasePath) are taken from fckeditor.js. * * All other parameters used in the function will be put into the configuration section, * CustomConfigurationsPath is useful for example. * See http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options for more configuration info. */ function smarty_function_editor($params, &$smarty) { $params["BasePath"] = script_path . "/fckeditor"; if (!isset($params['InstanceName']) || empty($params['InstanceName'])) { $smarty->trigger_error('fckeditor: required parameter "InstanceName" missing'); } static $base_arguments = array(); static $config_arguments = array(); // Test if editor has been loaded before $init = count($base_arguments) == 0; // BasePath must be specified once. if (isset($params['BasePath'])) { $base_arguments['BasePath'] = $params['BasePath']; } else { if (empty($base_arguments['BasePath'])) { $base_arguments['BasePath'] = '/js/fckeditor/'; } } $base_arguments['InstanceName'] = $params['InstanceName']; if (isset($params['Value'])) { $base_arguments['Value'] = $params['Value']; } else { $base_arguments['Value'] = ''; } if (isset($params['Width'])) { $base_arguments['Width'] = $params['Width']; } if (isset($params['Height'])) { $base_arguments['Height'] = $params['Height']; } if (isset($params['ToolbarSet'])) { $base_arguments['ToolbarSet'] = $params['ToolbarSet']; } if (isset($params['CheckBrowser'])) { $base_arguments['CheckBrowser'] = $params['CheckBrowser']; } if (isset($params['DisplayErrors'])) { $base_arguments['DisplayErrors'] = $params['DisplayErrors']; } // Use all other parameters for the config array (replace if needed) $other_arguments = array_diff_assoc($params, $base_arguments); $config_arguments = array_merge($config_arguments, $other_arguments); require_once $base_arguments["BasePath"] . "/fckeditor.php"; $oFCKeditor = new FCKeditor($base_arguments["InstanceName"]); $oFCKeditor->BasePath = script_url . "/fckeditor/"; $oFCKeditor->ToolbarSet = "Basic"; return $oFCKeditor->Create(); }
function load($field, $width = 400) { $field = explode('.', $field); if (empty($field[1])) { // need to know how to call a model from a helper } else { $model = $field[0]; $controller = $field[1]; } //require_once (WWW_ROOT.'js'.DS.'fck'.DS.'fckeditor.php'); App::import('Vendor', 'fckeditor'); $oFCKeditor = new FCKeditor('data[' . $model . '][' . $controller . ']'); $oFCKeditor->BasePath = Configure::read('path') . 'js/fck/'; $oFCKeditor->Value = $this->data[$model][$controller]; $oFCKeditor->Height = $width; $oFCKeditor->Create(); }
function smarty_function_fckeditor($params, &$smarty) { require_once SITE_DIR . 'classes/FCKeditor.class.php'; #print_r($params); foreach ($params as $_key => $_value) { switch ($_key) { case 'source': ${$_key} = $_value; break; case 'toolbar': ${$_key} = $_value; break; case 'name': ${$_key} = $_value; break; case 'width': ${$_key} = $_value; break; case 'height': ${$_key} = $_value; break; } } $output = ''; if (!isset($name)) { $name = 'fckContent'; } $oFCKeditor = new FCKeditor($name); if (isset($height)) { $oFCKeditor->Height = $height; } if (isset($width)) { $oFCKeditor->Width = $width; } if (!isset($toolbar)) { $oFCKeditor->ToolbarSet = 'Default'; } else { $oFCKeditor->ToolbarSet = $toolbar; } $oFCKeditor->Value = $source; $output .= $oFCKeditor->Create(true); return $output; }
public function editeur($name, $value = '', $height = '500px', $width = '100%') { require_once 'js/fckeditor/fckeditor.php'; $oFCKeditor = new FCKeditor($name); $oFCKeditor->BasePath = url::base() . 'js/fckeditor/'; $oFCKeditor->Value = $value; $oFCKeditor->Config['EnterMode'] = 'br'; $oFCKeditor->Config['AutoDetectLanguage'] = false; $oFCKeditor->Config['DefaultLanguage'] = 'fr'; $oFCKeditor->Config["UserFilesAbsolutePath"] = url::base() . 'images/'; $oFCKeditor->Config["UserFilesPath"] = url::base() . 'images/'; $oFCKeditor->Config["SkinPath"] = $oFCKeditor->BasePath . 'editor/skins/default/'; $oFCKeditor->SmileyPath = $oFCKeditor->BasePath . 'editor/images/smiley/msn/'; $oFCKeditor->Height = $height; $oFCKeditor->Width = $width; $oFCKeditor->FormatOutput = true; $oFCKeditor->FormatSource = true; $oFCKeditor->Create(); }
public function execute($event = '', $item = array()) { parent::execute(); $inUser = cmsUser::getInstance(); cmsCore::includeFile('plugins/p_fckeditor/fckeditor/fckeditor.php'); $oFCKeditor = new FCKeditor($item['name']); $oFCKeditor->BasePath = '/plugins/p_fckeditor/fckeditor/'; $oFCKeditor->Height = $item['height']; $oFCKeditor->Width = $item['width']; $oFCKeditor->ToolbarSet = $inUser->is_admin ? 'Admin' : 'Basic'; $oFCKeditor->Value = $item['text']; $oFCKeditor->Config['DefaultLanguage'] = cmsConfig::getConfig('lang'); $oFCKeditor->Config['AutoDetectLanguage'] = false; if (!$inUser->is_admin) { $oFCKeditor->Config['ImageBrowser'] = false; $oFCKeditor->Config['LinkUpload'] = false; $oFCKeditor->Config['LinkBrowser'] = false; } ob_start(); $oFCKeditor->Create(); return ob_get_clean(); }
function get_edit_page() { $list = ""; $query = "select id, content from mdl_faq where id=1"; $result = $this->db->query($query); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $content = $row['content']; } $oFCKeditor = new FCKeditor('editor'); $oFCKeditor->BasePath = $this->editor_path; $oFCKeditor->Value = $content; $editor = $oFCKeditor->Create(false); $list = $list . "<table class='table table-hover' border='0'>"; $list = $list . "<tr>"; $list = $list . "</td > {$editor}</td>"; $list = $list . "</tr>"; $list = $list . "<tr>"; $list = $list . "<td align='left' style='padding-left:0px'><button type='button' id='save_faq' class='btn btn-primary' style='spacing-left:0px;'>Save</button></td>"; $list = $list . "</tr>"; $list = $list . "</table>"; return $list; }
public function fckEditor($name = '', $value = '', $options = array()) { // $baseUrl = $this->_view->BaseUrl(); // can be auto-loaded from a non-public library dir // FCKeditor.php = renamed fckeditor_php(4|5).php include_once 'js/fckeditor/fckeditor.php'; //die; $oFCKeditor = new FCKeditor($name); // Custom configuration settings // Place in it's own Dir to allow updates of FCKeditor w/o changes //$oFCKeditor->Config['CustomConfigurationsPath'] = $baseUrl . '/js/configs/myFCKconfig.js'; // Default configuration $oFCKeditor->BasePath = JS_URL . 'fckeditor/'; // must direct to the site's public area //$oFCKeditor->ToolbarSet = ((isset($options['ToolbarSet'])) ? $options['ToolbarSet'] : 'Tsc_mighty'); $oFCKeditor->ToolbarSet = isset($options['ToolbarSet']) ? $options['ToolbarSet'] : 'Basic'; $oFCKeditor->Width = empty($options['Width']) ? '100%' : $options['Width']; $oFCKeditor->Height = empty($options['Height']) ? 500 : $options['Height']; $oFCKeditor->Config['SkinPath'] = 'skins/silver/'; $oFCKeditor->Value = $value; return $oFCKeditor->Create(); }
function smarty_function_fck_htmlarea($params, &$smarty) { $root =& XCube_Root::getSingleton(); $textFilter =& $root->getTextFilter(); if (!empty($params['name'])) { // Fetch major elements from $params. $name = trim($params['name']); // TODO get value is need custom filer ?? $value = isset($params['value']) ? $params['value'] : null; $id = isset($params['id']) ? trim($params['id']) : FCK_HTMLAREA_DEFID_PREFIX . $name; // FCK editor options $params. $width = isset($params['width']) ? htmlspecialchars(trim($params['width']), ENT_QUOTES) : FCK_HTMLAREA_DEFAULT_WIDTH; $height = isset($params['height']) ? htmlspecialchars(trim($params['height']), ENT_QUOTES) : FCK_HTMLAREA_DEFAULT_HIGHT; $basepath = isset($params['basepath']) ? htmlspecialchars(trim($params['basepath']), ENT_QUOTES) : FCK_HTMLAREA_DEFAULT_BASEPATH; $toolbar = isset($params['toolbar']) ? htmlspecialchars(trim($params['toolbar']), ENT_QUOTES) : FCK_HTMLAREA_DEFAULT_TOOLBAR; $skin = isset($params['skin']) ? htmlspecialchars(trim($params['skin']), ENT_QUOTES) : FCK_HTMLAREA_DEFAULT_SKIN; // TODO include_once is chenge require_once ?? // TODO include_once is move this heder ?? include_once XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.php'; ob_start(); $oFCKeditor = new FCKeditor($name); $oFCKeditor->BasePath = XOOPS_URL . $basepath; $oFCKeditor->Value = $value; $oFCKeditor->Height = $height; // options if (isset($toolbar)) { $oFCKeditor->ToolbarSet = $toolbar; } if (isset($skin)) { $oFCKeditor->Config['SkinPath'] = XOOPS_URL . $basepath . 'editor/skins/' . $skin . '/'; } $oFCKeditor->Create(); $editor = ob_get_contents(); ob_end_clean(); // Output. print $editor; } }
<tr> <td colspan="2"> <?php if ($rows_cx['cont']) { $cont = $rows_cx['cont']; } else { $cont; } if ($cont) { include 'fckeditor/fckeditor.php'; $sBasePath = $_SERVER['PHP_SELF']; $sBasePath = dirname($sBasePath) . '/fckeditor/'; $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value = $cont; $oFCKeditor->Create(); } else { include 'editor.php'; } ?> </td> </tr> <tr> <td colspan="2"> <input name="bs1" type="hidden" id="bs1" value="<?php echo $bs; ?> "/> <input name="id" type="hidden" id="id" value="<?php echo $id;
public function editpage() { global $q, $tpl; $sql = new MySQLObject(); if ($sql->query("\r\nSELECT\r\n\t" . $q->table('pages') . ".`pid`,\r\n\t" . $q->table('pages') . ".`header`,\r\n\t" . $q->table('pages') . ".`slug`,\r\n\t" . $q->table('pages') . ".`path`,\r\n\t" . $q->table('pages') . ".`content`,\r\n\t" . $q->table('pages') . ".`parent`\r\nFROM " . $q->table('pages') . "\r\nWHERE (" . $q->table('pages') . ".`pid` = " . intval($_GET['pid']) . ")\r\n")) { $page = $sql->fetch_one(); $fck = new FCKeditor('page[content]'); $fck->BasePath = './app/lib/js/fckeditor/'; $fck->Value = $page->content; $fck->Height = 512; ob_start(); $fck->Create(); $content = ob_get_contents(); ob_end_clean(); $tpl->assign(array('PAGE.ID' => $page->pid, 'PAGE.HEADER' => $page->header, 'PAGE.SLUG' => $page->slug, 'PAGE.PATH' => $page->path, 'PAGE.CONTENT' => isset($content) ? $content : $page->content, 'PAGE.CONTENT_GEEEDIT' => str_replace("\r\n", "'+\r'", $page->content), 'PAGE.PARENT' => $page->parent)); } }
display:block; position:absolute; top:-120px; left:50px; width:auto; text-align: center} </style> </div></td> <td> <!-- <textarea name="content" id="rich_text" cols="60" rows="18" aria-hidden="true" style="display: none;"> </textarea> --> <?php $fck = new FCKeditor('news_full'); $fck->BasePath = sBASEPATH; $fck->Value = $get['news_full']; $fck->Width = '100%'; $fck->Height = 500; $fck->Create(); ?> </td> </tr> <!-- <tr> <td align="right">Thứ tự :</td> <td><input type="text" size="10" name="ordering" value="0"> (* số cao xếp trước) </td> </tr> --> <tr> <td colspan="2"> </td> </tr> <tr class="row-header"> <td colspan="2">Dùng cho SEO</td>
<label for="price">Price : </label> <input name="price" id="price" type="text" value="<?php echo $product["Price"] / 1000; ?> " onkeydown="return ( event.ctrlKey || event.altKey || (47<event.keyCode && event.keyCode<58 && event.shiftKey==false) || (95<event.keyCode && event.keyCode<106) || (event.keyCode==8) || (event.keyCode==9) || (event.keyCode>34 && event.keyCode<40) || (event.keyCode==46) )" /> <span style="font-size: 20px; color: red">,000</span> <?php //$path = rtrim($_SERVER['PHP_SELF'],"ce/module/dangtindichvu.php/")."/library/fckeditor/"; include "../../library/fckeditor/fckeditor.php"; $description = new FCKeditor("description"); $description->BasePath = "../../library/fckeditor/"; $description->Height = 300; $description->Value = $product['Description']; $description->ToolbarSet = 'MyTool'; $description->Create(); ?> </fieldset> <div align="center"> <input id="button1" type="submit" value="Save" name="btnUpdateProduct"/> </div> </form> </div> </div> </div>
<h3>Test Input:</h3> <textarea rows="5" name="test_input" style="width:83%"></textarea> </div> <div class="am-form-group"> <h3>Test Output:</h3> <textarea rows="5" name="test_output" style="width:83%"></textarea> </div> <div class="am-form-group"> <h3>Hint:</h3> <?php $output = new FCKeditor('hint'); $output->BasePath = '../fckeditor/'; $output->Height = 250; $output->Width = 800; $output->Value = '<p></p>'; $output->Create(); ?> </div> <div class="am-form-group"> SpecialJudge: N<input type=radio name=spj value='0' checked>Y<input type=radio name=spj value='1'> </div> <div class="am-form-group"> Source:<textarea rows="1" name="source" style="width:83%"></textarea> </div> <div class="am-form-group"> <button type="submit" class="am-btn am-btn-success" style="margin-bottom:40px;">submit</button> </div> </form> </div> </div>
<td> <textarea name="author" cols="75" rows="2" id="author" style="width:100%"><?php echo $contest_title; ?> </textarea> </td> </tr> <tr> <td>Hint</td> <td> <?php $editor = new FCKeditor("hint"); $editor->BasePath = "./FCKeditor/"; $editor->ToolbarSet = "Sicily"; $editor->Create(); ?> </td> </tr> <tr> <td>Sample Input</td> <td> <textarea name="sample_input" cols="75" rows="5" id="sample_input" style="width:100%"></textarea> </td> </tr> <tr> <td>Sample Output</td> <td> <textarea name="sample_output" cols="75" rows="5" id="sample_output" style="width:100%"></textarea>
function theme_minicms_edit_editor(&$cms) { global $MINICMS, $referer, $lang_minicms, $CONFIG, $THEME_DIR; ob_start(); echo '<SELECT name="type">'; foreach ($MINICMS['conType'] as $key => $conType) { if ($key == $cms['type']) { echo "<OPTION selected value=\"{$key}\">{$conType}</OPTION>"; } else { echo "<OPTION value=\"{$key}\">{$conType}</OPTION>"; } } echo '</SELECT>'; $cms['select_type'] = ob_get_clean(); print <<<EOT <form name="post" method="post" action="index.php?file=minicms/cms_edit&referer={$referer}"> EOT; starttable("100%", $cms['title'], 3); print <<<EOT <tr> <td colspan="3" align="center"> <h2>{$cms['message']}</h2> </td> </tr> <tr> <td>{$lang_minicms['title']}</td> <td>{$lang_minicms['type']}</td> <td>{$lang_minicms['content']}</td> </tr> <tr valign="top"> <td class="row2"> <input value="{$cms['ID']}" type="hidden" name="id" > <input type="text" value="{$cms['title']}" class="post" tabindex="1" style="width: 450px;" maxlength="60" size="45" name="title" /> </td> <td class="row2"> {$cms['select_type']} </td> <td class="row2"> <input type="text" value="{$cms['conid']}" class="post" tabindex="3" style="width: 50px;" maxlength="5" name="conid" /> </td> </tr> <tr valign="top"> <td class="row2" colspan="3"> EOT; foreach (get_smilies_table2() as $smiley) { $smilies[] = $smiley[1]; } //$smilies="['".implode("','",$smilies)."']"; //$smilies=implode(",",$smilies); //echo "<br>$smilies"; $superCage = Inspekt::makeSuperCage(); $cmpath = str_replace('index.php', '', $superCage->server->getRaw('PHP_SELF')); $userfilespath = $cmpath . $CONFIG['fullpath']; $basepath = $cmpath . 'plugins/minicms/fckeditor/'; $oFCKeditor = new FCKeditor('minicms_content'); $oFCKeditor->BasePath = $basepath; $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '350'; $oFCKeditor->Value = $cms['content']; $oFCKeditor->Config['BaseHref'] = $CONFIG['ecards_more_pic_target']; $oFCKeditor->Config['CustomConfigurationsPath'] = $basepath . 'minicms_config.js'; // $oFCKeditor->Config['SmileyPath'] = $cmpath . 'images/smiles/'; //couldn't get the smilies to work // $oFCKeditor->Config['SmileyImages'] = $smilies; //I posted the problem of FCK's project site $oFCKeditor->Config['EditorAreaCSS'] = $cmpath . $THEME_DIR . 'style.css'; $oFCKeditor->Config['StylesXmlPath'] = $basepath . 'style.xml'; // $oFCKeditor->Config['UseBROnCarriageReturn'] = true; I don't think we wan't this option. // $oFCKeditor->Config['LinkBrowserURL'] = $basepath . 'editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath='.$userfilespath; // $oFCKeditor->Config['ImageBrowserURL'] = $basepath . 'editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath='.$userfilespath; // $oFCKeditor->Config['FlashBrowserURL'] = $basepath . 'editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath='.$userfilespath; // $oFCKeditor->Config['MediaBrowserURL'] = $basepath . 'editor/filemanager/browser/default/browser.html?Type=Media&Connector=connectors/php/connector.php&ServerPath='.$userfilespath; // $oFCKeditor->Config['LinkUploadURL'] = $basepath . 'editor/filemanager/upload/php/upload.php&ServerPath='.$userfilespath; // $oFCKeditor->Config['ImageUploadURL'] = $basepath . 'editor/filemanager/upload/php/upload.php?Type=Image&ServerPath='.$userfilespath; // $oFCKeditor->Config['FlashUploadURL'] = $basepath . 'editor/filemanager/upload/php/upload.php?Type=Flash&ServerPath='.$userfilespath; // $oFCKeditor->Config['MediaUploadURL'] = $basepath . 'editor/filemanager/upload/php/upload.php?Type=Media&ServerPath='.$userfilespath; // $oFCKeditor->Config['PluginsPath'] = $basepath . 'editor/plugins/'; // $oFCKeditor->Config['SkinPath'] = $basepath . 'editor/skins/silver/'; // $oFCKeditor->Config['Debug'] = true; // $oFCKeditor->Config['UserFilesPath'] = $userfilespath; $oFCKeditor->Create(); print <<<EOT </td> </tr> <tr> <td align="center" colspan="3" class="catBottom"> <input value="{$lang_minicms['preview']}" class="mainoption" name="submit" tabindex="5" type="submit"> <input value="{$lang_minicms['submit']}" class="mainoption" name="submit" tabindex="6" accesskey="s" type="submit"> </td> </tr> </form> EOT; endtable(); }
function fck($name, $value) { $oFCKeditor = new FCKeditor($name); $oFCKeditor->BasePath = '/fckeditor/'; $oFCKeditor->Value = $value; $oFCKeditor->Create(); }
/** * 获取编辑器 * * @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(); } */ } } }
function edit($id) { global $EVENTS_TB, $CAT_TB, $mth, $calstartyear, $caladvanceyear, $notimeentry, $time12hour, $useFCKEditor, $FCKEditorBasePath; $query = "select id,title,description,url,email,cat,cat_name,starttime,endtime,day,month,year from " . $EVENTS_TB . " left join " . $CAT_TB . " on " . $EVENTS_TB . ".cat=" . $CAT_TB . ".cat_id where " . $EVENTS_TB . ".id='{$id}'"; $result = mysql_query($query); $rowe = mysql_fetch_object($result); echo "<div class=titlefont>" . translate("Update Event") . "</div><br/>\n"; echo "<div class=normalfont>\n"; echo "<form name=evfrm action='cal_addevent.php?op=upevent&id={$id}' method=post>\n"; echo translate("Event Title") . "<br/>\n"; echo "<input type=text name=title value='" . stripslashes(quote145($rowe->title)) . "' size=70 onkeypress='return imposeMaxLength(this, 255)';><br/>\n"; echo translate("Event Description") . "<br/>\n"; if ($useFCKEditor) { $oFCKeditor = new FCKeditor('description'); $oFCKeditor->BasePath = $FCKEditorBasePath; $oFCKeditor->Value = stripslashes($rowe->description); $oFCKeditor->Create(); } else { echo "<textarea name=description cols=70 rows=7>"; echo stripslashes(str_replace("<br />", "", $rowe->description)); echo "</textarea><br/>\n"; } echo translate("Email") . " (" . translate("Optional") . ") <br/>\n"; echo "<input type=text name=email value=\"" . $rowe->email . "\" size=40><br/>\n"; echo "URL (" . translate("Optional") . ") <br/>\n"; echo "<input type=text name=url value='"; if (trim($rowe->url) != "" && strtolower(substr($rowe->url, 0, 4)) != "http") { echo "http://" . $rowe->url . "' size=40><br/>\n"; } else { echo $rowe->url . "' size=40><br/>\n"; } // get the categories echo translate("Event Category") . "<br/>"; echo "<select name=cat>\n\t"; $query = "select cat_id,cat_name from " . $CAT_TB . " order by cat_name"; $result = mysql_query($query); while ($row = mysql_fetch_object($result)) { echo "\t<option value=" . $row->cat_id; if ($rowe->cat == $row->cat_id) { echo " selected"; } echo ">" . stripslashes($row->cat_name) . "\n"; } echo "</select>\n<br/>\n"; if ($notimeentry == 0) { // get start time echo translate("Start Time") . " (hh:mm) <br/>\n"; echo " <select name=starttimehr>\n\t<option value='--'>--\n"; $thour = 24; $sthour = 0; $midnight = false; if ($time12hour == 1) { $thour = 13; $sthour = 1; } if ($time12hour == 1 && substr($rowe->starttime, 0, 2) == "00") { $midnight = true; } for ($i = $sthour; $i < $thour; $i++) { if ($i < 10) { echo "\t<option value='0{$i}'"; if (substr($rowe->starttime, 0, 2) == "0" . $i) { echo " selected"; } if ($time12hour == 1) { if (intval(substr($rowe->starttime, 0, 2)) - 12 == $i) { echo " selected "; } } echo ">0{$i}\n"; } else { echo "\t<option value={$i}"; if (substr($rowe->starttime, 0, 2) == "{$i}") { echo " selected"; } if ($midnight && $i == 12) { echo " selected "; } if ($time12hour == 1) { if (intval(substr($rowe->starttime, 0, 2)) - 12 == $i) { echo " selected "; } } echo ">{$i}\n"; } } echo "</select> <b>:</b> \n"; echo "<select name=starttimemin>\n"; for ($i = 0; $i < 60; $i = $i + 5) { if ($i < 10) { echo "\t<option value='0{$i}'"; if (substr($rowe->starttime, 3, 2) == "0" . $i) { echo " selected"; } echo ">0{$i}\n"; } else { echo "\t<option value={$i}"; if (substr($rowe->starttime, 3, 2) == "{$i}") { echo " selected"; } echo ">{$i}\n"; } } echo "</select>\n"; if ($time12hour == 1) { echo " <select name='startperiod'>\n"; echo "\t<option value='am'"; if (intval(substr($rowe->starttime, 0, 2)) < 12) { echo " selected "; } echo ">am"; echo "\t<option value='pm'"; if (intval(substr($rowe->starttime, 0, 2)) >= 12) { echo " selected "; } echo ">pm"; echo "</select><br/>\n"; } else { echo "<input type='hidden' name='startperiod' value=''><br/>\n"; } // get end time echo translate("End Time") . " (hh:mm) <br/>\n"; echo " <select name=endtimehr>\n\t<option value='--'>--\n"; $thour = 24; $sthour = 0; $midnight = false; if ($time12hour == 1) { $thour = 13; $sthour = 1; } if ($time12hour == 1 && substr($rowe->endtime, 0, 2) == "00") { $midnight = true; } for ($i = $sthour; $i < $thour; $i++) { if ($i < 10) { echo "\t<option value='0{$i}'"; if (substr($rowe->endtime, 0, 2) == "0" . $i) { echo " selected"; } if ($time12hour == 1) { if (intval(substr($rowe->endtime, 0, 2)) - 12 == $i) { echo " selected "; } } echo ">0{$i}\n"; } else { echo "\t<option value={$i}"; if (substr($rowe->endtime, 0, 2) == "{$i}") { echo " selected"; } if ($midnight && $i == 12) { echo " selected "; } if ($time12hour == 1) { if (intval(substr($rowe->endtime, 0, 2)) - 12 == $i) { echo " selected "; } } echo ">{$i}\n"; } } echo "</select> <b>:</b> \n"; echo "<select name=endtimemin>\n"; for ($i = 0; $i < 60; $i = $i + 5) { if ($i < 10) { echo "\t<option value='0{$i}'"; if (substr($rowe->endtime, 3, 2) == "0" . $i) { echo " selected"; } echo ">0{$i}\n"; } else { echo "\t<option value={$i}"; if (substr($rowe->endtime, 3, 2) == "{$i}") { echo " selected"; } echo ">{$i}\n"; } } echo "</select>\n"; if ($time12hour == 1) { echo " <select name='endperiod'>\n"; echo "\t<option value='am'"; if (intval(substr($rowe->endtime, 0, 2)) < 12) { echo " selected "; } echo ">am"; echo "\t<option value='pm'"; if (intval(substr($rowe->endtime, 0, 2)) >= 12) { echo " selected "; } echo ">pm"; echo "</select><br/>\n"; } else { echo "<input type='hidden' name='endperiod' value=''><br/>\n"; } } // get days echo translate("Date") . "<br/>\n"; echo "<select name=bday>\n\t"; for ($i = 1; $i <= 31; $i++) { echo "\t<option value=" . $i; if ($rowe->day == $i) { echo " selected"; } echo ">{$i}\n"; } echo "</select> \n"; // get months echo "<select name=bmonth>\n\t<option value=0>" . translate("Month") . "\n"; for ($i = 1; $i < 13; $i++) { echo "\t<option"; if ($rowe->month == $i) { echo " selected"; } echo " value=" . $i . ">" . ucfirst($mth[$i]) . "\n"; } echo "</select> \n"; // get year from "calstartyear" and give "caladvanceyear" years more to select echo "<select name=byear>\n\t<option value=0>" . translate("Year") . "\n"; $year = date("Y"); for ($i = $calstartyear; $i <= $year + $caladvanceyear; $i++) { echo "\t<option value={$i}"; if ($rowe->year == $i) { echo " selected "; } echo ">{$i}\n"; } echo "</select>\n"; $pdate = date("Y-m-d", mktime(0, 0, 0, $rowe->month, $rowe->day, $rowe->year)); echo " <input type=button value=\"" . translate("Select") . "\" onclick=\"Javascript:wopen('cal_date.php?op=smallcal&date={$pdate}&frmname=evfrm&frmday=bday&frmmth=bmonth&frmyear=byear','pickdate',220,200,'no');\"><br/>"; echo "<br/><input type=submit value=\"" . translate("Update Event") . "\">\n \n"; echo "<input type=button value=\"" . translate("Cancel") . "\" onClick=\"Javascript:window.close();\">\n<br/>\n"; echo "<form></div>\n"; }
</select> <?php require_once "../include/set_post_key.php"; ?> <br>Problems:<input class=input-xxlarge type=text size=60 name=cproblem value="<?php echo isset($plist) ? $plist : ""; ?> "> <br> <p align=left>Description:<br><!--<textarea rows=13 name=description cols=80></textarea>--> <?php $fck_description = new FCKeditor('description'); $fck_description->BasePath = '../fckeditor/'; $fck_description->Height = 300; $fck_description->Width = 600; $fck_description->Value = $description; $fck_description->Create(); ?> Users:<textarea name="ulist" rows="20" cols="20"></textarea> <br /> *可以将学生学号从Excel整列复制过来,然后要求他们用学号做UserID注册,就能进入Private的比赛作为作业和测验。 <p><input type=submit value=Submit name=submit><input type=reset value=Reset name=reset></p> </form> <?php } require_once "../inc/footer.php"; ?>