diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 7c8746f81a..2c35884d42 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -885,14 +885,7 @@ if (!$styles) $styles = 'width: 100%; min-width: 500px; height: 300px;'; // default HTMLarea style in html-class if (!$readonly) { - if(strpos($plugins,':') === false) - { - $html .= $this->html->htmlarea($form_name,$value,$styles,'',$plugins,'',true); - } - else - { - $html .= $this->html->tinymce($form_name,$value,$styles,$plugins); - } + $html .= $this->html->tinymce($form_name,$value,$styles,$plugins); $GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] = array( 'type' => $cell['type'], diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index dd74ed3683..3a3614b019 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -438,34 +438,7 @@ class html */ function htmlarea($name,$content='',$style='',$base_href='',$plugins='',$custom_toolbar='',$set_width_height_in_config=false) { - $init_options = 'theme : "advanced",theme_advanced_toolbar_location : "top"'; - $tab3a = 'theme_advanced_buttons3_add : "separator,fullscreen'; - $plugs = 'plugins : "paste,fullscreen,advimage,advlink'; - $eve = 'extended_valid_elements : "a[name|href|target|title|onclick], img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]'; - foreach(explode(',',$plugins) as $plugin) - { - switch($plugin) - { - case 'TableOperations' : - $plugs .= ',table'; - $tab3a .= ',tablecontrols'; - break; - case 'ContextMenu' : - $plugs .= ',contextmenu'; - break; - default: - // echo $plugin .'
'; - } - } - - if($base_href='') - { - $init_options .= ',document_base_url : "'. $base_href. '", relative_urls : true'; - } - - $init_options .= ','. $tab3a. '",'. $plugs. '",'. $eve. '"'; - - return $this->tinymce($name,$content,$style,$init_options); + return $this->tinymce($name,$content,$style,$plugins,$base_href); } /** @@ -497,42 +470,76 @@ class html * @param string $content='' of the tinymce (will be run through htmlspecialchars !!!), default '' * @param string $style='' initial css for the style attribute * @param string $init_options='', see http://tinymce.moxiecode.com/ for all init options. mode and elements are allready set. + * to make things more easy, you also can just provide a comma seperated list here with the options you need. + * Supportet are: 'TableOperations','ContextMenu','ColorChooser' * @return string the necessary html for the textarea * @todo make wrapper for backwards compatibility with htmlarea * @todo enable all features from htmlarea */ - function tinymce($name,$content='',$style='',$init_options='') + function tinymce($name,$content='',$style='',$init_options='',$base_href='') { - if (!$style) - { - $style = 'width:100%; min-width:500px; height:300px;'; - } - - /* do stuff once */ - $this->init_tinymce(); - - if (!$this->htmlarea_availible()) - { - return $this->textarea($name,$content,'style="'.$style.'"'); - } - - /* do again and again */ - return ' - - - - '; + }); + + + + '; } /**