From c0e10b4a380f6e08c70d1ee0856a7b629b8da111 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 29 Jul 2010 16:38:56 -0600 Subject: [PATCH] Fix output buffering for things like the new sidebar code in the prefs screen --- framework/Core/lib/Horde/Core/Prefs/Ui.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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')); -- 2.11.0