reformatting acording to our standards - someone totaly screed it ;-)

This commit is contained in:
Ralf Becker 2004-11-19 06:32:10 +00:00
parent ab5be9691a
commit fa70cfed73

View File

@ -1,19 +1,19 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* eGroupWare - HTML creation class * * eGroupWare - HTML creation class *
* http://www.eGroupWare.org * * http://www.eGroupWare.org *
* Written and (c) by Ralf Becker <RalfBecker@outdoor-training.de> * * Written and (c) by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the * * under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your * * Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. * * option) any later version. *
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
class html class html
{ {
var $user_agent,$ua_version; // 'mozilla','msie','konqueror' var $user_agent,$ua_version; // 'mozilla','msie','konqueror'
var $prefered_img_title; var $prefered_img_title;
var $charset,$phpgwapi_js_url; var $charset,$phpgwapi_js_url;
@ -135,20 +135,19 @@
return $str; return $str;
} }
/*! /**
@function select * allows to show and select one item from an array
@abstract allows to show and select one item from an array *
@param $name string with name of the submitted var which holds the key of the selected item form array * @param string $name string with name of the submitted var which holds the key of the selected item form array
@param $key key(s) of already selected item(s) from $arr, eg. '1' or '1,2' or array with keys * @param string/array $key key(s) of already selected item(s) from $arr, eg. '1' or '1,2' or array with keys
@param $arr array with items to select, eg. $arr = array ( 'y' => 'yes','n' => 'no','m' => 'maybe'); * @param array $arr array with items to select, eg. $arr = array ( 'y' => 'yes','n' => 'no','m' => 'maybe');
@param $no_lang if !$no_lang send items through lang() * @param boolean $no_lang if !$no_lang send items through lang()
@param $options additional options (e.g. 'width') * @param string $options additional options (e.g. 'width')
@param $multiple number of lines for a multiselect, default 0 = no multiselect * @param int $multiple number of lines for a multiselect, default 0 = no multiselect
@returns string to set for a template or to echo into html page * @return string to set for a template or to echo into html page
*/ */
function select($name, $key, $arr=0,$no_lang=0,$options='',$multiple=0) function select($name, $key, $arr=0,$no_lang=0,$options='',$multiple=0)
{ {
// should be in class common.sbox
if (!is_array($arr)) if (!is_array($arr))
{ {
$arr = array('no','yes'); $arr = array('no','yes');
@ -216,10 +215,8 @@
return "<textarea name=\"$name\" $options>".$this->htmlspecialchars($value)."</textarea>\n"; return "<textarea name=\"$name\" $options>".$this->htmlspecialchars($value)."</textarea>\n";
} }
/*! /**
@function htmlarea_avalible * Checks if HTMLarea (or an other richtext editor) is availible for the used browser
@author ralfbecker
@abstract Checks if HTMLarea (or an other richtext editor) is availible for the used browser
*/ */
function htmlarea_availible() function htmlarea_availible()
{ {
@ -297,11 +294,11 @@
$GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= $GLOBALS['phpgw_info']['flags']['java_script_thirst'] .=
'<style type="text/css">@import url(' . $this->phpgwapi_js_url . '/htmlarea/htmlarea.css);</style> '<style type="text/css">@import url(' . $this->phpgwapi_js_url . '/htmlarea/htmlarea.css);</style>
<script type="text/javascript"> <script type="text/javascript">
_editor_url = "'."$this->phpgwapi_js_url/htmlarea/".'"; _editor_url = "'."$this->phpgwapi_js_url/htmlarea/".'";
// var htmlareaConfig = new HTMLArea.Config(); // var htmlareaConfig = new HTMLArea.Config();
// htmlareaConfig.editorURL = '."'$this->phpgwapi_js_url/htmlarea/'; // htmlareaConfig.editorURL = '."'$this->phpgwapi_js_url/htmlarea/';
</script>\n"; </script>\n";
// set a base href to get relative image-pathes working // set a base href to get relative image-pathes working
if ($base_href && $this->user_agent != 'msie') // HTMLarea does not work in IE with base href set !!! if ($base_href && $this->user_agent != 'msie') // HTMLarea does not work in IE with base href set !!!
@ -336,7 +333,6 @@
} }
} }
} }
} }
/* do stuff for every htmlarea in the page */ /* do stuff for every htmlarea in the page */
@ -347,7 +343,7 @@
{ {
//$load_plugin_string .= 'HTMLArea.loadPlugin("'.$plg_name.'");'."\n"; //$load_plugin_string .= 'HTMLArea.loadPlugin("'.$plg_name.'");'."\n";
$register_plugin_string .= 'ret_editor = editor.registerPlugin("'.$plg_name.'");'."\n"; $register_plugin_string .= 'ret_editor = editor.registerPlugin("'.$plg_name.'");'."\n";
// $register_plugin_string .= 'editor.registerPlugin("'.$plg_name.'");'."\n"; // $register_plugin_string .= 'editor.registerPlugin("'.$plg_name.'");'."\n";
} }
} }
@ -355,9 +351,9 @@
$GLOBALS['phpgw_info']['flags']['java_script'] .= $GLOBALS['phpgw_info']['flags']['java_script'] .=
'<script type="text/javascript"> '<script type="text/javascript">
// Replacement for the replace-helperfunction to make it possible to include plugins. // Replacement for the replace-helperfunction to make it possible to include plugins.
HTMLArea.replace_'.$id.' = function(id, config) HTMLArea.replace_'.$id.' = function(id, config)
{ {
var ta = HTMLArea.getElementById("textarea", id); var ta = HTMLArea.getElementById("textarea", id);
if(ta) if(ta)
@ -371,15 +367,15 @@
{ {
return null; return null;
} }
}; };
'.$load_plugin_string.' '.$load_plugin_string.'
var htmlareaConfig_'.$id.' = new HTMLArea.Config(); var htmlareaConfig_'.$id.' = new HTMLArea.Config();
'.$custom_toolbar.' '.$custom_toolbar.'
htmlareaConfig_'.$id.'.editorURL = '."'$this->phpgwapi_js_url/htmlarea/';"; htmlareaConfig_'.$id.'.editorURL = '."'$this->phpgwapi_js_url/htmlarea/';";
$GLOBALS['phpgw_info']['flags']['java_script'] .="</script>\n"; $GLOBALS['phpgw_info']['flags']['java_script'] .="</script>\n";
@ -628,9 +624,10 @@
return '<i>'.$content.'</i>'; return '<i>'.$content.'</i>';
} }
function hr($width,$options='') function hr($width=0,$options='')
{ {
if ($width) $options .= " width=\"$width\""; if ($width) $options .= " width=\"$width\"";
return "<hr $options />\n"; return "<hr $options />\n";
} }
@ -694,4 +691,4 @@
} }
return "<label$id$accesskey $options>$content</label>"; return "<label$id$accesskey $options>$content</label>";
} }
} }