allow to specify the app-name in which a widget is defined in the widgets name: list($app) = explode('_',$name)

This commit is contained in:
Ralf Becker 2005-06-12 12:32:59 +00:00
parent 0cde45389d
commit 6a4ff5d1d1

View File

@ -461,9 +461,11 @@
list($class,$app) = explode('.',$type);
$class .= '_widget';
if ($app == '')
if (!$app) $app = $GLOBALS['phpgw_info']['flags']['current_app'];
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
{
$app = $GLOBALS['phpgw_info']['flags']['current_app'];
list($app) = explode('_',$type);
}
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
{
@ -475,10 +477,12 @@
}
if (!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
{
//echo "<p>boetemplate::loadExtension($type) extension not found</p>\n";
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type] = False;
}
$GLOBALS['phpgw_info']['etemplate']['extension'][$type] = CreateObject($app.'.'.$class,$ui='html');
$GLOBALS['phpgw_info']['etemplate']['extension'][$type] =& CreateObject($app.'.'.$class,$ui='html');
//echo "<p>boetemplate::loadExtension($type) extension found in App. $app</p>\n";
return $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->human_name;
}