mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
removed unnecessary instancations and using static methods of html and egw_link class
This commit is contained in:
parent
afe2795f2d
commit
5fd2d8def8
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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'];
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -168,10 +168,6 @@ class so_sql
|
||||
echo "<p>so_sql('$app','$table')</p>\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
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user