From 7dedec8bdc0c90ff7e865da76c72a17c36e59eb8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 25 Mar 2008 15:46:41 +0000 Subject: [PATCH] removed unnecessary instancations and using static methods of html and egw_link class --- infolog/csv_import.php | 21 ++++++++------------- infolog/inc/class.boinfolog.inc.php | 10 +++------- infolog/inc/class.infolog_tracking.inc.php | 5 ----- infolog/inc/class.soinfolog.inc.php | 4 ---- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/infolog/csv_import.php b/infolog/csv_import.php index ba292e389e..e854769c94 100644 --- a/infolog/csv_import.php +++ b/infolog/csv_import.php @@ -158,11 +158,6 @@ function cat_id($cats) return $id_str; } - if (!is_object($GLOBALS['egw']->html)) - { - $GLOBALS['egw']->html =& CreateObject('phpgwapi.html'); - } - if ($_POST['next']) $_POST['action'] = 'next'; switch ($_POST['action']) { @@ -171,7 +166,7 @@ function cat_id($cats) $GLOBALS['egw']->template->set_var('lang_fieldsep',lang('Fieldseparator')); $GLOBALS['egw']->template->set_var('lang_charset',lang('Charset of file')); $GLOBALS['egw']->template->set_var('select_charset', - $GLOBALS['egw']->html->select('charset','', + html::select('charset','', $GLOBALS['egw']->translation->get_installed_charsets()+ array('utf-8' => 'utf-8 (Unicode)'),True)); $GLOBALS['egw']->template->set_var('fieldsep',$_POST['fieldsep'] ? $_POST['fieldsep'] : ';'); @@ -193,8 +188,8 @@ function cat_id($cats) $GLOBALS['egw']->template->set_var('lang_info_fieldname',lang('InfoLog-Fieldname')); $GLOBALS['egw']->template->set_var('lang_translation',lang("Translation").' '.lang('help').''); $GLOBALS['egw']->template->set_var('submit', - $GLOBALS['egw']->html->submit_button('convert','Import') . ' '. - $GLOBALS['egw']->html->submit_button('cancel','Cancel')); + html::submit_button('convert','Import') . ' '. + html::submit_button('cancel','Cancel')); $GLOBALS['egw']->template->set_var('lang_debug',lang('Test Import (show importable records only in browser)')); $GLOBALS['egw']->template->parse('rows','fheader'); @@ -291,7 +286,7 @@ function cat_id($cats) $GLOBALS['egw']->template->parse('rows','ffooter',True); fclose($fp); - $hiddenvars = $GLOBALS['egw']->html->input_hidden(array( + $hiddenvars = html::input_hidden(array( 'action' => 'import', 'fieldsep'=> $_POST['fieldsep'], 'charset' => $_POST['charset'] @@ -336,7 +331,7 @@ function cat_id($cats) $_POST['trans'] = unserialize(stripslashes($_POST['trans'])); // fall-through case 'import': - $hiddenvars = $GLOBALS['egw']->html->input_hidden(array( + $hiddenvars = html::input_hidden(array( 'action' => 'continue', 'fieldsep'=> $_POST['fieldsep'], 'charset' => $_POST['charset'], @@ -545,9 +540,9 @@ function cat_id($cats) lang('%1 records read (not yet imported, you may go %2back%3 and uncheck Test Import)', $anz,'','') : lang('%1 records imported',$anz)). ' '. - (!$_POST['debug'] && $fields ? $GLOBALS['egw']->html->submit_button('next','Import next set') . ' ':''). - $GLOBALS['egw']->html->submit_button('continue','Back') . ' '. - $GLOBALS['egw']->html->submit_button('cancel','Cancel')); + (!$_POST['debug'] && $fields ? html::submit_button('next','Import next set') . ' ':''). + html::submit_button('continue','Back') . ' '. + html::submit_button('cancel','Cancel')); $GLOBALS['egw']->template->set_var('log',$log); $GLOBALS['egw']->template->parse('rows','imported'); break; diff --git a/infolog/inc/class.boinfolog.inc.php b/infolog/inc/class.boinfolog.inc.php index 4fb206c124..09e843ad1b 100644 --- a/infolog/inc/class.boinfolog.inc.php +++ b/infolog/inc/class.boinfolog.inc.php @@ -1049,10 +1049,6 @@ class boinfolog { return False; } - if (!is_object($GLOBALS['egw']->html)) - { - $GLOBALS['egw']->html =& CreateObject('phpgwapi.html'); - } $GLOBALS['egw']->translation->add_app('infolog'); $do_events = $args['location'] == 'calendar_include_events'; @@ -1094,10 +1090,10 @@ class boinfolog $this->status[$info['info_type']][$info['info_status']] => 'infolog', ) as $name => $app) { - $content[] = $GLOBALS['egw']->html->image($app,$name,lang($name),'border="0" width="15" height="15"').' '; + $content[] = html::image($app,$name,lang($name),'border="0" width="15" height="15"').' '; } - $content[] = $GLOBALS['egw']->html->a_href($title,$view); - $content = $GLOBALS['egw']->html->table(array(1 => $content)); + $content[] = html::a_href($title,$view); + $content = html::table(array(1 => $content)); $to_include[] = array( 'starttime' => $info['info_startdate'], diff --git a/infolog/inc/class.infolog_tracking.inc.php b/infolog/inc/class.infolog_tracking.inc.php index 205f60c2e6..04bf82d943 100644 --- a/infolog/inc/class.infolog_tracking.inc.php +++ b/infolog/inc/class.infolog_tracking.inc.php @@ -213,11 +213,6 @@ class infolog_tracking extends bo_tracking $responsible[] = $GLOBALS['egw']->common->grab_owner_name($uid); } } - if ($data['info_cat'] && !is_object($GLOBALS['egw']->categories)) - { - require_once(EGW_API_INC.'/class.categories.inc.php'); - $GLOBALS['egw']->categories =& new categories($this->infolog->user,'infolog'); - } if ($GLOBALS['egw_info']['user']['preferences']['infolog']['show_id']) { $id = ' #'.$data['info_id']; diff --git a/infolog/inc/class.soinfolog.inc.php b/infolog/inc/class.soinfolog.inc.php index 8b4b6f7535..b66da54e99 100644 --- a/infolog/inc/class.soinfolog.inc.php +++ b/infolog/inc/class.soinfolog.inc.php @@ -730,10 +730,6 @@ class soinfolog // DB-Layer if ((int)$query['cat_id']) { //$filtermethod .= ' AND info_cat='.intval($query['cat_id']).' '; - if (!is_object($GLOBALS['egw']->categories)) - { - $GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories'); - } $cats = $GLOBALS['egw']->categories->return_all_children((int)$query['cat_id']); $filtermethod .= ' AND info_cat'.(count($cats)>1? ' IN ('.implode(',',$cats).') ' : '='.(int)$query['cat_id']); }