diff --git a/etemplate/inc/class.ajax_select_widget.inc.php b/etemplate/inc/class.ajax_select_widget.inc.php index 95f00c2431..ccb5ff2c29 100644 --- a/etemplate/inc/class.ajax_select_widget.inc.php +++ b/etemplate/inc/class.ajax_select_widget.inc.php @@ -177,9 +177,6 @@ $GLOBALS['egw_info']['flags']['include_xajax'] = True; // JavaScript - if(!is_object($GLOBALS['egw']->js)) { - $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); - } $options = $GLOBALS['egw']->js->convert_phparray_jsarray("options['$name']", $options, true); $GLOBALS['egw']->js->set_onload("if(!options) { var options = new Object(); diff --git a/etemplate/inc/class.bo_tracking.inc.php b/etemplate/inc/class.bo_tracking.inc.php index c0b0df26f6..77322a69d2 100644 --- a/etemplate/inc/class.bo_tracking.inc.php +++ b/etemplate/inc/class.bo_tracking.inc.php @@ -452,12 +452,7 @@ class bo_tracking */ function get_title($data,$old) { - if (!is_object($GLOBALS['egw']->link)) - { - require_once(EGW_API_INC.'/class.bolink.inc.php'); - $GLOBALS['egw']->link =& new bolink(); - } - return $GLOBALS['egw']->link->title($this->app,$data[$this->id_field]); + return egw_link::title($this->app,$data[$this->id_field]); } /** @@ -471,12 +466,7 @@ class bo_tracking */ function get_subject($data,$old) { - if (!is_object($GLOBALS['egw']->link)) - { - require_once(EGW_API_INC.'/class.bolink.inc.php'); - $GLOBALS['egw']->link =& new bolink(); - } - return $GLOBALS['egw']->link->title($this->app,$data[$this->id_field]); + return egw_link::title($this->app,$data[$this->id_field]); } /** @@ -514,15 +504,10 @@ class bo_tracking } else { - if (!is_object($GLOBALS['egw']->link)) - { - require_once(EGW_API_INC.'/class.bolink.inc.php'); - $GLOBALS['egw']->link =& new bolink(); - } - if (($view = $GLOBALS['egw']->link->view($this->app,$data[$this->id_field]))) + if (($view = egw_link::view($this->app,$data[$this->id_field]))) { $link = $GLOBALS['egw']->link('/index.php',$view); - $popup = $GLOBALS['egw']->link->is_popup($this->app,'view'); + $popup = egw_link::is_popup($this->app,'view'); } } if ($link{0} == '/') @@ -553,10 +538,10 @@ class bo_tracking { $GLOBALS['egw']->link = new bolink(); } - if($view = $GLOBALS['egw']->link->view($this->app,$data[$this->id_field])) { + if($view = egw_link::view($this->app,$data[$this->id_field])) { return array( 'text' => $this->get_title($data,$old), 'view' => $view, - 'popup' => $GLOBALS['egw']->link->is_popup($this->app,'view'), + 'popup' => egw_link::is_popup($this->app,'view'), ); } return false; diff --git a/etemplate/inc/class.contact_widget.inc.php b/etemplate/inc/class.contact_widget.inc.php index 2e28b7edb9..84370f80c7 100644 --- a/etemplate/inc/class.contact_widget.inc.php +++ b/etemplate/inc/class.contact_widget.inc.php @@ -57,10 +57,7 @@ class contact_widget function contact_widget($ui) { $this->ui = $ui; - if (!is_object($GLOBALS['egw']->contacts)) - { - $GLOBALS['egw']->contacts =& CreateObject('phpgwapi.contacts'); - } + $this->contacts =& $GLOBALS['egw']->contacts; } diff --git a/etemplate/inc/class.date_widget.inc.php b/etemplate/inc/class.date_widget.inc.php index 34f4101ed8..94809a9606 100644 --- a/etemplate/inc/class.date_widget.inc.php +++ b/etemplate/inc/class.date_widget.inc.php @@ -64,10 +64,6 @@ { if ($ui == 'html') { - if (!is_object($GLOBALS['egw']->jscalendar)) - { - $GLOBALS['egw']->jscalendar =& CreateObject('phpgwapi.jscalendar'); - } $this->jscal =& $GLOBALS['egw']->jscalendar; } $this->timeformat = $GLOBALS['egw_info']['user']['preferences']['common']['timeformat']; diff --git a/etemplate/inc/class.historylog_widget.inc.php b/etemplate/inc/class.historylog_widget.inc.php index 536e172d8a..af02c9d226 100644 --- a/etemplate/inc/class.historylog_widget.inc.php +++ b/etemplate/inc/class.historylog_widget.inc.php @@ -68,10 +68,6 @@ class historylog_widget } else // compatibilty code for 1.2, can be removed after { - if (!is_object($GLOBALS['egw']->datetime)) - { - $GLOBALS['egw']->datetime =& CreateObject('phpgwapi.datetime'); - } $value = $historylog->return_array('','','history_id','DESC',$id); foreach($value as $key => $val) { diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 9f63183252..73cebf8259 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -972,10 +972,6 @@ case 'select-cat': if ($val) { - if (!is_object($GLOBALS['egw']->categories)) - { - $GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories'); - } $value[$key] = $GLOBALS['egw']->categories->id2name($val); } break; diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 6c49cd37d3..3671948869 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -137,10 +137,6 @@ break; case 'select-country': // #Row|Extralabel,1=use country name, 0=use 2 letter-code - if (!is_object($GLOBALS['egw']->country)) - { - $GLOBALS['egw']->country =& CreateObject('phpgwapi.country'); - } $cell['sel_options'] = $GLOBALS['egw']->country->countries(); if (($extension_data['country_use_name'] = $type) && $value) @@ -155,19 +151,11 @@ break; case 'select-state': - if (!is_object($GLOBALS['egw']->country)) - { - $GLOBALS['egw']->country =& CreateObject('phpgwapi.country'); - } $cell['sel_options'] = $GLOBALS['egw']->country->us_states(); $cell['no_lang'] = True; break; case 'select-cat': // !$type == globals cats too, $type2: extraStyleMultiselect, $type3: application, if not current-app - if (!is_object($GLOBALS['egw']->categories)) - { - $GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories'); - } if ($readonly) // for readonly we dont need to fetch all cat's, nor do we need to indent them by level { $cell['no_lang'] = True; @@ -242,11 +230,6 @@ } if ($this->ui == 'html' && $type != 'groups') // use eGW's new account-selection (html only) { - if (!is_object($GLOBALS['egw']->uiaccountsel)) - { - require_once(EGW_API_INC.'/class.uiaccountsel.inc.php'); - $GLOBALS['egw']->uiaccountsel =& new uiaccountsel; - } $not = array_slice(explode(',',$cell['size']),4); $help = (int)$cell['no_lang'] < 2 ? lang($cell['help']) : $cell['help']; $onFocus = "self.status='".addslashes(htmlspecialchars($help))."'; return true;"; @@ -556,10 +539,6 @@ case 'select-country': if ($extension_data['country_use_name'] && $value_in) { - if (!is_object($GLOBALS['egw']->country)) - { - $GLOBALS['egw']->country =& CreateObject('phpgwapi.country'); - } if (($value = $GLOBALS['egw']->country->get_full_name($value_in))) { break; diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 106f243de7..fa762bb4b2 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -168,10 +168,6 @@ class so_sql echo "

so_sql('$app','$table')

\n"; _debug_array($this); } - if (!is_object($GLOBALS['egw']->datetime)) - { - $GLOBALS['egw']->datetime =& CreateObject('phpgwapi.datetime'); - } $this->tz_offset_s = $GLOBALS['egw']->datetime->tz_offset; $this->now = time() + $this->tz_offset_s; // time() is server-time and we need a user-time } diff --git a/etemplate/inc/class.tree_widget.inc.php b/etemplate/inc/class.tree_widget.inc.php index 303eaa922b..c1a8f33c79 100644 --- a/etemplate/inc/class.tree_widget.inc.php +++ b/etemplate/inc/class.tree_widget.inc.php @@ -66,10 +66,6 @@ class tree_widget switch ($cell['type']) { case 'tree-cat': // !$type == globals cats too, $type2: not used, $type3: application, if not current-app - if (!is_object($GLOBALS['egw']->categories)) - { - $GLOBALS['egw']->categories =& CreateObject('phpgwapi.categories'); - } if ($readonly) // for readonly we dont need to fetch all cat's, nor do we need to indent them by level { $cell['no_lang'] = True;