From 000b74bded98c0635fa7df9b67824f8c6cded05a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 7 Mar 2012 08:45:57 +0000 Subject: [PATCH] framework->isTop($consider_navbar_not_yet_called_as_true=true): true if we are rendering the top-level EGroupware window --- phpgwapi/inc/class.egw_framework.inc.php | 10 ++++++++++ .../templates/idots/class.idots_framework.inc.php | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 404e6e79df..040a19f2cb 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -177,6 +177,16 @@ abstract class egw_framework */ abstract function navbar(); + /** + * Return true if we are rendering the top-level EGroupware window + * + * A top-level EGroupware window has a navbar: eg. no popup and for a framed template (jdots) only frameset itself + * + * @return boolean $consider_navbar_not_yet_called_as_true=true + * @return boolean + */ + abstract function isTop($consider_navbar_not_yet_called_as_true=true); + /** * Returns the content of one sidebox * diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index 2722a40715..032ea415f4 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -292,6 +292,20 @@ egw.set_user('.$GLOBALS['egw']->accounts->json($GLOBALS['egw_info']['user']['acc return $content; } + /** + * Return true if we are rendering the top-level EGroupware window + * + * A top-level EGroupware window has a navbar: eg. no popup and for a framed template (jdots) only frameset itself + * + * @return boolean $consider_navbar_not_yet_called_as_true=true + * @return boolean + */ + public function isTop($consider_navbar_not_yet_called_as_true=true) + { + return self::$navbar_done || $consider_navbar_not_yet_called_as_true || + isset($GLOBALS['egw_info']['flags']['nonavbar']) && !$GLOBALS['egw_info']['flags']['nonavbar']; + } + /** * displays a login screen *