framework->navbar() now automatically calls framework->header(), this way navbar or sidebox can include JS or CSS, because header is called after

This commit is contained in:
Ralf Becker 2010-10-18 10:46:47 +00:00
parent 351151bd5f
commit af7a24eb9a
3 changed files with 11 additions and 5 deletions

View File

@ -320,8 +320,6 @@ class etemplate extends boetemplate
$GLOBALS['egw_info']['flags']['css'] .= "\n\t\t</style>\n\t\t".'<link href="'.$GLOBALS['egw_info']['server']['webserver_url'].
$css_file.'?'.filemtime(EGW_SERVER_ROOT.$css_file).'" type="text/css" rel="StyleSheet" />'."\n\t\t<style>\n\t\t\t";
}
$GLOBALS['egw']->common->egw_header();
}
elseif (!isset(self::$previous_content))
{
@ -345,10 +343,11 @@ class etemplate extends boetemplate
{
if((int) $output_mode != 2)
{
echo parse_navbar();
echo $GLOBALS['egw']->framework->navbar(); // do header too
}
else
{
echo $GLOBALS['egw']->framework->header();
echo '<div id="popupMainDiv">'."\n";
if ($GLOBALS['egw_info']['user']['apps']['manual']) // adding a manual icon to every popup
{

View File

@ -154,6 +154,9 @@ abstract class egw_framework
/**
* Returns the html from the body-tag til the main application area (incl. opening div tag)
*
* If header has NOT been called, also return header content!
* No need to manually call header, this allows to postpone header so navbar / sidebox can include JS or CSS.
*
* @return string with html
*/
@ -1233,7 +1236,7 @@ if (!function_exists('parse_navbar'))
/**
* echo's out the navbar
*
* @deprecated use $GLOBALS['egw']->framework::navbar() or $GLOBALS['egw']->framework::render()
* @deprecated use $GLOBALS['egw']->framework->navbar() or $GLOBALS['egw']->framework::render()
*/
function parse_navbar()
{

View File

@ -97,7 +97,7 @@ class idots_framework extends egw_framework
// the instanciation of the template has to be here and not in the constructor,
// as the old Template class has problems if restored from the session (php-restore)
$this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
if (!is_object($this->tpl)) $this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
$this->tpl->set_file(array('_head' => 'head.tpl'));
$this->tpl->set_block('_head','head');
@ -121,6 +121,7 @@ class idots_framework extends egw_framework
self::$navbar_done = true;
// the navbar
if (!is_object($this->tpl)) $this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
$this->tpl->set_file(array('navbar' => 'navbar.tpl'));
$this->tpl->set_block('navbar','extra_blocks_header','extra_block_header');
@ -260,6 +261,9 @@ class idots_framework extends egw_framework
// hook after navbar
$content .= $this->_get_after_navbar();
// make sure header is output (not explicitly calling header, allows to put validate calls eg. in sidebox)
if (!self::$header_done) $content = $this->header() . $content;
return $content;
}