formatting, ereg_ replaced, remove rude comments

This commit is contained in:
Miles Lott 2003-12-20 18:41:42 +00:00
parent 6f2f6d23dc
commit 0e9e0c2da2

View File

@ -5,7 +5,7 @@
* and Joseph Engo <jengo@phpgroupware.org> *
* and Mark Peters <skeeter@phpgroupware.org> *
* and Lars Kneschke <lkneschke@linux-at-work.de> *
* Commononly used functions by phpGroupWare developers *
* Functions commonly used by phpGroupWare developers *
* Copyright (C) 2000, 2001 Dan Kuykendall *
* Copyright (C) 2003 Lars Kneschke *
* -------------------------------------------------------------------------*
@ -157,11 +157,11 @@
$owner = $GLOBALS['phpgw_info']['user']['account_id'];
}
$groups = $GLOBALS['phpgw']->accounts->membership((int)$owner);
if (gettype($groups) == 'array')
if(@is_array($groups))
{
while ($group = each($groups))
{
$s .= " or $table like '%," . $group[2] . ",%'";
$s .= " OR $table LIKE '%," . $group[2] . ",%'";
}
}
return $s;
@ -175,7 +175,7 @@
*/
function getInstalledLanguages()
{
$GLOBALS['phpgw']->db->query('select distinct lang from phpgw_lang');
$GLOBALS['phpgw']->db->query('SELECT DISTINCT lang FROM phpgw_lang');
while (@$GLOBALS['phpgw']->db->next_record())
{
$installedLanguages[$GLOBALS['phpgw']->db->f('lang')] = $GLOBALS['phpgw']->db->f('lang');
@ -1163,19 +1163,19 @@
$tpl->set_file('css', 'css.tpl');
$tpl->set_var($GLOBALS['phpgw_info']['theme']);
$app_css = '';
if(@isset($_GET['menuaction']))
{
list($app,$class,$method) = explode('.',$_GET['menuaction']);
if(is_array($GLOBALS[$class]->public_functions)
&& $GLOBALS[$class]->public_functions['css'])
{
$app_css .= $GLOBALS[$class]->css();
}
}
if (isset($GLOBALS['phpgw_info']['flags']['css']))
{
$app_css .= $GLOBALS['phpgw_info']['flags']['css'];
}
if(@isset($_GET['menuaction']))
{
list($app,$class,$method) = explode('.',$_GET['menuaction']);
if(is_array($GLOBALS[$class]->public_functions) &&
$GLOBALS[$class]->public_functions['css'])
{
$app_css .= $GLOBALS[$class]->css();
}
}
if (isset($GLOBALS['phpgw_info']['flags']['css']))
{
$app_css .= $GLOBALS['phpgw_info']['flags']['css'];
}
$tpl->set_var('app_css', $app_css);
// search for app specific css file
@ -1183,17 +1183,19 @@
{
$appname = $GLOBALS['phpgw_info']['flags']['currentapp'];
if(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP .
'templates' . SEP . $GLOBALS['phpgw_info']['server']['template_set'] .
SEP . 'app.css'))
if(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP
. 'templates' . SEP . $GLOBALS['phpgw_info']['server']['template_set']
. SEP . 'app.css')
)
{
$tpl->set_var('css_file', '<LINK href="'.$GLOBALS['phpgw_info']['server']['webserver_url']
."/$appname/templates/".$GLOBALS['phpgw_info']['server']['template_set']
."/app.css".'" type=text/css rel=StyleSheet>');
. "/$appname/templates/".$GLOBALS['phpgw_info']['server']['template_set']
. "/app.css".'" type=text/css rel=StyleSheet>');
}
elseif(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP .
'templates' . SEP . 'default' .
SEP . 'app.css'))
elseif(file_exists(PHPGW_SERVER_ROOT . SEP . $appname . SEP
. 'templates' . SEP . 'default'
. SEP . 'app.css')
)
{
$tpl->set_var('css_file', '<LINK href="'.$GLOBALS['phpgw_info']['server']['webserver_url']
."/$appname/templates/default/app.css".'" type=text/css rel=StyleSheet>');
@ -1202,6 +1204,7 @@
return $tpl->subst('css');
}
/**
* Used by the template headers for including javascript in the header
*
@ -1220,20 +1223,19 @@
$java_script .= $GLOBALS['phpgw']->js->get_script_links();
}
if(@isset($_GET['menuaction']))
{
list($app,$class,$method) = explode('.',$_GET['menuaction']);
if(is_array($GLOBALS[$class]->public_functions)
&& $GLOBALS[$class]->public_functions['java_script'])
{
$java_script .= $GLOBALS[$class]->java_script();
}
}
//you never know - best to protect the stupid ;)
if (isset($GLOBALS['phpgw_info']['flags']['java_script']))
{
$java_script .= $GLOBALS['phpgw_info']['flags']['java_script'] . "\n";
}
if(@isset($_GET['menuaction']))
{
list($app,$class,$method) = explode('.',$_GET['menuaction']);
if(is_array($GLOBALS[$class]->public_functions) &&
$GLOBALS[$class]->public_functions['java_script'])
{
$java_script .= $GLOBALS[$class]->java_script();
}
}
if (isset($GLOBALS['phpgw_info']['flags']['java_script']))
{
$java_script .= $GLOBALS['phpgw_info']['flags']['java_script'] . "\n";
}
return $java_script;
}
@ -1255,7 +1257,6 @@
}
}
function hex2bin($data)
{
$len = strlen($data);
@ -1972,4 +1973,3 @@
return (int)$id;
}
}//end common class