diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php
index f24e2f900f..cbd578e2a0 100644
--- a/phpgwapi/inc/class.common.inc.php
+++ b/phpgwapi/inc/class.common.inc.php
@@ -864,10 +864,7 @@
$this->navbar(False);
include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $phpgw_info['server']['template_set']
. '/navbar.inc.php');
- if ((!isset($phpgw_info['flags']['nonavbar']) ||
- !$phpgw_info['flags']['nonavbar']) &&
- (!isset($phpgw_info['flags']['navbar_target']) ||
- !$phpgw_info['flags']['navbar_target']))
+ if (!@$phpgw_info['flags']['nonavbar'] && !@$phpgw_info['flags']['navbar_target'])
{
echo parse_navbar();
}
@@ -875,7 +872,7 @@
function phpgw_footer()
{
- global $phpgw, $phpgw_info, $HTMLCOMPLAINT;
+ global $phpgw, $phpgw_info, $HTMLCOMPLIANT;
if (!isset($phpgw_info['flags']['nofooter']) || !$phpgw_info['flags']['nofooter'])
{
diff --git a/phpgwapi/inc/footer.inc.php b/phpgwapi/inc/footer.inc.php
index 61bebed181..14b1982a54 100644
--- a/phpgwapi/inc/footer.inc.php
+++ b/phpgwapi/inc/footer.inc.php
@@ -41,7 +41,30 @@
(!isset($phpgw_info['flags']['noappfooter']) ||
!$phpgw_info['flags']['noappfooter']))
{
- include(PHPGW_APP_INC . '/footer.inc.php');
+ if ($menuaction)
+ {
+ list($app,$class,$method) = explode('.',$menuaction);
+ if ($app && $class && $method)
+ {
+ $obj = CreateObject(sprintf('%s.%s',$app,$class));
+ if (is_array($obj->public_functions) && $obj->public_functions['footer'])
+ {
+ eval("\$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');
+ }
+ }
+ elseif(file_exists(PHPGW_APP_INC.'/footer.inc.php'))
+ {
+ include(PHPGW_APP_INC . '/footer.inc.php');
+ }
}
parse_navbar_end();
diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index 7e14d08b46..eb07b15be8 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -429,7 +429,7 @@
/*************************************************************************\
* These lines load up the templates class *
\*************************************************************************/
- if(!$phpgw_info['flags']['disable_Template_class'])
+ if(!@$phpgw_info['flags']['disable_Template_class'])
{
$phpgw->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
}
@@ -510,8 +510,7 @@
/*************************************************************************\
* Load the header unless the developer turns it off *
\*************************************************************************/
- if (!isset($phpgw_info['flags']['noheader']) ||
- !$phpgw_info['flags']['noheader'])
+ if (!@$phpgw_info['flags']['noheader'])
{
$phpgw->common->phpgw_header();
}
@@ -520,15 +519,13 @@
* Load the app include files if the exists *
\*************************************************************************/
/* Then the include file */
- if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php'))
+ if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !isset($menuaction))
{
include(PHPGW_APP_INC . '/functions.inc.php');
}
- if ((!isset($phpgw_info['flags']['noheader']) ||
- !$phpgw_info['flags']['noheader']) &&
- (!isset($phpgw_info['flags']['noappheader']) ||
- !$phpgw_info['flags']['noappheader']) &&
- file_exists(PHPGW_APP_INC . '/header.inc.php'))
+ if (!@$phpgw_info['flags']['noheader'] &&
+ !@$phpgw_info['flags']['noappheader'] &&
+ file_exists(PHPGW_APP_INC . '/header.inc.php') && !isset($menuaction))
{
include(PHPGW_APP_INC . '/header.inc.php');
}
diff --git a/phpgwapi/templates/default/navbar.inc.php b/phpgwapi/templates/default/navbar.inc.php
index 37fff023e4..ec815435a4 100644
--- a/phpgwapi/templates/default/navbar.inc.php
+++ b/phpgwapi/templates/default/navbar.inc.php
@@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
- global $phpgw_info, $phpgw;
+ global $phpgw_info, $phpgw, $menuaction;
$tpl = createobject("phpgwapi.Template",PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns("remove");
@@ -89,15 +89,20 @@
$tpl->set_var("messages",$api_messages . "
" . checkcode($cd));
}
- // If the application has a header include, we now include it
- if ((isset($phpgw_info["flags"]["noheader"]) &&
- $phpgw_info['flags']['noheader']) &&
- (isset($phpgw_info['flags']['noappheader']) &&
- !$phpgw_info["flags"]["noappheader"]))
- {
-
- }
- $tpl->pfp('out','navbar');
+ $tpl->pfp('out','navbar');
+ // If the application has a header include, we now include it
+ if (!@$phpgw_info['flags']['noappheader'] && $menuaction)
+ {
+ list($app,$class,$method) = explode('.',$menuaction);
+ if ($app && $class && $method)
+ {
+ $obj = CreateObject(sprintf('%s.%s',$app,$class));
+ if (is_array($obj->public_functions) && $obj->public_functions['header'])
+ {
+ eval("\$obj->header();");
+ }
+ }
+ }
$phpgw->common->hook('after_navbar');
return;
}
diff --git a/phpgwapi/templates/idsociety/navbar.inc.php b/phpgwapi/templates/idsociety/navbar.inc.php
index 37458dd492..86d39f35f6 100644
--- a/phpgwapi/templates/idsociety/navbar.inc.php
+++ b/phpgwapi/templates/idsociety/navbar.inc.php
@@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
- global $phpgw_info, $phpgw;
+ global $phpgw_info, $phpgw, $menuaction;
$tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
$tpl->set_unknowns('remove');
@@ -135,16 +135,20 @@
$tpl->set_var('messages',$api_messages . '
' . checkcode($cd));
}
*/
-
- // If the application has a header include, we now include it
- if ((isset($phpgw_info["flags"]["noheader"]) &&
- $phpgw_info['flags']['noheader']) &&
- (isset($phpgw_info['flags']['noappheader']) &&
- !$phpgw_info["flags"]["noappheader"]))
- {
-
- }
$tpl->pfp('out','navbar');
+ // If the application has a header include, we now include it
+ if (!@$phpgw_info['flags']['noappheader'] && $menuaction)
+ {
+ list($app,$class,$method) = explode('.',$menuaction);
+ if ($app && $class && $method)
+ {
+ $obj = CreateObject(sprintf('%s.%s',$app,$class));
+ if (is_array($obj->public_functions) && $obj->public_functions['header'])
+ {
+ eval("\$obj->header();");
+ }
+ }
+ }
$phpgw->common->hook('after_navbar');
return;
}
diff --git a/phpgwapi/templates/justweb/navbar.inc.php b/phpgwapi/templates/justweb/navbar.inc.php
index ce5b00ed4c..5d79d7359e 100644
--- a/phpgwapi/templates/justweb/navbar.inc.php
+++ b/phpgwapi/templates/justweb/navbar.inc.php
@@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
- global $phpgw_info, $phpgw, $PHP_SELF;
+ global $phpgw_info, $phpgw, $PHP_SELF, $menuaction;
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
@@ -88,6 +88,19 @@
} */
$tpl->pfp('out','navbar');
+ // If the application has a header include, we now include it
+ if (!@$phpgw_info['flags']['noappheader'] && $menuaction)
+ {
+ list($app,$class,$method) = explode('.',$menuaction);
+ if ($app && $class && $method)
+ {
+ $obj = CreateObject(sprintf('%s.%s',$app,$class));
+ if (is_array($obj->public_functions) && $obj->public_functions['header'])
+ {
+ eval("\$obj->header();");
+ }
+ }
+ }
$phpgw->common->hook('after_navbar');
return;
}
diff --git a/phpgwapi/templates/verdilak/navbar.inc.php b/phpgwapi/templates/verdilak/navbar.inc.php
index 811409e6db..a6ed080f68 100644
--- a/phpgwapi/templates/verdilak/navbar.inc.php
+++ b/phpgwapi/templates/verdilak/navbar.inc.php
@@ -13,7 +13,7 @@
function parse_navbar($force = False)
{
- global $phpgw_info, $phpgw, $PHP_SELF;
+ global $phpgw_info, $phpgw, $PHP_SELF, $menuaction;
$tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
@@ -118,6 +118,19 @@
$tpl->set_var('messages',$api_messages . '
' . checkcode($cd));
}
$tpl->pfp('out','navbar');
+ // If the application has a header include, we now include it
+ if (!@$phpgw_info['flags']['noappheader'] && $menuaction)
+ {
+ list($app,$class,$method) = explode('.',$menuaction);
+ if ($app && $class && $method)
+ {
+ $obj = CreateObject(sprintf('%s.%s',$app,$class));
+ if (is_array($obj->public_functions) && $obj->public_functions['header'])
+ {
+ eval("\$obj->header();");
+ }
+ }
+ }
$phpgw->common->hook('after_navbar');
return;
}