public function formRichtextarea($name, $value = null, $attribs = null, $options = null, $listSep = null)
 {
     $info = $this->_getInfo($name, $value, $attribs);
     extract($info);
     // name, value, attribs, options, listsep, disable
     $fck = new FCKEditor($this->view->escape($name));
     $fck->BasePath = $this->view->base . '/fckeditor/';
     $fck->Value = $value;
     if (isset($attribs['width'])) {
         $fck->Width = $attribs['width'];
     } else {
         $fck->Width = '890';
     }
     $fck->Height = '600';
     $fck->Config['CustomConfigurationsPath'] = '../../javascript/fck_custom_config.js';
     $fck->ToolbarSet = 'MonkeysToolbar';
     return $fck->CreateHtml();
 }
 public function __construct($name)
 {
     $this->HtmlMame = $name;
     $name = str_replace(array("[", "]"), array("_", ""), $name);
     parent::__construct($name);
     $this->BasePath = fvSite::$fvConfig->get("editor.basepath");
     $this->Config["CustomConfigurationsPath"] = fvSite::$fvConfig->get("editor.config");
     $this->ToolbarSet = fvSite::$fvConfig->get("editor.toolbar");
     $this->Class = fvSite::$fvConfig->get("editor.className");
     $this->Style = fvSite::$fvConfig->get("editor.style");
     $this->Width = "95%";
 }
示例#3
0
 function render($blockContent = NULL)
 {
     $editor = new FCKEditor($this->name());
     $editor->Width = $this->width;
     $editor->Height = $this->height;
     $editor->BasePath = WWW_ROOT . '/www/framework/FCKEditor/';
     $editor->Value = $this->value();
     $editor->ToolbarSet = $this->ToolbarSet;
     if ($this->CustomConfigurationsPath) {
         $editor->Config['CustomConfigurationsPath'] = $this->CustomConfigurationsPath;
     }
     return $editor->CreateHtml();
 }
示例#4
0
    /**
     * Returns the textarea element in HTML
     * 
     * @since     1.0
     * @access    public
     * @return    string
     */
    function toHtml()
    {
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            switch (strtolower($this->editorName)) {
                case 'nicedit':
                    ob_start();
                    if (!defined('HTML_QuickForm_htmlarea_nicEdit_loaded')) {
                        define('HTML_QuickForm_htmlarea_nicEdit_loaded', 1);
                        echo '<script language="javascript" type="text/javascript" src="' . DATAFACE_URL . '/js/nicEdit/nicEdit.js"></script>';
                    }
                    echo '<script language="javascript">
        			//<![CDATA[
        			bkLib.onDomLoaded(function(){
        				new nicEditor({fullPanel: true, iconsPath: \'' . DATAFACE_URL . '/js/nicEdit/nicEditorIcons.gif\'}).panelInstance(\'' . $this->getAttribute('id') . '\');
        			});
        			//]]></script>';
                    $html = ob_get_contents();
                    ob_end_clean();
                    return $html . "\n" . parent::toHtml();
                case 'fckeditor':
                    require_once 'FCKeditor/fckeditor.php';
                    $editor = new FCKEditor($this->getName());
                    $editor->BasePath = $GLOBALS['HTML_QuickForm_htmlarea']['FCKeditor_BasePath'];
                    $editor->Value = $this->_value;
                    $editor->Width = '100%';
                    $editor->Height = '480';
                    ob_start();
                    $editor->Create();
                    $html = ob_get_contents();
                    ob_end_clean();
                    return $html;
                case 'tinymce':
                    ob_start();
                    if (!defined('HTML_QuickForm_htmlarea_TinyMCE_loaded')) {
                        define('HTML_QuickForm_htmlarea_TinyMCE_loaded', true);
                        echo '<script language="javascript" type="text/javascript" src="' . $GLOBALS['HTML_QuickForm_htmlarea']['TinyMCE_BasePath'] . '/tiny_mce.js"></script>';
                    }
                    echo '
					
					<script language="javascript" type="text/javascript">
					tinyMCE.init({
						editor_selector : "mceEditor",
						mode : "exact",
						elements : "' . $this->getAttribute('id') . '"';
                    foreach ($this->wysiwygOptions as $key => $value) {
                        echo ',
						' . $key . ' : "' . $value . '"';
                    }
                    echo '
					});
					
					</script>
					';
                    $out = ob_get_contents();
                    ob_end_clean();
                    // now we can just call textarea's tohtml method.
                    return $out . parent::toHtml();
            }
        }
    }