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