From: Michael M Slusarz Date: Thu, 29 Jul 2010 22:38:56 +0000 (-0600) Subject: Fix output buffering for things like the new sidebar code in the prefs screen X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c0e10b4a380f6e08c70d1ee0856a7b629b8da111;p=horde.git Fix output buffering for things like the new sidebar code in the prefs screen --- diff --git a/framework/Core/lib/Horde/Core/Prefs/Ui.php b/framework/Core/lib/Horde/Core/Prefs/Ui.php index 778d4378b..87b9d118e 100644 --- a/framework/Core/lib/Horde/Core/Prefs/Ui.php +++ b/framework/Core/lib/Horde/Core/Prefs/Ui.php @@ -521,9 +521,18 @@ class Horde_Core_Prefs_Ui /* Get the menu output before we start to output the page. * Again, this will catch any javascript inserted into the page. */ - if (!$this->vars->ajaxui && - $registry->hasAppMethod($this->app, 'prefsMenu')) { - $menu = $registry->callAppMethod($this->app, 'prefsMenu', array('args' => array($this))); + if ($this->vars->ajaxui) { + $menu_out = ''; + } else { + if ($registry->hasAppMethod($this->app, 'prefsMenu')) { + $menu = $registry->callAppMethod($this->app, 'prefsMenu', array('args' => array($this))); + } + + /* Buffer this, as it may add javascript/stylesheets/meta tags to + * the document HEAD. */ + Horde::startBuffer(); + require $h_templates . '/menu/menu.inc'; + $menu_out = Horde::endBuffer(); } /* Get list of accessible applications. */ @@ -539,10 +548,7 @@ class Horde_Core_Prefs_Ui /* Ouptut screen. */ $GLOBALS['bodyId'] = 'services_prefs'; require $h_templates . '/common-header.inc'; - - if (!$this->vars->ajaxui) { - require $h_templates . '/menu/menu.inc'; - } + echo $menu_out; $notification->notify(array('listeners' => 'status'));