"fixed sometimes double displayed header and/or navbar"

This commit is contained in:
Ralf Becker 2009-05-01 07:55:18 +00:00
parent b296a97e31
commit 8651288b97

View File

@ -40,11 +40,17 @@ class idots_framework extends egw_framework
*/ */
var $tplsav2; var $tplsav2;
/** /**
* true if $this->header() was called
*
* @var boolean
*/
static $header_done = false;
/**
* true if $this->navbar() was called * true if $this->navbar() was called
* *
* @var boolean * @var boolean
*/ */
var $navbar_done; static $navbar_done = false;
/** /**
* Contains array with linked icons in the topmenu * Contains array with linked icons in the topmenu
@ -84,6 +90,10 @@ class idots_framework extends egw_framework
*/ */
function header() function header()
{ {
// make sure header is output only once
if (self::$header_done) return '';
self::$header_done = true;
// add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv) // add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv)
header('Content-type: text/html; charset='.$GLOBALS['egw']->translation->charset()); header('Content-type: text/html; charset='.$GLOBALS['egw']->translation->charset());
@ -113,7 +123,8 @@ class idots_framework extends egw_framework
*/ */
function navbar() function navbar()
{ {
$this->navbar_done = true; if (self::$navbar_done) return '';
self::$navbar_done = true;
// the navbar // the navbar
$this->tpl->set_file(array('navbar' => 'navbar.tpl')); $this->tpl->set_file(array('navbar' => 'navbar.tpl'));
@ -679,7 +690,7 @@ class idots_framework extends egw_framework
// do the template sets footer, former parse_navbar_end function // do the template sets footer, former parse_navbar_end function
// this closes the application area AND renders the closing body- and html-tag // this closes the application area AND renders the closing body- and html-tag
if ($this->navbar_done) if (self::$navbar_done)
{ {
$this->tpl->set_file(array('footer' => 'footer.tpl')); $this->tpl->set_file(array('footer' => 'footer.tpl'));
$this->tpl->set_var($this->_get_footer()); $this->tpl->set_var($this->_get_footer());