/** * Renders the editor * @return string the constructed html string for the editor */ public function render() { if ($this->_editor) { return $this->_editor->render(); } else { return parent::render(); } }
$method = "set" . ucfirst($key); $this->{$method}($val); } else { $this->config[$key] = $val; } } } if ($checkCompatible && !$this->isCompatible()) { return false; } parent::__construct("", $this->getName(), $this->getValue()); parent::setExtra("style='width:" . $this->_width . ";height:" . $this->_height . ";'"); } /** * Check if compatible * * @return */ function isCompatible() { return is_readable(ICMS_ROOT_PATH . $this->rootpath . "/codemirror.php"); } function render() { $ret = parent::render(); // take xml for html rendering if ($this->config['syntax'] == 'html') { $this->config['syntax'] = 'xml'; } $css = array(); $js = array(); $this->config['syntax'] = !isset($this->config['syntax']) ? 'php' : $this->config['syntax']; switch ($this->config['syntax']) { case 'php': $js[] = '"../contrib/' . $this->config['syntax'] . '/js/tokenizephp.js"'; case 'lua': case 'python': $css[] = '"' . ICMS_URL . $this->rootpath . '/editor/contrib/' . $this->config['syntax'] . '/css/' . $this->config['syntax'] . 'colors.css"'; $js[] = '"../contrib/' . $this->config['syntax'] . '/js/parse' . $this->config['syntax'] . '.js"'; break; case 'xml': case 'css': case 'javascript': case 'js': case 'sparql': if ($this->config['syntax'] == 'javascript') { $this->config['syntax'] = 'js'; } $js[] = '"parse' . $this->config['syntax'] . '.js"'; $css[] = '"' . ICMS_URL . $this->rootpath . '/editor/css/' . $this->config['syntax'] . 'colors.css"'; break; case 'mixed': $js[] = '"parsexml.js"';
public function render() { $ret = parent::render(); $ret .= ' <script language="javascript" type="text/javascript" src="' . ICMS_URL . $this->rootpath . '/editor/edit_area_compressor.php?plugins"></script> <script language="javascript" type="text/javascript"> editAreaLoader.init({ id: "' . $this->getName() . '_tarea", syntax: "' . (!isset($this->config['syntax']) ? 'php' : $this->config['syntax']) . '", language: "' . (!isset($this->config['language']) ? 'en' : $this->config['language']) . '", start_highlight: ' . (!isset($this->config['start_highlight']) ? 'true' : ($this->config['start_highlight'] ? 'true' : 'false')) . ', allow_resize: ' . (!isset($this->config['allow_resize']) ? 'false' : ($this->config['allow_resize'] ? 'true' : 'false')) . ', allow_toggle: ' . (!isset($this->config['allow_toggle']) ? 'false' : ($this->config['allow_toggle'] ? 'true' : 'false')) . ', fullscreen: ' . (!isset($this->config['fullscreen']) ? 'false' : ($this->config['fullscreen'] ? 'true' : 'false')) . ', is_editable: ' . (!isset($this->config['is_editable']) ? 'true' : ($this->config['is_editable'] ? 'true' : 'false')) . ', autocompletion: ' . (!isset($this->config['autocompletion']) ? 'true' : ($this->config['autocompletion'] ? 'true' : 'false')) . ' }); </script>'; return $ret; }
public function render() { global $xoTheme; $ret = parent::render(); $xoTheme->addScript(ICMS_URL . $this->rootpath . '/editor/edit_area_full_with_plugins.js', array('type' => 'text/javascript'),''); // @todo this still has to be added like this - until someone figures it out $ret .= ' <script language="javascript" type="text/javascript" src="' . ICMS_URL . $this->rootpath . '/editor/edit_area_full_with_plugins.js"></script> <script language="javascript" type="text/javascript"> editAreaLoader.init({ id: "' . $this->getName() . '_tarea", syntax: "' . (!isset($this->config['syntax']) ? 'php' : $this->config['syntax']) . '", language: "' . (!isset($this->config['language']) ? 'en' : $this->config['language']) . '", start_highlight: ' . (!isset($this->config['start_highlight']) ? 'true' : ($this->config['start_highlight'] ? 'true' : 'false')) . ', allow_resize: ' . (!isset($this->config['allow_resize']) ? 'false' : ($this->config['allow_resize'] ? 'true' : 'false')) . ', allow_toggle: ' . (!isset($this->config['allow_toggle']) ? 'false' : ($this->config['allow_toggle'] ? 'true' : 'false')) . ', fullscreen: ' . (!isset($this->config['fullscreen']) ? 'false' : ($this->config['fullscreen'] ? 'true' : 'false')) . ', is_editable: ' . (!isset($this->config['is_editable']) ? 'true' : ($this->config['is_editable'] ? 'true' : 'false')) . ', autocompletion: ' . (!isset($this->config['autocompletion']) ? 'true' : ($this->config['autocompletion'] ? 'true' : 'false')) . ' }); </script>'; return $ret; }
/** * prepare HTML for output * @return string $ret HTML */ function render() { $ret = $this->tinymce->render(); $ret .= parent::render(); $ret .= '<a href="#" id="switchtinymce" title="' . _TOGGLETINY . '" onclick="showMCE(\'' . $this->_name . '_tarea\'); return false;" style="float:' . _GLOBAL_RIGHT . '; display:box; background:#F0F0EE; padding:3px; margin-right:2px; border: 1px solid #ccc; border-top: none;">' . _TOGGLETINY . '</a>'; $ret .= '<br clear="' . _GLOBAL_RIGHT . '" />'; return $ret; }