mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
re-enabled the 1.0.0 compatibility of the HEAD version of eTemplate: allows to use HEAD eTemplate in an 1.0.0 install, eg. to use the improved tab-widget (no reload anymore)
This commit is contained in:
parent
7cc61c1ba4
commit
ef7fa4813c
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
include_once(EGW_INCLUDE_ROOT . '/etemplate/inc/class.soetemplate.inc.php');
|
include_once(PHPGW_INCLUDE_ROOT . '/etemplate/inc/class.soetemplate.inc.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Business Object for eTemplates, extending the Storage Object
|
* Business Object for eTemplates, extending the Storage Object
|
||||||
@ -79,7 +79,7 @@
|
|||||||
{
|
{
|
||||||
$this->init($name);
|
$this->init($name);
|
||||||
}
|
}
|
||||||
$this->garbage_collection_done =& $GLOBALS['egw_info']['etemplate']['garbage_collection_done'];
|
$this->garbage_collection_done =& $GLOBALS['phpgw_info']['etemplate']['garbage_collection_done'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -238,7 +238,7 @@
|
|||||||
{
|
{
|
||||||
list($msec,$sec) = explode(' ',microtime());
|
list($msec,$sec) = explode(' ',microtime());
|
||||||
$time = 100 * $sec + (int)(100 * $msec); // gives precision of 1/100 sec
|
$time = 100 * $sec + (int)(100 * $msec); // gives precision of 1/100 sec
|
||||||
$id = $GLOBALS['egw_info']['flags']['currentapp'] .':'. $time;
|
$id = $GLOBALS['phpgw_info']['flags']['currentapp'] .':'. $time;
|
||||||
//echo "<p>microtime()=".microtime().", sec=$sec, msec=$msec, id=$id</p>\n";
|
//echo "<p>microtime()=".microtime().", sec=$sec, msec=$msec, id=$id</p>\n";
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
@ -261,9 +261,9 @@
|
|||||||
{
|
{
|
||||||
$id = $this->appsession_id;
|
$id = $this->appsession_id;
|
||||||
}
|
}
|
||||||
$GLOBALS['egw']->session->appsession($id,'etemplate',$data);
|
$GLOBALS['phpgw']->session->appsession($id,'etemplate',$data);
|
||||||
|
|
||||||
if ($GLOBALS['egw_info']['server']['sessions_type'] == 'php4' && !$this->garbage_collection_done)
|
if ($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4' && !$this->garbage_collection_done)
|
||||||
{
|
{
|
||||||
return $this->php4_session_garbage_collection();
|
return $this->php4_session_garbage_collection();
|
||||||
}
|
}
|
||||||
@ -278,10 +278,10 @@
|
|||||||
*/
|
*/
|
||||||
function get_appsession($id)
|
function get_appsession($id)
|
||||||
{
|
{
|
||||||
$data = $GLOBALS['egw']->session->appsession($id,'etemplate');
|
$data = $GLOBALS['phpgw']->session->appsession($id,'etemplate');
|
||||||
//echo "boetemplate::get_appsession('$id')"; _debug_array($data);
|
//echo "boetemplate::get_appsession('$id')"; _debug_array($data);
|
||||||
|
|
||||||
if ($GLOBALS['egw_info']['server']['sessions_type'] == 'php4')
|
if ($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4')
|
||||||
{
|
{
|
||||||
$this->php4_session_garbage_collection($id);
|
$this->php4_session_garbage_collection($id);
|
||||||
}
|
}
|
||||||
@ -299,6 +299,8 @@
|
|||||||
*/
|
*/
|
||||||
function php4_session_garbage_collection($id_used='')
|
function php4_session_garbage_collection($id_used='')
|
||||||
{
|
{
|
||||||
|
if (!defined('EGW_SESSION_VAR')) return; // for 1.0.0 compatibility
|
||||||
|
|
||||||
// now we are on php4 sessions and do a bit of garbage collection
|
// now we are on php4 sessions and do a bit of garbage collection
|
||||||
$app_sessions =& $_SESSION[EGW_SESSION_VAR]['app_sessions']['etemplate'];
|
$app_sessions =& $_SESSION[EGW_SESSION_VAR]['app_sessions']['etemplate'];
|
||||||
$session_used =& $app_sessions['session_used'];
|
$session_used =& $app_sessions['session_used'];
|
||||||
@ -461,7 +463,7 @@
|
|||||||
|
|
||||||
if ($app == '')
|
if ($app == '')
|
||||||
{
|
{
|
||||||
$app = $GLOBALS['egw_info']['flags']['current_app'];
|
$app = $GLOBALS['phpgw_info']['flags']['current_app'];
|
||||||
}
|
}
|
||||||
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
|
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
|
||||||
{
|
{
|
||||||
@ -473,11 +475,11 @@
|
|||||||
}
|
}
|
||||||
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
|
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
|
||||||
{
|
{
|
||||||
return $GLOBALS['egw_info']['etemplate']['extension'][$type] = False;
|
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type] = False;
|
||||||
}
|
}
|
||||||
$GLOBALS['egw_info']['etemplate']['extension'][$type] = CreateObject($app.'.'.$class,$ui='html');
|
$GLOBALS['phpgw_info']['etemplate']['extension'][$type] = CreateObject($app.'.'.$class,$ui='html');
|
||||||
|
|
||||||
return $GLOBALS['egw_info']['etemplate']['extension'][$type]->human_name;
|
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->human_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -490,8 +492,8 @@
|
|||||||
*/
|
*/
|
||||||
function haveExtension($type,$function='')
|
function haveExtension($type,$function='')
|
||||||
{
|
{
|
||||||
return ($GLOBALS['egw_info']['etemplate']['extension'][$type] || $this->loadExtension($type,$ui)) &&
|
return ($GLOBALS['phpgw_info']['etemplate']['extension'][$type] || $this->loadExtension($type,$ui)) &&
|
||||||
($function == '' || $GLOBALS['egw_info']['etemplate']['extension'][$type]->public_functions[$function]);
|
($function == '' || $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->public_functions[$function]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -510,8 +512,8 @@
|
|||||||
{
|
{
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return $GLOBALS['egw_info']['etemplate']['extension'][$type]->pre_process($name,$value,$cell,$readonlys,
|
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->pre_process($name,$value,$cell,$readonlys,
|
||||||
$GLOBALS['egw_info']['etemplate']['extension_data'][$name],$this);
|
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],$this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -529,9 +531,9 @@
|
|||||||
{
|
{
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
return $GLOBALS['egw_info']['etemplate']['extension'][$type]->post_process($name,$value,
|
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->post_process($name,$value,
|
||||||
$GLOBALS['egw_info']['etemplate']['extension_data'][$name],
|
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],
|
||||||
$GLOBALS['egw_info']['etemplate']['loop'],$this,$value_in);
|
$GLOBALS['phpgw_info']['etemplate']['loop'],$this,$value_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -550,8 +552,8 @@
|
|||||||
{
|
{
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return $GLOBALS['egw_info']['etemplate']['extension'][$type]->render($cell,$name,$value,$readonly,
|
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->render($cell,$name,$value,$readonly,
|
||||||
$GLOBALS['egw_info']['etemplate']['extension_data'][$name],$this);
|
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],$this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -755,7 +757,7 @@
|
|||||||
function store_in_cache()
|
function store_in_cache()
|
||||||
{
|
{
|
||||||
//echo "<p>store_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n";
|
//echo "<p>store_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n";
|
||||||
$GLOBALS['egw_info']['etemplate']['cache'][$this->cache_name()] = $this->as_array(1);
|
$GLOBALS['phpgw_info']['etemplate']['cache'][$this->cache_name()] = $this->as_array(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -764,7 +766,7 @@
|
|||||||
function delete_in_cache()
|
function delete_in_cache()
|
||||||
{
|
{
|
||||||
//echo "<p>delete_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n";
|
//echo "<p>delete_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n";
|
||||||
unset($GLOBALS['egw_info']['etemplate']['cache'][$this->cache_name()]);
|
unset($GLOBALS['phpgw_info']['etemplate']['cache'][$this->cache_name()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -785,8 +787,8 @@
|
|||||||
$version = $name['version'];
|
$version = $name['version'];
|
||||||
$name = $name['name'];
|
$name = $name['name'];
|
||||||
}
|
}
|
||||||
if (!isset($GLOBALS['egw_info']['etemplate']['cache'][$cname]) ||
|
if (!isset($GLOBALS['phpgw_info']['etemplate']['cache'][$cname]) ||
|
||||||
!empty($version) && $GLOBALS['egw_info']['etemplate']['cache'][$cname]['version'] != $version)
|
!empty($version) && $GLOBALS['phpgw_info']['etemplate']['cache'][$cname]['version'] != $version)
|
||||||
{
|
{
|
||||||
//echo " NOT found in cache</p>\n";
|
//echo " NOT found in cache</p>\n";
|
||||||
return False;
|
return False;
|
||||||
@ -812,7 +814,7 @@
|
|||||||
//if (is_array($name)) $version = $name['version']; echo "<p>read_from_cache(,,,version='$version'): ";
|
//if (is_array($name)) $version = $name['version']; echo "<p>read_from_cache(,,,version='$version'): ";
|
||||||
if ($cname = $this->in_cache($name,$template,$lang,$group))
|
if ($cname = $this->in_cache($name,$template,$lang,$group))
|
||||||
{
|
{
|
||||||
$this->init($GLOBALS['egw_info']['etemplate']['cache'][$cname]);
|
$this->init($GLOBALS['phpgw_info']['etemplate']['cache'][$cname]);
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,9 @@
|
|||||||
|
|
||||||
if (($this->innerWidth = (int) $_POST['innerWidth']))
|
if (($this->innerWidth = (int) $_POST['innerWidth']))
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->session->appsession('innerWidth','etemplate',$this->innerWidth);
|
$GLOBALS['phpgw']->session->appsession('innerWidth','etemplate',$this->innerWidth);
|
||||||
}
|
}
|
||||||
elseif (!($this->innerWidth = (int) $GLOBALS['egw']->session->appsession('innerWidth','etemplate')))
|
elseif (!($this->innerWidth = (int) $GLOBALS['phpgw']->session->appsession('innerWidth','etemplate')))
|
||||||
{
|
{
|
||||||
$this->innerWidth = 1018; // default width for an assumed screen-resolution of 1024x768
|
$this->innerWidth = 1018; // default width for an assumed screen-resolution of 1024x768
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user