removed unnecessary instancations and using static methods of html and egw_link class

This commit is contained in:
Ralf Becker 2008-03-25 16:37:37 +00:00
parent e7c2e0c2d7
commit afe2795f2d
9 changed files with 12 additions and 123 deletions

View File

@ -46,10 +46,6 @@
$order = get_var('order',array('POST'),0);
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('View access log');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();

View File

@ -126,10 +126,6 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['admin']['title'].' - '.
lang('User groups');
@ -237,8 +233,8 @@
'sort' => $sort
);
$p->set_var(array(
'query' => $GLOBALS['egw']->html->htmlspecialchars($GLOBALS['query']),
'query_type' => is_array($query_types) ? $GLOBALS['egw']->html->select('query_type',$_REQUEST['query_type'],$query_types) : '',
'query' => html::htmlspecialchars($GLOBALS['query']),
'query_type' => is_array($query_types) ? html::select('query_type',$_REQUEST['query_type'],$query_types) : '',
//'lang_group' => lang('group'),
//'group' => $uiaccountsel->selection('group_id','admin_uiaccount_listusers_group_id',$_REQUEST['group_id'],'groups',0,False,'','this.form.submit();',lang('all')),
'accounts_url' => $GLOBALS['egw']->link('/index.php',$link_data),
@ -288,13 +284,8 @@
{
if ($GLOBALS['egw']->acl->check('account_access',1,'admin'))
{
$GLOBALS['egw']->redirect($GLOBALS['egw']->link('/admin/index.php'));
$GLOBALS['egw']->redirect_link('/admin/index.php');
}
if (!is_object($GLOBALS['egw']->html))
{
$GLOBALS['egw']->html =& CreateObject('phpgwapi.html');
}
if($param_cd)
{
$cd = $param_cd;
@ -338,10 +329,6 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['admin']['title'].' - '.
lang('User accounts');
@ -383,7 +370,7 @@
'left_next_matchs' => $this->nextmatchs->left('/index.php',$start,$total,$link_data),
'lang_showing' => ($_REQUEST['group_id'] ? $GLOBALS['egw']->common->grab_owner_name($_REQUEST['group_id']).': ' : '').
($GLOBALS['query'] ? lang("Search %1 '%2'",lang($uiaccountsel->query_types[$_REQUEST['query_type']]),
$GLOBALS['egw']->html->htmlspecialchars($GLOBALS['query'])).': ' : '')
html::htmlspecialchars($GLOBALS['query'])).': ' : '')
.$this->nextmatchs->show_hits($total,$start),
'right_next_matchs' => $this->nextmatchs->right('/index.php',$start,$total,$link_data),
'lang_loginid' => $this->nextmatchs->show_sort_order($sort,'account_lid',$order,'/index.php',lang('LoginID'),$link_data),
@ -400,8 +387,8 @@
'sort' => $sort,
);
$p->set_var(array(
'query' => $GLOBALS['egw']->html->htmlspecialchars($GLOBALS['query']),
'query_type' => is_array($uiaccountsel->query_types) ? $GLOBALS['egw']->html->select('query_type',$_REQUEST['query_type'],$uiaccountsel->query_types) : '',
'query' => html::htmlspecialchars($GLOBALS['query']),
'query_type' => is_array($uiaccountsel->query_types) ? html::select('query_type',$_REQUEST['query_type'],$uiaccountsel->query_types) : '',
'lang_group' => lang('group'),
'group' => $uiaccountsel->selection('group_id','admin_uiaccount_listusers_group_id',$_REQUEST['group_id'],'groups',0,False,'','this.form.submit();',lang('all')),
'accounts_url' => $GLOBALS['egw']->link('/index.php',$link_data),
@ -613,10 +600,7 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -695,10 +679,6 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -949,10 +929,6 @@
}
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -1147,10 +1123,6 @@
{
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -1161,10 +1133,6 @@
//fix from Maanus 280105
$accounts =& CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
if (!is_object($GLOBALS['egw']->uiaccountsel))
{
$GLOBALS['egw']->uiaccountsel =& CreateObject('phpgwapi.uiaccountsel');
}
$p->set_var('accounts',$GLOBALS['egw']->uiaccountsel->selection('account_user[]','admin_uiaccounts_user',$group_info['account_user'],'accounts',min(3+count($group_info['account_user']),10),false,'style="width: 300px;"'));
$var = Array(
@ -1199,7 +1167,7 @@
{
$p->set_var(array(
'lang_email' => lang('Email'),
'email' => $GLOBALS['egw']->html->input('account_email',$group_repository['account_email'],'',' style="width: 100%;"'),
'email' => html::input('account_email',$group_repository['account_email'],'',' style="width: 100%;"'),
));
}
reset($GLOBALS['egw_info']['apps']);
@ -1264,10 +1232,6 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -1478,7 +1442,7 @@
{
array_push($selarray,$value['account_id']);
}
$t->set_var('groups_select','<div id="groupselector">' .$GLOBALS['egw']->html->checkbox_multiselect('account_groups[]',$selarray,$allGroupsSorted,true,'',min(3+count($allGroupsSorted),10),' style="width: 300px; text-align:left" ').'</div>');
$t->set_var('groups_select','<div id="groupselector">' .html::checkbox_multiselect('account_groups[]',$selarray,$allGroupsSorted,true,'',min(3+count($allGroupsSorted),10),' style="width: 300px; text-align:left" ').'</div>');
/* create list of available apps */
$apps =& CreateObject('phpgwapi.applications',$_account_id);
@ -1589,10 +1553,6 @@
unset($GLOBALS['egw_info']['flags']['noheader']);
unset($GLOBALS['egw_info']['flags']['nonavbar']);
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
@ -1630,7 +1590,7 @@
{
if($GLOBALS['egw']->acl->check('group_access',16,'admin') || $_POST['cancel'])
{
$GLOBALS['egw']->redirect($GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
$GLOBALS['egw']->redirect_link('/index.php','menuaction=admin.uiaccounts.list_groups');
$GLOBALS['egw']->common->egw_exit();
}
elseif($_POST['submit'])

View File

@ -41,10 +41,6 @@
$can_delete = !$GLOBALS['egw']->acl->check('applications_access',8,'admin');
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Installed applications');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();
@ -220,10 +216,6 @@
}
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Add new application');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();
@ -302,10 +294,6 @@
}
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Edit application');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();
@ -364,10 +352,6 @@
$GLOBALS['egw']->template->set_file(array('body' => 'delete_common.tpl'));
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();
@ -387,10 +371,6 @@
{
$GLOBALS['egw']->redirect_link('/index.php');
}
if (!is_object($GLOBALS['egw']->hooks))
{
$GLOBALS['egw']->hooks =& CreateObject('phpgwapi.hooks');
}
$GLOBALS['egw']->hooks->register_all_hooks();
if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited

View File

@ -27,13 +27,6 @@
var $public_functions = array(
'index' => True,
);
function uiasyncservice()
{
if (!is_object($GLOBALS['egw']->asyncservice))
{
$GLOBALS['egw']->asyncservice =& CreateObject('phpgwapi.asyncservice');
}
}
function index()
{
@ -42,10 +35,7 @@
$GLOBALS['egw']->redirect_link('/index.php');
}
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Asynchronous timed services');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();
@ -211,10 +201,6 @@
function test($to)
{
if (!is_object($GLOBALS['egw']->send))
{
$GLOBALS['egw']->send =& CreateObject('phpgwapi.send');
}
$returncode = $GLOBALS['egw']->send->msg('email',$to,$subject='Asynchronous timed services','Greatings from cron ;-)');
if (!$returncode) // not nice, but better than failing silently

View File

@ -52,10 +52,6 @@
$this->acl_delete = !$GLOBALS['egw']->acl->check('global_categories_access',32,'admin');
$this->acl_add_sub= !$GLOBALS['egw']->acl->check('global_categories_access',64,'admin');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$this->appname = get_var('appname',array('GET','POST'));
@ -418,11 +414,7 @@
$this->template->set_var('cat_description',$GLOBALS['egw']->strip_html($cat['description']));
$this->template->set_var('category_list',$this->bo->cats->formatted_list(array('selected' => $cat['parent'],'self' => $this->cat_id)));
if (!is_object($GLOBALS['egw']->html))
{
$GLOBALS['egw']->html =& CreateObject('phpgwapi.html');
}
$this->template->set_var('color',$GLOBALS['egw']->html->inputColor('cat_data[color]',$cat['data']['color'],lang('Click to select a color')));
$this->template->set_var('color',html::inputColor('cat_data[color]',$cat['data']['color'],lang('Click to select a color')));
//$options = '<option value=""'.(!$cat['data']['icon'] ? ' selected="1"':'').'>'.lang('none')."</options>\n";
@ -517,10 +509,6 @@
));
$GLOBALS['egw_info']['flags']['app_header'] .= ' - '.lang('Delete category');
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();

View File

@ -145,10 +145,6 @@
$t->set_var('th_err',$GLOBALS['egw_info']['theme']['th_bg']);
}
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
// set currentapp to our calling app, to show the right sidebox-menu

View File

@ -34,10 +34,6 @@
function header()
{
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();

View File

@ -261,10 +261,6 @@
$this->t->set_var('event_list',$table);
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.($this->editmode?lang('Edit Table format') : lang('View error log'));
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
$GLOBALS['egw']->js->validate_file('jscode','openwindow','admin');
$GLOBALS['egw']->common->egw_header();
echo parse_navbar();

View File

@ -15,11 +15,6 @@
{
var $public_functions = array('index' => True);
function uimainscreen()
{
$GLOBALS['egw']->nextmatchs =& CreateObject('phpgwapi.nextmatchs');
}
function index()
{
@ -71,10 +66,6 @@
$GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.lang('Main screen message');
break;
}
if(!@is_object($GLOBALS['egw']->js))
{
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
}
if (empty($section))
{