/** * Constructor * @param object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { global $icmsConfig; parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e')); $control = $object->getControl($key); $editor_handler = icms_plugins_EditorHandler::getInstance('source'); $this->_editor =& $editor_handler->get($icmsConfig['sourceeditor_default'], array('name' => $key, 'value' => $object->getVar($key, 'e'), 'language' => isset($control['language']) ? $control['language'] : _LANGCODE, 'width' => isset($control['width']) ? $control['width'] : '100%', 'height' => isset($control['height']) ? $control['height'] : '400px', 'syntax' => isset($control['syntax']) ? $control['syntax'] : 'php')); }
/** * Constructor * * @param object $form the form calling the editor selection * @param string $name editor name * @param string $value Pre-selected text value * @param bool $noHtml dohtml disabled */ public function __construct(&$form, $name = "editor", $value = NULL, $noHtml = FALSE) { global $icmsConfig; if (empty($value)) { $value = $icmsConfig['editor_default']; } parent::__construct(_SELECT); $edtlist = icms_plugins_EditorHandler::getListByType(); $option_select = new icms_form_elements_Select("", $name, $value); $querys = preg_replace('/editor=(.*?)&/', '', $_SERVER['QUERY_STRING']); $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){ window.location = \'?editor=\'+this.options[this.selectedIndex].value+\'&' . $querys . '\'; }"'; $option_select->setExtra($extra); $option_select->addOptionArray($edtlist); $this->addElement($option_select); }
* @subpackage Template Sets * @version SVN: $Id: tplform.php 20852 2011-02-18 05:19:56Z skenow $ */ if ($tform['tpl_tplset'] != 'default') { $form = new icms_form_Theme(_MD_EDITTEMPLATE, 'template_form', 'admin.php', 'post', TRUE); } else { $form = new icms_form_Theme(_MD_VIEWTEMPLATE, 'template_form', 'admin.php', 'post', TRUE); } $form->addElement(new icms_form_elements_Label(_MD_FILENAME, $tform['tpl_file'])); $form->addElement(new icms_form_elements_Label(_MD_FILEDESC, $tform['tpl_desc'])); $form->addElement(new icms_form_elements_Label(_MD_LASTMOD, formatTimestamp($tform['tpl_lastmodified'], 'l'))); $config = array('name' => 'html', 'value' => $tform['tpl_source'], 'language' => _LANGCODE, 'width' => '100%', 'height' => '400px', 'syntax' => 'html'); if ($tform['tpl_tplset'] == 'default') { $config["is_editable"] = FALSE; } $tpl_src = icms_plugins_EditorHandler::getInstance('source')->get($icmsConfig['sourceeditor_default'], $config); $tpl_src->setCaption(_MD_FILEHTML); $form->addElement($tpl_src); $form->addElement(new icms_form_elements_Hidden('id', $tform['tpl_id'])); $form->addElement(new icms_form_elements_Hidden('op', 'edittpl_go')); $form->addElement(new icms_form_elements_Hidden('redirect', 'edittpl')); $form->addElement(new icms_form_elements_Hidden('fct', 'tplsets')); $form->addElement(new icms_form_elements_Hidden('moddir', $tform['tpl_module'])); if ($tform['tpl_tplset'] != 'default') { $button_tray = new icms_form_elements_Tray(''); $button_tray->addElement(new icms_form_elements_Button('', 'previewtpl', _PREVIEW, 'submit')); $button_tray->addElement(new icms_form_elements_Button('', 'submittpl', _SUBMIT, 'submit')); $form->addElement($button_tray); } else { $form->addElement(new icms_form_elements_Button('', 'previewtpl', _MD_VIEW, 'submit')); }
/** * Gets list of editors folders inside editors directory * @deprecated Use icms_core_Filesystem::getDirList or icms_plugins_EditorHandler::getList * @todo Remove in 1.4 * * @param string $type type of editor * @return array $editor_list list of files in the directory */ public static function getEditorsList($type = '') { icms_core_Debug::setDeprecated('icms_plugins_EditorHandler::getListByType', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); return icms_plugins_EditorHandler::getListByType($type); }
case 'editor_source' : $type = explode('_', $config[$i]->getVar('conf_formtype')); $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $type = array_pop($type); if ($type == 'editor') $type = ''; $dirlist = icms_plugins_EditorHandler::getListByType($type); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } unset($type); break; case 'editor_multi' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, TRUE); $dirlist = icms_plugins_EditorHandler::getListByType(); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } break; case 'select_font' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $dirlist = icms_core_Filesystem::getFileList(ICMS_LIBRARIES_PATH . '/icms/form/elements/captcha/fonts/', '', array('ttf')); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } break;
public function __construct($type = '') { parent::__construct($type); $this->_deprecated = icms_core_Debug::setDeprecated('icms_plugins_EditorHandler', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); }
/** * Constructor * * @param string $caption Caption * @param string $name "name" attribute * @param string $value Initial text * @param array $configs configures * @param bool $noHtml use non-WYSIWYG eitor onfailure * @param string $OnFailure editor to be used if current one failed */ function icms_form_elements_Editor($caption, $name, $editor_configs = null, $noHtml = false, $OnFailure = "") { parent::__construct($caption, $editor_configs["name"]); $editor_handler = icms_plugins_EditorHandler::getInstance(); $this->editor =& $editor_handler->get($name, $editor_configs, $noHtml, $OnFailure); }