本文整理汇总了PHP中FCKeditor::CreateHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP FCKeditor::CreateHtml方法的具体用法?PHP FCKeditor::CreateHtml怎么用?PHP FCKeditor::CreateHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FCKeditor
的用法示例。
在下文中一共展示了FCKeditor::CreateHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
}
示例2: 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);
}
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: 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;
}
示例7: create_html_editor
function create_html_editor($input_name, $input_value = '')
{
$editor = new FCKeditor($input_name);
$editor->BasePath = '../includes/fckeditor/';
$editor->ToolbarSet = 'Normal';
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $input_value;
return $editor->CreateHtml();
}
示例8: createEditer
function createEditer($inputName, $inputValue = '', $width = '550', $height = '400', $toolbarSet = 'Basic')
{
$editor = new FCKeditor($inputName);
$editor->BasePath = "../FCKeditor/";
$editor->ToolbarSet = $toolbarSet;
$editor->Width = $width;
$editor->Height = $height;
$editor->Value = $inputValue;
$GLOBALS['smarty']->assign("editor", $editor->CreateHtml());
}
示例9: richField
function richField($name, $value)
{
$oFCKeditor = new FCKeditor($name);
$sBasePath = 'fckeditor/';
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Height = '100';
$oFCKeditor->Width = '367';
$oFCKeditor->Value = $value;
return $oFCKeditor->CreateHtml();
}
示例10: fck_editor
function fck_editor($editor_name, $type, $value = '')
{
global $config;
load("fckeditor.php", "", "fckeditor", 0);
$editor = new FCKeditor($editor_name);
$editor->BasePath = $config["base_url"] . 'fckeditor/';
$editor->ToolbarSet = $type;
$editor->Width = '100%';
$editor->Height = '320';
$editor->Value = $value;
$FCKeditor = $editor->CreateHtml();
return $FCKeditor;
}
示例11: __toString
public function __toString()
{
$oFCKeditor = new FCKeditor($this->name);
$oFCKeditor->BasePath = '/includes/libs/fckeditor/';
if (_PATH_ != '/') {
$oFCKeditor->BasePath = _PATH_ . '/includes/libs/fckeditor/';
}
$oFCKeditor->Value = $this->value;
$oFCKeditor->ToolbarSet = $this->toolbar;
$oFCKeditor->Width = $this->width;
$oFCKeditor->Height = $this->height;
return $oFCKeditor->CreateHtml();
}
示例12: process
public function process($pParams)
{
static $_init = false;
static $htmlPath = '';
extract($pParams);
//check the initialisation
if (!$_init) {
$path = CopixModule::getPath('htmleditor') . COPIX_CLASSES_DIR;
$htmlPath = CopixUrl::get() . 'js/FCKeditor/';
require_once $path . 'fckeditor.php';
$_init = true;
}
if (empty($content)) {
$content = ' ';
}
//name of the textarea.
if (empty($name)) {
throw new CopixTemplateTagException('htmleditor: missing name parameter');
} else {
if (!isset($width)) {
$width = CopixConfig::get('htmleditor|width');
//$width = '100%';
}
if (!isset($height)) {
$height = CopixConfig::get('htmleditor|height');
//$height = '450px';
}
/*
* ATTENTION les éléments de config viewPhototèque etc font doublon avec la sélection de la toolbarset, mais sont nécessaire à Copix
* Par contre si on ne les load pas, on a une erreur de FCKeditor, il faut donc supprimer ce gestionnaire d'erreur sinon on se prend un alert javascript
* le gestionnaire en question se trouve dans "FCKToolbarItems.GetItem" (chercher cette chaîne pour le trouver) et désactiver "alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
*/
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->BasePath = $htmlPath;
$oFCKeditor->Value = $content;
$oFCKeditor->ToolbarSet = 'Copix';
$oFCKeditor->Width = $width;
$oFCKeditor->Height = $height;
$oFCKeditor->Config['viewPhototheque'] = CopixModule::isEnabled('pictures') ? 'true' : 'false';
$oFCKeditor->Config['viewCmsLink'] = CopixModule::isEnabled('cms') ? 'true' : 'false';
$oFCKeditor->Config['viewLinkPopup'] = CopixModule::isEnabled('cms') ? 'true' : 'false';
$oFCKeditor->Config['viewDocument'] = CopixModule::isEnabled('document') ? 'true' : 'false';
$oFCKeditor->Config['viewMailto'] = 'true';
// Configuration de la feuille de style à utiliser.
//$oFCKeditor->Config['EditorAreaCSS'] = CopixUrl::get ().'styles/themes/hivers/hivers.css';
$out = $oFCKeditor->CreateHtml();
}
return $out;
}
示例13: create_html_editor
function create_html_editor($input_name, $input_value = '', $is_ret = false, $width = "500", $height = '300')
{
global $smarty;
$editor = new FCKeditor($input_name);
$editor->BasePath = '../fckeditor/';
$editor->ToolbarSet = 'Default';
$editor->Width = $width;
$editor->Height = $height;
$editor->Value = $input_value;
$FCKeditor = $editor->CreateHtml();
if ($is_ret) {
return $FCKeditor;
}
$smarty->assign('FCKeditor', $FCKeditor);
}
示例14: smarty_insert_editor
function smarty_insert_editor($params, &$smarty)
{
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
if (!isset($params['InstanceName']) || empty($params['InstanceName'])) {
$smarty->trigger_error('fckeditor: required parameter "InstanceName" missing');
}
$base_arguments = array('Width' => '100%', 'Height' => '380', 'ToolbarSet' => 'BasicNoticias');
$config_arguments = array('DocType' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', 'AutoDetectLanguage' => false, 'DefaultLanguage' => $_SESSION['language'], 'CustomConfigurationsPath' => "atrconfig.js", 'LinkDlgHideTarget' => true, 'DisableObjectResizing' => true, 'DisableFFTableHandles' => true, 'LinkDlgHideTarget' => true, 'LinkDlgHideAdvanced' => true, 'ImageDlgHideLink' => true, 'ImageDlgHideAdvanced' => true, 'FlashDlgHideAdvanced' => true, 'FormatOutput' => true, 'FormatSource' => true);
$sBasePath = $_SERVER['PHP_SELF'];
$sBasePath = '' . $smarty->get_config_vars('modulo_dir') . 'FCKeditor/';
if ($smarty->FCKCFG['ID_SITE']) {
$sBaseSrc = $smarty->get_config_vars('patchsite') . 'sites/' . $smarty->FCKCFG['ID_SITE'] . '/';
} else {
$sBaseSrc = $smarty->get_config_vars('patchsite') . '/';
}
// 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);
$oFCKeditor->Config = $config_arguments;
// parametro Value
$oFCKeditor = new FCKeditor($params['InstanceName']);
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->Value = isset($params['Value']) ? $params['Value'] : $smarty->FCKCFG['Value'];
/*$smarty->register_outputfilter("pre_editor");
$oFCKeditor->Value = $smarty->fetch(realpath($oFCKeditor->Value));*/
if (@is_file($oFCKeditor->Value)) {
$file = new Arquivo($oFCKeditor->Value);
$pfile = file_get_contents($file->origem);
$searcharray = array("/(\\<head)(.*)?(\\>)(.*)(\\<\\/head\\>)/siU", "/(src=\")(.*)(\")/siU", "/(\\{([^#|^\$](.*)))(\\s)(.*)?(\\})/siU");
//"/(\<)(head)(\>)(.*)(\<\/)(head)(\>)/siU";
$replacearray = array("", "\\1{$sBaseSrc}\\2\\3", '<div modulo="\\2" class="FCK__Inserts" \\5></div>');
$oFCKeditor->Value = preg_replace($searcharray, $replacearray, $pfile);
}
$oFCKeditor->Config['ImageBrowserURL'] = $smarty->get_config_vars('http') . $smarty->get_config_vars('modulo_dir') . 'FCKeditor/editorftp/browser.html?ServerPath=' . $smarty->get_config_vars('patchsite') . 'sites/' . $smarty->FCKCFG['ID_SITE'] . '/templates/&Type=Image&Connector=connectors/connector.php';
$oFCKeditor->Config['LinkBrowserURL'] = $smarty->get_config_vars('http') . $smarty->get_config_vars('modulo_dir') . 'FCKeditor/editorftp/browser.html?ServerPath=' . $smarty->get_config_vars('patchsite') . 'sites/' . $smarty->FCKCFG['ID_SITE'] . '/templates/&Connector=connectors/connector.php';
$oFCKeditor->Config['FlashBrowserURL'] = $smarty->get_config_vars('http') . $smarty->get_config_vars('modulo_dir') . 'FCKeditor/editorftp/browser.html?ServerPath=' . $smarty->get_config_vars('patchsite') . 'sites/' . $smarty->FCKCFG['ID_SITE'] . '/templates/&Type=Flash&Connector=connectors/connector.php';
$oFCKeditor->Width = isset($params['Width']) ? $params['Width'] : $base_arguments['Width'];
$oFCKeditor->Height = isset($params['Height']) ? $params['Height'] : $base_arguments['Height'];
$oFCKeditor->ToolbarSet = isset($params['ToolbarSet']) ? $params['ToolbarSet'] : $base_arguments['ToolbarSet'];
$oFCKeditor->Config['AutoDetectLanguage'] = isset($params['AutoDetectLanguage']) ? $params['AutoDetectLanguage'] : $config_arguments['AutoDetectLanguage'];
$oFCKeditor->Config['DefaultLanguage'] = isset($params['DefaultLanguage']) ? $params['DefaultLanguage'] : $config_arguments['DefaultLanguage'];
$oFCKeditor->Config['CustomConfigurationsPath'] = isset($smarty->cfg['CustomConfigurationsPath']) ? $smarty->cfg['CustomConfigurationsPath'] : $config_arguments['CustomConfigurationsPath'];
$oFCKeditor->Config['EditorAreaCSS'] = isset($params['EditorAreaCSS']) ? $params['EditorAreaCSS'] : $smarty->FCKCFG['EditorAreaCSS'];
$oFCKeditor->Config['BaseHref'] = $smarty->get_config_vars('http') . 'sites/' . $smarty->FCKCFG['ID_SITE'] . '/';
return $oFCKeditor->CreateHtml();
}
示例15: smarty_function_wysiwyg
function smarty_function_wysiwyg($params, $smarty)
{
$name = '';
$value = '';
if (isset($params['name'])) {
$name = $params['name'];
}
if (isset($params['value'])) {
$value = $params['value'];
}
$fckeditor = new FCKeditor($name);
$fckeditor->BasePath = '/js/fckeditor/';
$fckeditor->ToolbarSet = 'phpweb20';
$fckeditor->Value = $value;
return $fckeditor->CreateHtml();
}