forked from extern/egroupware
added an array of replacement names to ease the transition to the new class naming scheme: app_class
This commit is contained in:
parent
1a8f6ed1bd
commit
c3e40ade99
13
index.php
13
index.php
@ -78,15 +78,7 @@
|
||||
}
|
||||
if($GLOBALS['egw_info']['user']['preferences']['common']['default_app'] && !$hasupdates)
|
||||
{
|
||||
/** Test if our default app is available else open about.php */
|
||||
if(is_file('./'.$GLOBALS['egw_info']['user']['preferences']['common']['default_app'].'/index.php'))
|
||||
{
|
||||
$GLOBALS['egw']->redirect_link('/'.$GLOBALS['egw_info']['user']['preferences']['common']['default_app'].'/index.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$GLOBALS['egw']->redirect_link('/about.php');
|
||||
}
|
||||
$GLOBALS['egw']->redirect(egw_framework::index($GLOBALS['egw_info']['user']['preferences']['common']['default_app']));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -112,8 +104,7 @@
|
||||
$app = 'phpgwapi';
|
||||
}
|
||||
|
||||
require_once(EGW_INCLUDE_ROOT.'/'.$app.'/inc/class.'.$class.'.inc.php');
|
||||
$GLOBALS[$class] = $obj = new $class();
|
||||
$obj = CreateObject($app.'.'.$class);
|
||||
if((is_array($obj->public_functions) && $obj->public_functions[$method]) && !$invalid_data)
|
||||
{
|
||||
$obj->$method();
|
||||
|
@ -675,10 +675,18 @@ function &CreateObject($class)
|
||||
{
|
||||
list($appname,$classname) = explode('.',$class);
|
||||
|
||||
if ($classname == 'datetime') $classname = 'egw_datetime'; // php5.2 fix
|
||||
|
||||
include_once(EGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php');
|
||||
|
||||
if (!@include_once(EGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php'))
|
||||
{
|
||||
static $replace = array(
|
||||
'datetime' => 'egw_datetime',
|
||||
'uitimesheet' => 'timesheet_ui',
|
||||
);
|
||||
if (isset($replace[$classname]))
|
||||
{
|
||||
$classname = $replace[$classname];
|
||||
include_once(EGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php');
|
||||
}
|
||||
}
|
||||
if (class_exists($classname))
|
||||
{
|
||||
$args = func_get_args();
|
||||
|
Loading…
Reference in New Issue
Block a user