diff --git a/index.php b/index.php index 9492f3cf20..188e4bf6bd 100755 --- a/index.php +++ b/index.php @@ -51,9 +51,11 @@ } $GLOBALS['obj'] = CreateObject(sprintf('%s.%s',$app,$class)); - if ((is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions[$method]) && ! $invalid_data) + $GLOBALS[$class] = $GLOBALS['obj']; + if ((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data) { - eval("\$GLOBALS['obj']->$method();"); +// eval("\$GLOBALS['obj']->$method();"); + execmethod($GLOBALS['HTTP_GET_VARS']['menuaction']); } else { diff --git a/phpgwapi/inc/footer.inc.php b/phpgwapi/inc/footer.inc.php index 12a73b4d45..a6bab4fb36 100644 --- a/phpgwapi/inc/footer.inc.php +++ b/phpgwapi/inc/footer.inc.php @@ -34,7 +34,7 @@ /**************************************************************************\ * Include the apps footer files if it exists * \**************************************************************************/ - if (file_exists (PHPGW_APP_INC . '/footer.inc.php') && + if ((file_exists (PHPGW_APP_INC . '/footer.inc.php') || isset($GLOBALS['HTTP_GET_VARS'])) && $GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' && $GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' && $GLOBALS['phpgw_info']['flags']['currentapp'] != 'logout' && @@ -42,23 +42,16 @@ { if ($GLOBALS['HTTP_GET_VARS']['menuaction']) { -// list($app,$class,$method) = explode('.',$menuaction); -// if ($app && $class && $method) -// { -// $GLOBALS['obj'] = CreateObject(sprintf('%s.%s',$GLOBALS['app'],$GLOBALS['class'])); - if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['footer']) - { - eval("\$GLOBALS['obj']->footer();"); - } - elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php')) - { - include(PHPGW_APP_INC . '/footer.inc.php'); - } -// } -// elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php')) -// { -// include(PHPGW_APP_INC . '/footer.inc.php'); -// } + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['footer']) + { +// eval("\$GLOBALS[$class]->footer();"); + $GLOBALS[$class]->footer(); + } + elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php')) + { + include(PHPGW_APP_INC . '/footer.inc.php'); + } } elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php')) { diff --git a/phpgwapi/templates/default/head.inc.php b/phpgwapi/templates/default/head.inc.php index 1ecb75301f..3579dc5118 100644 --- a/phpgwapi/templates/default/head.inc.php +++ b/phpgwapi/templates/default/head.inc.php @@ -11,17 +11,19 @@ /* $Id$ */ - if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css']) + $app_css = ''; + if(isset($GLOBALS['HTTP_GET_VARS']['menuaction']) { - eval("\$app_css = \$GLOBALS['obj']->css();"); - } - else - { - $app_css = ''; + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css']) + { + $app_css = $GLOBALS[$class]->css(); + } } $bodyheader = 'BGCOLOR="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'"'; - if ($GLOBALS['phpgw_info']['server']['htmlcompliant']) { + if ($GLOBALS['phpgw_info']['server']['htmlcompliant']) + { $bodyheader .= ' ALINK="'.$GLOBALS['phpgw_info']['theme']['alink'].'" LINK="'.$GLOBALS['phpgw_info']['theme']['link'].'" VLINK="'.$GLOBALS['phpgw_info']['theme']['vlink'].'"'; } diff --git a/phpgwapi/templates/default/navbar.inc.php b/phpgwapi/templates/default/navbar.inc.php index 8140101dde..0c53b5459e 100644 --- a/phpgwapi/templates/default/navbar.inc.php +++ b/phpgwapi/templates/default/navbar.inc.php @@ -112,9 +112,10 @@ // If the application has a header include, we now include it if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && $GLOBALS['HTTP_GET_VARS']['menuaction']) { - if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['header']) + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header']) { - eval("\$GLOBALS['obj']->header();"); + $GLOBALS[$class]->header(); } } $GLOBALS['phpgw']->common->hook('after_navbar'); diff --git a/phpgwapi/templates/idsociety/head.inc.php b/phpgwapi/templates/idsociety/head.inc.php index 8714abdddf..378bdbf955 100644 --- a/phpgwapi/templates/idsociety/head.inc.php +++ b/phpgwapi/templates/idsociety/head.inc.php @@ -22,13 +22,14 @@ $csshover = ''; } - if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css']) + $app_css = ''; + if($GLOBALS['HTTP_GET_VARS']['menuaction']) { - eval("\$app_css = \$GLOBALS['obj']->css();"); - } - else - { - $app_css = ''; + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css']) + { + $app_css = $GLOBALS[$class]->css(); + } } $bodyheader = 'bgcolor="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'" alink="'.$GLOBALS['phpgw_info']['theme']['alink'].'" link="'.$GLOBALS['phpgw_info']['theme']['link'].'" vlink="'.$GLOBALS['phpgw_info']['theme']['vlink'].'"'; diff --git a/phpgwapi/templates/idsociety/navbar.inc.php b/phpgwapi/templates/idsociety/navbar.inc.php index a0232a17b7..5b13749c9b 100644 --- a/phpgwapi/templates/idsociety/navbar.inc.php +++ b/phpgwapi/templates/idsociety/navbar.inc.php @@ -141,9 +141,10 @@ // If the application has a header include, we now include it if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && $GLOBALS['HTTP_GET_VARS']['menuaction']) { - if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['header']) + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header']) { - eval("\$GLOBALS['obj']->header();"); + $GLOBALS[$class]->header(); } } $GLOBALS['phpgw']->common->hook('after_navbar'); diff --git a/phpgwapi/templates/justweb/head.inc.php b/phpgwapi/templates/justweb/head.inc.php index 71222d8455..82944cd681 100644 --- a/phpgwapi/templates/justweb/head.inc.php +++ b/phpgwapi/templates/justweb/head.inc.php @@ -11,13 +11,14 @@ /* $Id$ */ - if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css']) + $app_css = ''; + if($GLOBALS['menuaction']) { - eval("\$app_css = \$GLOBALS['obj']->css();"); - } - else - { - $app_css = ''; + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css']) + { + $app_css = $GLOBALS[$class]->css(); + } } $bodyheader = 'BGCOLOR="'.$GLOBALS['phpgw_info']['theme']['bg_color'].'"'; diff --git a/phpgwapi/templates/justweb/navbar.inc.php b/phpgwapi/templates/justweb/navbar.inc.php index fdfdcc277e..f5afdf34d4 100644 --- a/phpgwapi/templates/justweb/navbar.inc.php +++ b/phpgwapi/templates/justweb/navbar.inc.php @@ -116,9 +116,10 @@ // If the application has a header include, we now include it if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && $GLOBALS['HTTP_GET_VARS']['menuaction']) { - if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['header']) + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header']) { - eval("\$GLOBALS['obj']->header();"); + $GLOBALS[$class]->header(); } } $GLOBALS['phpgw']->common->hook('after_navbar'); diff --git a/phpgwapi/templates/verdilak/head.inc.php b/phpgwapi/templates/verdilak/head.inc.php index aea075cc93..382ded2345 100644 --- a/phpgwapi/templates/verdilak/head.inc.php +++ b/phpgwapi/templates/verdilak/head.inc.php @@ -11,13 +11,14 @@ /* $Id$ */ - if($GLOBALS['menuaction'] && is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['css']) + $app_css = ''; + if($GLOBALS['HTTP_GET_VARS']['menuaction']) { - eval("\$app_css = \$GLOBALS['obj']->css();"); - } - else - { - $app_css = ''; + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if(is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['css']) + { + $app_css = $GLOBALS[$class]->css(); + } } $bodyheader = ' bgcolor="' . $GLOBALS['phpgw_info']['theme']['bg_color'] . '" alink="' diff --git a/phpgwapi/templates/verdilak/navbar.inc.php b/phpgwapi/templates/verdilak/navbar.inc.php index e94f45d8a6..d63bfb9d3e 100644 --- a/phpgwapi/templates/verdilak/navbar.inc.php +++ b/phpgwapi/templates/verdilak/navbar.inc.php @@ -123,9 +123,10 @@ // If the application has a header include, we now include it if (!@$GLOBALS['phpgw_info']['flags']['noappheader'] && $GLOBALS['HTTP_GET_VARS']['menuaction']) { - if (is_array($GLOBALS['obj']->public_functions) && $GLOBALS['obj']->public_functions['header']) + list($app,$class,$method) = explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']); + if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions['header']) { - eval("\$GLOBALS['obj']->header();"); + $GLOBALS[$class]->header(); } } $GLOBALS['phpgw']->common->hook('after_navbar');