本文整理汇总了PHP中FCKeditor类的典型用法代码示例。如果您正苦于以下问题:PHP FCKeditor类的具体用法?PHP FCKeditor怎么用?PHP FCKeditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FCKeditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateEmail
function CreateEmail($mailto = '', $subject = '', $text = '')
{
$this->AddStrings($row);
if ($mailto == 'use_client_selection' && $_SESSION['use_client_selection']) {
$client_selection = join(' AND ', $_SESSION['use_client_selection']);
$row['use_client_selection'] = '1';
$emails = $this->GetValue("SELECT COUNT(*) FROM clients AS c WHERE subscribe=1 AND " . $client_selection);
$row['mailto'] = sprintf($this->str('client_selection'), $emails);
$row['mailto_readonly'] = 'READONLY';
} else {
$row['mailto'] = htmlspecialchars($mailto);
$row['use_client_selection'] = '0';
$row['client_selector']['value'] = ' ';
}
$row['subject'] = htmlspecialchars($subject);
$managers = sql_getRows("SELECT id, CONCAT(fullname,' <',email,'>') FROM admins WHERE email<>'' " . (is_root() ? '' : "AND id IN (" . join(',', $this->user['subst']) . ") AND fullname!=''") . " ORDER BY fullname", true);
$row['managers'] = $this->GetArrayOptions($managers, $this->user['id'], true);
###
include "editor/fckeditor.php";
$oFCKeditor = new FCKeditor();
$oFCKeditor->ToolbarSet = 'Common';
$oFCKeditor->Value = $text;
$row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%');
###
return Parse($row, $this->name . '.tmpl');
}
示例2: htmlEdit
/**
* @param $name 隐藏字段名
* @param $value 隐藏字段值
* @param $toolbar 工具栏样式,可选值 Basic Default
* @param $skin 面板,可选值 default office2003 silver
* @param $Lang 语言,可选值 zh-cn zh e
*
*/
public function htmlEdit($name, $value, $height = 420, $width = 720, $toolbar = 'Default', $skin = 'office2003', $Lang = 'en')
{
require_once __SITE_ROOT__ . DS . "www/js/FCKeditor/fckeditor.php";
$sBasePath = "/js/FCKeditor/";
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = $sBasePath;
if ($Lang) {
$oFCKeditor->Config['AutoDetectLanguage'] = false;
}
if ($Lang) {
$oFCKeditor->Config['DefaultLanguage'] = $Lang;
}
if ($skin) {
$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . $skin . '/';
}
if ($toolbar) {
$oFCKeditor->ToolbarSet = $toolbar;
}
if ($width) {
$oFCKeditor->Width = $width;
}
if ($height) {
$oFCKeditor->Height = $height;
}
$oFCKeditor->Value = $value;
return $oFCKeditor->CreateHtml();
}
示例3: editor
function editor($fieldname, $content)
{
if (!is_file($this->coderoot . '/fckeditor/fckeditor.php')) {
return '<textarea name="' . $fieldname . '">' . htmlspecialchars($content) . '</textarea>';
}
include_once $this->coderoot . '/fckeditor/fckeditor.php';
if (!class_exists('FCKeditor')) {
return 'Editor class not found';
}
$oFCKeditor = new FCKeditor($fieldname);
$fckPath = getConfig("fckeditor_path");
$oFCKeditor->BasePath = $fckPath;
$oFCKeditor->ToolbarSet = 'Default';
$oFCKeditor->Value = $content;
$w = getConfig("fckeditor_width");
$h = getConfig("fckeditor_height");
if (isset($_SESSION["fckeditor_height"])) {
$h = sprintf('%d', $_SESSION["fckeditor_height"]);
}
# for version 2.0
if ($h < 400) {
$h = 400;
}
$oFCKeditor->Height = $h;
$oFCKeditor->Width = $w;
return $oFCKeditor->CreateHtml();
}
示例4: form_fckeditor
function form_fckeditor($data = '', $value = '', $extra = '')
{
$CI =& get_instance();
$fckeditor_basepath = $CI->config->item('fckeditor_basepath');
require_once $_SERVER["DOCUMENT_ROOT"] . '/' . $fckeditor_basepath . 'fckeditor.php';
$instanceName = is_array($data) && isset($data['name']) ? $data['name'] : $data;
$fckeditor = new FCKeditor($instanceName);
if ($fckeditor->IsCompatible()) {
$fckeditor->Value = html_entity_decode($value);
$fckeditor->BasePath = $fckeditor_basepath;
if ($fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default')) {
$fckeditor->ToolbarSet = $fckeditor_toolbarset;
}
if (is_array($data)) {
if (isset($data['value'])) {
$fckeditor->Value = html_entity_decode($data['value']);
}
if (isset($data['basepath'])) {
$fckeditor->BasePath = $data['basepath'];
}
if (isset($data['toolbarset'])) {
$fckeditor->ToolbarSet = $data['toolbarset'];
}
if (isset($data['width'])) {
$fckeditor->Width = $data['width'];
}
if (isset($data['height'])) {
$fckeditor->Height = $data['height'];
}
}
return $fckeditor->CreateHtml();
} else {
return form_textarea($data, $value, $extra);
}
}
示例5: editor
function editor($input_name, $input_value, $height = "480", $upfile = true)
{
$prefix = Swoole\Auth::$session_prefix;
$editor = new FCKeditor($input_name);
if (substr(WEBPATH, -1, 1) == '/') {
$editor->BasePath = WEBROOT . "/swoole_plugin/fckeditor/";
//指定编辑器路径
} else {
$editor->BasePath = WEBROOT . "swoole_plugin/fckeditor/";
//指定编辑器路径
}
$editor->ToolbarSet = "Default";
//编辑器工具栏有Basic(基本工具),Default(所有工具)选择
$editor->Width = "100%";
$editor->Height = $height;
$editor->Value = $input_value;
$editor->Config['AutoDetectLanguage'] = true;
$editor->Config['DefaultLanguage'] = 'en';
$FCKeditor = $editor->CreateHtml();
$ext = <<<HTML
<script language="javascript">
function upfile_success(filepath)
{
\tvar fck = FCKeditorAPI.GetInstance("content");
\tfck.InsertHtml("<img src='"+ filepath +"' />");
}
</script>
<iframe src="{$editor->BasePath}plus/upload_image.php?prefix={$prefix}" height="40" width="100%" frameborder="0" scrolling="no"></iframe>
HTML;
if ($upfile) {
$FCKeditor .= $ext;
}
return $FCKeditor;
}
示例6: FCKEditor
/**
* Get the current user
*
* @return NovemberUser
*/
public function FCKEditor($name, $value = '', $basePath = '')
{
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = $basePath . '/';
$oFCKeditor->Value = $value;
$oFCKeditor->Create();
}
示例7: cmsEditor
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();
}
示例8: FckEditor
/**
* 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();
}
示例9: Send_Email
function Send_Email($mailto = '', $subject = '', $text = '')
{
$this->AddStrings($row);
// Берем из сессии
$use_client_selection = get('use_client_selection', array(), 's');
if ($mailto == 'use_client_selection' && $use_client_selection) {
$client_selection = join(' AND ', $use_client_selection);
$row['use_client_selection'] = '1';
$emails = $this->GetValue("SELECT COUNT(*) FROM auth_users AS c WHERE subscribe=1 AND " . $client_selection);
$row['mailto'] = sprintf($this->str('client_selection'), $emails);
$row['mailto_readonly'] = 'READONLY';
} else {
$row['mailto'] = h($mailto);
$row['use_client_selection'] = '0';
$row['client_selector']['value'] = ' ';
}
$row['subject'] = h($subject);
$managers = sql_getRows("SELECT id, CONCAT(fullname,' <',email,'>') FROM admins WHERE email<>'' " . " AND fullname!='' ORDER BY fullname", true);
$row['managers'] = $this->GetArrayOptions($managers, $this->user['id'], true);
###
include_fckeditor();
$oFCKeditor = new FCKeditor();
$oFCKeditor->ToolbarSet = 'Common';
$oFCKeditor->Value = $text;
$row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%');
###
return $this->Parse($row, $this->name . '.tmpl');
}
示例10: SpGetEditor
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();
}
}
示例11: getContent
function getContent()
{
$data = array();
$func = get('func', '', 'pg');
if (!empty($func)) {
$func = get('func', '', 'pg');
if (!empty($func)) {
$data = $this->{$func}();
}
} else {
global $user;
$data['current_user'] = $user['id'];
$data['managers'] = sql_getRows("SELECT id, CONCAT(login,' (',email,') ') as name FROM admins", true);
$this->AddStrings($data);
include_fckeditor();
$oFCKeditor = new FCKeditor();
$oFCKeditor->ToolbarSet = 'Common';
$oFCKeditor->Value = '';
$data['editor'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '100%');
$this->AddStrings($data);
}
$tpl = strtolower($this->dir . '/' . $this->name . (!empty($func) ? '.' . $func : '') . '.tmpl');
if (is_file($tpl)) {
return Parse($data, $tpl);
} else {
return $data;
}
}
示例12: render
function render()
{
include_once JIEQI_ROOT_PATH . '/lib/html/form/fckeditor/fckeditor.php';
$editor = new FCKeditor();
$editor->Value = $this->getValue();
return $editor->ReturnFCKeditor($this->getName(), $this->getWidth(), $this->getHeight());
}
示例13: smarty_function_editor
/**
* -------------------------------------------------------------
* @param InstanceName Editor instance name (form field name)
* @param Width optional width (css units)
* @param Height optional height (css units)
* @param CheckBrowser optional check the browser compatibility when rendering the editor
* @param DisplayErrors optional show error messages on errors while rendering the editor
*
*/
function smarty_function_editor($params, &$smarty)
{
global $ari;
require_once $ari->filesdir . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'editor' . DIRECTORY_SEPARATOR . 'fckeditor.php';
if (!isset($params['InstanceName']) || empty($params['InstanceName'])) {
$smarty->trigger_error('fckeditor: required parameter "InstanceName" missing');
}
$oFCKeditor = new FCKeditor($params['InstanceName']);
if ($ari->mode == 'admin') {
$oFCKeditor->BasePath = $ari->adminaddress . '/scripts/editor/';
} else {
$oFCKeditor->BasePath = $ari->webaddress . '/scripts/editor/';
}
if (isset($params['Value'])) {
$oFCKeditor->Value = $params['Value'];
}
/* if (isset ($params['Width']))
$oFCKeditor->Width = $params['Width'];
if (isset ($params['Height']))
$oFCKeditor->Height = $params['Height']; */
$oFCKeditor->Config['DefaultLanguage'] = substr($ari->agent->getSelectedLang(), 0, 2);
$oFCKeditor->Config['CustomConfigurationsPath'] = $oFCKeditor->BasePath . 'config.js';
if (isset($params['simple']) && $params['simple'] == true) {
$oFCKeditor->ToolbarSet = 'Small';
}
//$oFCKeditor->Create() ;
return $oFCKeditor->CreateHtml();
}
示例14: EditForm
function EditForm()
{
$id = get('id');
if ($id) {
$row = $this->GetRow($id);
} else {
$row['visible'] = 1;
$row['content_type'] = 'html';
$row['text'] = '';
$row['user_id'] = '';
}
$row['private_checked'] = $row['user_id'] ? 'checked' : '';
$row['user_id'] = $GLOBALS['user']['id'];
$row['options'] = $this->getSetOptions('content_type', $row['content_type']);
$row['vis_etext'] = $row['content_type'] == 'text' ? 'show' : 'hide';
$row['vis_ehtml'] = $row['content_type'] == 'html' ? 'show' : 'hide';
###
include_fckeditor();
$oFCKeditor = new FCKeditor();
$oFCKeditor->ToolbarSet = 'Common';
$oFCKeditor->Value = $row['text'];
$row['editor'] = $oFCKeditor->ReturnFCKeditor('editor[html]', '100%', '100%');
###
$this->AddStrings($row);
return $this->Parse($row, $this->name . '.editform.tmpl');
}
示例15: get_edit_page
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;
}