change default-param of htmlarea, to be used if no or empty style is given

This commit is contained in:
Ralf Becker 2004-02-29 00:12:48 +00:00
parent 1cc9c515aa
commit 1994b1c179

View File

@ -156,23 +156,23 @@
/*! /*!
@function htmlarea @function htmlarea
@syntax htmlarea( $name,$content='',$width=False,$height=False ) @syntax htmlarea( $name,$content='',$style='width:100%; min-width:500px; height:300px;' )
@author ralfbecker @author ralfbecker
@abstract creates a textarea inputfield for the htmlarea js-widget (returns the necessary html and js) @abstract creates a textarea inputfield for the htmlarea js-widget (returns the necessary html and js)
@param $name string name and id of the input-field @param $name string name and id of the input-field
@param $content string of the htmlarea (will be run through htmlspecialchars !!!), default '' @param $content string of the htmlarea (will be run through htmlspecialchars !!!), default ''
@param $style string inline styles, eg. dimension of textarea element @param $style string inline styles, eg. dimension of textarea element
*/ */
function htmlarea($name,$content='',$style='width:100%; min-width:500px; height:300px;') function htmlarea($name,$content='',$style='')
{ {
if (!$style) $style = 'width:100%; min-width:500px; height:300px;';
if (!is_object($GLOBALS['phpgw']->js)) if (!is_object($GLOBALS['phpgw']->js))
{ {
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
} }
if (!strstr($GLOBALS['phpgw_info']['flags']['java_script'],'htmlarea')) if (!strstr($GLOBALS['phpgw_info']['flags']['java_script'],'htmlarea'))
{ {
$GLOBALS['phpgw']->js->validate_file('htmlarea','htmlarea'); $GLOBALS['phpgw']->js->validate_file('htmlarea','htmlarea');
$GLOBALS['phpgw']->js->validate_file('htmlarea','dialog'); $GLOBALS['phpgw']->js->validate_file('htmlarea','dialog');
$lang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; $lang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];