Exemplo n.º 1
0
 /**
  * Renders the editor
  * @return	string  the constructed html string for the editor
  */
 function render()
 {
     if ($this->editor) {
         return $this->editor->render();
     } else {
         return parent::render();
     }
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param    string     $caption    Caption
  * @param    string     $name       "name" attribute
  * @param    string     $value      Initial text
  * @param    int        $rows       Number of rows
  * @param    int        $cols       Number of columns
  * @param    string     $hiddentext Identifier for hidden Text
  * @param    array      $options    Extra options
  */
 function __construct($caption, $name, $value = "", $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array())
 {
     static $inLoop = 0;
     $inLoop++;
     // Second loop, invalid, return directly
     if ($inLoop > 2) {
         return;
     }
     // Else, initialize
     parent::__construct($caption, $name, $value, $rows, $cols);
     $this->_hiddenText = $hiddentext;
     if ($inLoop > 1) {
         return;
     }
     if (!isset($options['editor'])) {
         $configs = @(include $GLOBALS['xoops']->path("var/configs/xoopsconfig.php"));
         if (!empty($configs['editor'])) {
             $options['editor'] = $configs['editor'];
         }
     }
     if (!empty($this->htmlEditor) || !empty($options['editor'])) {
         $options['name'] = $this->getName();
         $options['value'] = $this->getValue();
         if (!empty($options['editor'])) {
             $this->htmlEditor = is_array($options['editor']) ? $options['editor'] : array($options['editor']);
         }
         if (count($this->htmlEditor) == 1) {
             xoops_load('XoopsEditorHandler');
             $editor_handler =& XoopsEditorHandler::getInstance();
             $this->htmlEditor = $editor_handler->get($this->htmlEditor[0], $options);
             if ($inLoop > 1) {
                 $this->htmlEditor = null;
             }
         } else {
             list($class, $path) = $this->htmlEditor;
             include_once XOOPS_ROOT_PATH . $path;
             if (class_exists($class)) {
                 $this->htmlEditor = new $class($options);
             }
             if ($inLoop > 1) {
                 $this->htmlEditor = null;
             }
         }
     }
     $inLoop = 0;
 }