Add Horde::startBuffer(), Horde::endBuffer(), and Horde::contentSent()
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 13 Apr 2010 18:47:40 +0000 (12:47 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 13 Apr 2010 22:51:41 +0000 (16:51 -0600)
Remove Horde_Util::bufferOutput(). Its usefulness has always been
debatable since it ran in a different scope from the location that
called it (so including/requiring files would not pick up any local
variables from the calling location).

65 files changed:
agora/ban.php
agora/deleteforum.php
agora/editforum.php
agora/forums.php
agora/lib/Api.php
agora/messages/abuse.php
agora/messages/delete.php
agora/messages/edit.php
agora/messages/index.php
agora/messages/lock.php
agora/messages/merge.php
agora/messages/move.php
agora/messages/split.php
agora/moderate.php
agora/moderators.php
agora/search.php
agora/threads.php
babel/edit.php
babel/lib/base.php
babel/view.php
framework/Ajax/lib/Horde/Ajax/Application/Base.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Core/Prefs/Ui.php
framework/Core/lib/Horde/Script/Files.php
framework/Image/lib/Horde/Image/Gd.php
framework/Mime/lib/Horde/Mime/Viewer/Css.php
framework/Mime/lib/Horde/Mime/Viewer/Php.php
framework/Mime/lib/Horde/Mime/Viewer/Srchighlite.php
framework/Mime/lib/Horde/Mime/Viewer/Vcard.php
framework/Util/lib/Horde/Util.php
framework/Util/package.xml
horde/admin/setup/config.php
horde/admin/setup/index.php
horde/lib/Block/cloud.php
horde/services/help/index.php
horde/services/logintasks.php
hylax/compose.php
hylax/folder.php
hylax/lib/Image.php
hylax/send.php
hylax/summary.php
hylax/view.php
imp/compose.php
imp/lib/Block/summary.php
imp/lib/Mime/Viewer/Html.php
imp/lib/Mime/Viewer/Itip.php
imp/lib/Test.php
imp/view.php
turba/lib/Block/minisearch.php
turba/lib/Test.php
turba/lib/tests/BrowsePageTest.php
turba/lib/tests/ViewBrowseTest.php
vilma/domains/delete.php
vilma/domains/edit.php
vilma/domains/index.php
vilma/users/delete.php
vilma/users/edit.php
vilma/users/editAlias.php
vilma/users/editForward.php
vilma/users/index.php
vilma/virtuals/delete.php
vilma/virtuals/edit.php
vilma/virtuals/index.php
whups/lib/Block/myqueries.php
wicked/lib/Page/SyncPages.php

index ecb9e2b..b8336bf 100644 (file)
@@ -61,8 +61,15 @@ $form->addVariable(_("User"), 'user', 'text', true);
 
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, 'ban.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$form->renderActive(null, null, 'ban.php', 'post');
+$view->formbox = Horde::endBuffer();
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->banned = $banned;
 $view->forum = $forums->getForum();
 
index e796b11..60da3d8 100644 (file)
@@ -74,8 +74,14 @@ if ($form->validate()) {
 /* Set up template variables. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->main = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'deleteforum.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer()
+$form->renderActive(null, $vars, 'deleteforum.php', 'post');
+$view->main = Horde::endBuffer();
+
+Horde::startBuffer()
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
 
 require AGORA_TEMPLATES . '/common-header.inc';
 echo $view->render('main.html.php');
index 7ee0e20..877a516 100644 (file)
@@ -60,8 +60,14 @@ if ($forum_id) {
 /* Set up template variables. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->main = Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, 'editforum.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$form->renderActive(null, null, 'editforum.php', 'post');
+$view->main = Horde::endBuffer();
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
 
 require AGORA_TEMPLATES . '/common-header.inc';
 echo $view->render('main.html.php');
index f9113fa..934aaf7 100644 (file)
@@ -58,7 +58,11 @@ $view = new Agora_View();
 $view->col_headers = $col_headers;
 $view->forums_list = $forums_list;
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->actions = empty($actions) ? null : $actions;
 
 /* Set up pager. */
index efafe4e..a5406c3 100644 (file)
@@ -443,7 +443,10 @@ class Agora_Api extends Horde_Registry_Api
         $messages = &Agora_Messages::singleton($scope, $params['forum_id']);
         if ($messages instanceof PEAR_Error) {
             $queue->push(_("Could not post the message: ") . $messages->getMessage(), 'horde.error');
-            return Horde_Util::bufferOutput(array($queue, 'notify'), array('listeners' => 'status'));
+
+            Horde::startBuffer();
+            $queue->notify(array('listeners' => 'status'));
+            return Horde::endBuffer();
         }
 
         /* Check post permissions. */
@@ -500,7 +503,10 @@ class Agora_Api extends Horde_Registry_Api
                 $queue->push(_("Message posted."), 'horde.success');
                 $count = $messages->countMessages();
                 $registry->callByPackage($scope, $callback, array($forum_name, 'messages', $count));
-                return Horde_Util::bufferOutput(array($queue, 'notify'), array('listeners' => 'status'));
+
+                Horde::startBuffer();
+                $queue->notify(array('listeners' => 'status'));
+                return Horde::endBuffer();
             }
         }
 
@@ -521,7 +527,9 @@ class Agora_Api extends Horde_Registry_Api
             $url = Horde::selfUrl(true, false, true);
         }
 
-        return Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, $url, 'post', null, false);
+        Horde::startBuffer();
+        $form->renderActive(null, $vars, $url, 'post', null, false);
+        return Horde::endBuffer();
     }
 
     /**
@@ -608,10 +616,15 @@ class Agora_Api extends Horde_Registry_Api
             } else {
                 $queue->push(_("Message not deleted."), 'horde.message');
             }
-            return Horde_Util::bufferOutput(array($queue, 'notify'), array('listeners' => 'status'));
+
+            Horde::startBuffer();
+            $queue->notify(array('listeners' => 'status'));
+            return Horde::endBuffer();
         }
 
-        return Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, null, 'post', null, false);
+        Horde::startBuffer();
+        $form->renderActive(null, null, null, 'post', null, false);
+        return Horde::endBuffer();
     }
 
     /**
index 5c4bb76..c989a69 100644 (file)
@@ -87,8 +87,15 @@ if ($form->validate()) {
 /* Set up template data. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'abuse.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'abuse.php', 'post');
+$view->formbox = Horde::endBuffer();
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_date = strftime($prefs->getValue('date_format'), $message['message_timestamp']);
index 9985b59..014cdd0 100644 (file)
@@ -77,8 +77,14 @@ $view->message_author = $message['message_author'];
 $view->message_date = $messages->dateFormat($message['message_timestamp']);
 $view->message_body = Agora_Messages::formatBody($message['body']);
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'delete.php', 'post');
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'delete.php', 'post');
+$view->formbox = Horde::endBuffer();
 
 require AGORA_TEMPLATES . '/common-header.inc';
 echo $view->render('messages/form.html.php');
index 39bc680..4647811 100644 (file)
@@ -115,8 +115,14 @@ if ($message_parent_id) {
 
 $view->replying = $message_parent_id;
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'edit.php', 'post');
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'edit.php', 'post');
+$view->formbox = Horde::endBuffer();
 
 require AGORA_TEMPLATES . '/common-header.inc';
 echo $view->render('messages/edit.html.php');
index 16d63bb..3f042a4 100644 (file)
@@ -185,7 +185,11 @@ default:
 
 /* Set up the main template tags. */
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->actions = $actions;
 $view->threads = $threads;
 $view->rss = Horde_Util::addParameter(Horde::applicationUrl('rss/messages.php', true, -1), array('scope' => $scope, 'message_id' => $message_id, 'forum_id' => $forum_id));
@@ -207,7 +211,9 @@ if (!$messages->hasPermission(Horde_Perms::EDIT)) {
     $vars->set('message_subject', $reply['message_subject']);
     $vars->set('message_body_old', $reply['body']);
     $form = $messages->getForm($vars, sprintf(_("Post a Reply to \"%s\""), $reply['message_subject']));
-    $view->form = Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, 'edit.php', 'post', null, false);
+    Horde::startBuffer();
+    $form->renderActive(null, null, 'edit.php', 'post', null, false);
+    $view->form = Horde::endBuffer();
 }
 
 Horde::addScriptFile('hideable.js', 'horde', true);
index 9cc818d..ab83227 100644 (file)
@@ -69,8 +69,15 @@ if ($form->validate()) {
 /* Set up template data. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'lock.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'lock.php', 'post');
+$view->formbox = Horde::endBuffer();
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_date = strftime($prefs->getValue('date_format'), $message['message_timestamp']);
index 4cf98d3..bbe125d 100644 (file)
@@ -81,7 +81,11 @@ if ($form->validate()) {
 /* Template object. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->main = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'merge.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'merge.php', 'post');
+$view->main = Horde::endBuffer();
+
 $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
index 12427c8..4daf3f5 100644 (file)
@@ -67,7 +67,11 @@ if ($form->validate()) {
 /* Template object. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'move.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'move.php', 'post');
+$view->formbox = Horde::endBuffer();
+
 $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
index 9fc0457..a0d7752 100644 (file)
@@ -63,7 +63,11 @@ if ($form->validate()) {
 /* Template object. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'split.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'split.php', 'post');
+$view->formbox = Horde::endBuffer();
+
 $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
index 8344c1f..4d2f275 100644 (file)
@@ -64,7 +64,10 @@ $view->col_headers = $col_headers;
 $view->messages = $messages_list;
 $view->buttons = array(_("Approve"), _("Delete"));
 $view->session_tag = Horde_Util::formInput();
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
 
 /* Set up pager. */
 $vars = Horde_Variables::getDefaultVariables();
index ef753ee..f56d9f2 100644 (file)
@@ -81,8 +81,15 @@ if ($messages->countForums() > 50) {
 /* Set up template data. */
 $view = new Agora_View();
 $view->menu = Agora::getMenu('string');
-$view->formbox = Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, 'moderators.php', 'post');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$form->renderActive(null, null, 'moderators.php', 'post');
+$view->formbox = Horde::endBuffer();
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->forums = $forums_list;
 
 Horde::addScriptFile('stripe.js', 'horde', true);
index 18f8439..9cce5d7 100644 (file)
@@ -62,8 +62,14 @@ if ($form->isSubmitted() || $thread_page != null) {
 }
 
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
-$view->searchForm = Horde_Util::bufferOutput(array($form, 'renderActive'), null, $vars, 'search.php', 'get');
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'search.php', 'get');
+$view->searchForm = Horde::endBuffer();
 
 $title = _("Search Forums");
 require AGORA_TEMPLATES . '/common-header.inc';
index d760dea..acdbe28 100644 (file)
@@ -64,7 +64,11 @@ $view->forum_name = sprintf(_("Threads in %s"), $forum_array['forum_name']);
 $view->forum_description =  Agora_Messages::formatBody($forum_array['forum_description']);
 $view->actions = $threads->getThreadActions();
 $view->menu = Agora::getMenu('string');
-$view->notify = Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status'));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$view->notify = Horde::endBuffer();
+
 $view->rss = Horde_Util::addParameter(Horde::applicationUrl('rss/threads.php', true, -1), array('scope' => $scope, 'forum_id' => $forum_id));
 
 /* Set up pager. */
index 73c534b..fa824fb 100644 (file)
@@ -43,7 +43,10 @@ if ($app) {
 
 /* Set up the template fields. */
 $template->set('menu', Babel::getMenu()->render());
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status')));
+$template->set('notify', Horde::endBuffer());
 
 /* Create upload form */
 $form = new Horde_Form($vars, _("Edit Translation"), $show);
@@ -53,15 +56,15 @@ if ($app && Horde_Util::getFormData('submitbutton') == _("Save")) {
 
     if ($form->validate($vars, false)) {
        $form->getInfo($vars, $form_values);
-       
+
        foreach($meta_params as $k => $v) {
            if ($val = Horde_Util::getFormData($k)) {
                $po->meta[$k] = $val;
            }
        }
-       
+
        $po->save($pofile);
-       
+
        if (Horde_Util::getFormData('url') == 'view') {
            $url = Horde::applicationUrl('view.php');
            $url = Horde_Util::addParameter($url, array('module' => $app));
@@ -80,10 +83,10 @@ if (!$app) {
     $form->setButtons(_("Save"));
     $form->addHidden('', 'module', 'text', false);
     $vars->set('module', $app);
-    
+
     $form->addHidden('', 'url', 'text', false);
     $vars->set('url', Horde_Util::getFormData('url'));
-    
+
     foreach($meta_params as $k => $v) {
        $form->addVariable($k, $k, 'text', false, false);
        if (isset($po->meta[$k]) && !empty($po->meta[$k])) {
index ccb657f..bd06231 100644 (file)
@@ -79,7 +79,11 @@ if (($lang = Horde_Util::getFormData('display_language')) !== null) {
 
 /* Set up the template fields. */
 $template->set('menu', Babel::getMenu()->render());
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
+
 $template->set('lang', Babel::displayLanguage());
 $fmenu = Babel::LanguageSelection();
 
index 3aad9ed..f732316 100644 (file)
@@ -143,7 +143,10 @@ if ($f_save && $cstring) {
 
 /* Set up the template fields. */
 $template->set('menu', Babel::getMenu()->render());
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 /* Create upload form */
 $form = new Horde_Form($vars, _("View Translation"), $show);
index 3421116..89988ad 100644 (file)
@@ -153,7 +153,9 @@ abstract class Horde_Ajax_Application_Base
         $chunk = basename(Horde_Util::getPost('chunk'));
         $result = new stdClass;
         if (!empty($chunk)) {
-            $result->chunk = Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', $this->_app) . '/chunks/' . $chunk . '.php');
+            Horde::startBuffer();
+            include $GLOBALS['registry']->get('templates', $this->_app) . '/chunks/' . $chunk . '.php';
+            $result->chunk = Horde::endBuffer();
         }
 
         return $result;
index f1f505e..cda3dd4 100644 (file)
@@ -57,6 +57,20 @@ class Horde
     static protected $_inlineScript = array();
 
     /**
+     * The current buffer level.
+     *
+     * @var integer
+     */
+    static protected $_bufferLevel = 0;
+
+    /**
+     * Has content been sent at the base buffer level?
+     *
+     * @var boolean
+     */
+    static protected $_contentSent = false;
+
+    /**
      * Shortcut to logging method.
      *
      * @see Horde_Core_Log_Logger
@@ -1956,4 +1970,43 @@ HTML;
         return 'Horde.popup(' . self::escapeJson($params, array('urlencode' => !empty($options['urlencode']))) . ');';
     }
 
+    /**
+     * Start buffering output.
+     */
+    static public function startBuffer()
+    {
+        if (!self::$_bufferLevel) {
+            self::$_contentSent = self::contentSent();
+        }
+
+        ++self::$_bufferLevel;
+        ob_start();
+    }
+
+    /**
+     * End buffering output.
+     *
+     * @return string  The buffered output.
+     */
+    static public function endBuffer()
+    {
+        if (self::$_bufferLevel) {
+            --self::$_bufferLevel;
+            return ob_get_clean();
+        }
+
+        return '';
+    }
+
+    /**
+     * Has any content been sent to the browser?
+     *
+     * @return boolean  True if content has been sent.
+     */
+    static public function contentSent()
+    {
+        return ((self::$_bufferLevel && self::$_contentSent) ||
+                (!self::$_bufferLevel && (ob_get_length() || headers_sent())));
+    }
+
 }
index f9d8cad..57861c5 100644 (file)
@@ -375,7 +375,7 @@ class Horde_Core_Prefs_Ui
         /* Need to buffer output - it is possible that 'special' types can
          * do things like add javascript to the page output. This should all
          * be combined and served in the page HEAD. */
-        ob_start();
+        Horde::startBuffer();
 
         if ($this->group) {
             if ($identities) {
@@ -512,7 +512,7 @@ class Horde_Core_Prefs_Ui
             echo $t->fetch($h_templates . '/prefs/overview.html');
         }
 
-        $content = ob_get_clean();
+        $content = Horde::endBuffer();
 
         $title = _("User Options");
 
index ef7110c..dc62980 100644 (file)
@@ -42,7 +42,7 @@ class Horde_Script_Files
     public function add($file, $app = null, $direct = false, $full = false)
     {
         if (($this->_add($file, $app, $direct, $full) === false) ||
-            (!ob_get_length() && !headers_sent())) {
+            !Horde::contentSent()) {
             return;
         }
 
index a5cee5b..bcc5f8a 100644 (file)
@@ -86,7 +86,9 @@ class Horde_Image_Gd extends Horde_Image_Base
             return '';
         }
 
-        return Horde_Util::bufferOutput('image' . $this->_type, $this->_im);
+        ob_start();
+        call_user_func('image' . $this->_type, $this->_im);
+        return ob_get_clean();
     }
 
     /**
index e7f6a14..859ced9 100644 (file)
@@ -72,9 +72,11 @@ class Horde_Mime_Viewer_Css extends Horde_Mime_Viewer_Source
 
         // Need Horde headers for CSS tags.
         reset($ret);
-        $ret[key($ret)]['data'] = Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
-            $ret[key($ret)]['data'] .
-            Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+        Horde::startBuffer();
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc';
+        echo $ret[key($ret)]['data'];
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+        $ret[key($ret)]['data'] = Horde::endBuffer();
 
         return $ret;
     }
index 44b52f2..a53825f 100644 (file)
@@ -36,9 +36,11 @@ class Horde_Mime_Viewer_Php extends Horde_Mime_Viewer_Source
 
         // Need Horde headers for CSS tags.
         reset($ret);
-        $ret[key($ret)]['data'] =  Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
-            $ret[key($ret)]['data'] .
-            Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+        Horde::startBuffer();
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc';
+        echo $ret[key($ret)]['data'];
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+        $ret[key($ret)]['data'] = Horde::endBuffer();
 
         return $ret;
     }
index d67b0aa..c765b44 100644 (file)
@@ -38,9 +38,11 @@ class Horde_Mime_Viewer_Srchighlite extends Horde_Mime_Viewer_Source
 
         // Need Horde headers for CSS tags.
         reset($ret);
-        $ret[key($ret)]['data'] =  Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
-            $ret[key($ret)]['data'] .
-            Horde_Util::bufferOutput('require', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+        Horde::startBuffer();
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc';
+        echo $ret[key($ret)]['data'];
+        require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+        $ret[key($ret)]['data'] = Horde::endBuffer();
 
         return $ret;
     }
index 8f636a5..ab2caf9 100644 (file)
@@ -39,12 +39,16 @@ class Horde_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Driver
     protected function _render()
     {
         $ret = $this->_renderInline();
+
         if (!empty($ret)) {
             reset($ret);
-            $ret[key($ret)]['data'] = Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
-                $ret[key($ret)]['data'] .
-                Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+            Horde::startBuffer();
+            include $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc';
+            echo $ret[key($ret)]['data'];
+            include $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+            $ret[key($ret)]['data'] = Horde::endBuffer();
         }
+
         return $ret;
     }
 
@@ -390,9 +394,12 @@ class Horde_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Driver
 
         $html .=  '</table>';
 
+        Horde::startBuffer();
+        $notification->notify(array('listeners' => 'status');
+
         return array(
             $this->_mimepart->getMimeId() => array(
-                'data' => Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')) . $html,
+                'data' => Horde::endBuffer() . $html,
                 'status' => array(),
                 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
             )
index 6ed6848..69ad679 100644 (file)
@@ -101,69 +101,6 @@ class Horde_Util
     }
 
     /**
-     * Buffers the output from a function call, like readfile() or
-     * highlight_string(), that prints the output directly, so that instead it
-     * can be returned as a string and used.
-     *
-     * @param string $function  The function to run.
-     * @param mixed $arg1       First argument to $function().
-     * @param mixed $arg2       Second argument to $function().
-     * @param mixed $arg...     ...
-     * @param mixed $argN       Nth argument to $function().
-     *
-     * @return string  The output of the function.
-     */
-    static public function bufferOutput()
-    {
-        if (func_num_args() == 0) {
-            return false;
-        }
-
-        $include = false;
-        $args = func_get_args();
-        $function = array_shift($args);
-
-        if (is_array($function)) {
-            if (!is_callable($function)) {
-                return false;
-            }
-        } elseif (($function == 'include') ||
-                  ($function == 'include_once') ||
-                  ($function == 'require') ||
-                  ($function == 'require_once')) {
-            $include = true;
-        } elseif (!function_exists($function)) {
-            return false;
-        }
-
-        ob_start();
-        if ($include) {
-            $file = implode(',', $args);
-            switch ($function) {
-            case 'include':
-                include $file;
-                break;
-
-            case 'include_once':
-                include_once $file;
-                break;
-
-            case 'require':
-                require $file;
-                break;
-
-            case 'require_once':
-                require_once $file;
-                break;
-            }
-        } else {
-            call_user_func_array($function, $args);
-        }
-
-        return ob_get_clean();
-    }
-
-    /**
      * Checks to see if a value has been set by the script and not by GET,
      * POST, or cookie input. The value being checked MUST be in the global
      * scope.
index b4baf04..07c84b1 100644 (file)
@@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Removed Horde_Util::uriB64Encode() and Horde_Util::uriB64Decode().
+ <notes>* Removed Horde_Util::bufferOutput().
+ * Removed Horde_Util::uriB64Encode() and Horde_Util::uriB64Decode().
  * Removed Horde_Util::strftime2date() and Horde_Util::date2strftime().
  * Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl().
  * Added Horde_String::convertToUtf8().
index 67043c1..a919ec6 100644 (file)
@@ -92,7 +92,10 @@ require HORDE_TEMPLATES . '/admin/menu.inc';
 /* Render the configuration form. */
 $renderer = $form->getRenderer();
 $renderer->setAttrColumnWidth('50%');
-$template->set('form', Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'config.php', 'post'));
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'config.php', 'post');
+$template->set('form', Horde::endBuffer());
 
 echo $template->fetch(HORDE_TEMPLATES . '/admin/setup/config.html');
 require HORDE_TEMPLATES . '/common-footer.inc';
index 0947dc9..3cb88da 100644 (file)
@@ -221,7 +221,9 @@ if (!empty($_SESSION['_config'])) {
         }
     }
     /* Render the form. */
-    $ftpform = Horde_Util::bufferOutput(array($ftpform, 'renderActive'), new Horde_Form_Renderer(), $vars, 'index.php', 'post');
+    Horde::startBuffer();
+    $ftpform->renderActive(new Horde_Form_Renderer(), $vars, 'index.php', 'post');
+    $ftpform = Horde::endBuffer();
 }
 
 if (file_exists(Horde::getTempDir() . '/horde_setup_upgrade.php')) {
index 6729894..6f564b3 100644 (file)
@@ -44,7 +44,10 @@ class Horde_Block_Horde_cloud extends Horde_Block {
                                'doSearch(\'' . $tag['tag_name'] . '\');');
         }
 
-        return Horde_Util::bufferOutput('include', HORDE_TEMPLATES . '/block/cloud.inc')
+        Horde::startBuffer();
+        include HORDE_TEMPLATES . '/block/cloud.inc';
+
+        return Horde::endBuffer()
             . '<div>&nbsp;'
             . Horde::img('loading.gif', '', array('style' => 'display:none;', 'id' => 'cloudloadingimg'))
             . '</div>' . $cloud->buildHTML()
index 5147452..b7ee3a6 100644 (file)
@@ -140,8 +140,10 @@ case 'sidebar':
 
         $renderer = new Horde_Form_Renderer();
         $renderer->setAttrColumnWidth('50%');
-        $contents = Horde_Util::bufferOutput(array($searchForm, 'renderActive'), $renderer, $vars, $sidebar_url->copy()->setRaw(true), 'post') .
-            '<br />';
+
+        Horde::startBuffer();
+        $searchForm->renderActive($renderer, $vars, $sidebar_url->copy()->setRaw(true), 'post');
+        $contents = Horde::endBuffer() . '<br />';
 
         $keywords = $vars->get('keyword');
         if (!empty($keywords)) {
index ea2d6c9..e0317a5 100644 (file)
@@ -81,7 +81,10 @@ foreach ($tasklist as $key => $ob) {
 $template->setOption('gettext', true);
 $template->set('tasks', $display_tasks, true);
 $template->set('logintasks_url', htmlspecialchars($tasks->getLoginTasksUrl()));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 $bodyId = 'services_logintasks';
 require HORDE_TEMPLATES . '/common-header.inc';
index 5d399f8..82218fe 100644 (file)
@@ -49,7 +49,10 @@ $form->addVariable(_("Comment"), 'comment', 'longtext', false, false, null, arra
 $template = $injector->createInstance('Horde_Template');
 $template->set('form', '');
 $template->set('menu', Hylax::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require HYLAX_TEMPLATES . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/compose/compose.html');
index da28c04..7d228e6 100644 (file)
@@ -94,7 +94,10 @@ if ($folder == 'archive') {
 $template->set('folder', $folder_list, true);
 $template->set('actions', $actions);
 $template->set('menu', Hylax::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require HYLAX_TEMPLATES . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/folder/folder.html');
index 049d068..b6a5d4a 100644 (file)
@@ -36,7 +36,9 @@ class Hylax_Image {
     function getDimensions()
     {
         $tmp_file = Horde_Util::getTempFile('fax', true, '/tmp');
-        Horde::logMessage('Created temp file:' . Horde_Util::bufferOutput('var_dump', $tmp_file) . ':', 'DEBUG');
+        Horde::startBuffer();
+        var_dump($tmp_file);
+        Horde::logMessage('Created temp file:' . Horde::endBuffer() . ':', 'DEBUG');
         $fp = fopen($tmp_file, 'w');
         fwrite($fp, $this->_data);
         fclose($fp);
index bb2f5af..7ea2b8d 100644 (file)
@@ -59,14 +59,20 @@ $pages = Hylax::getPages($fax_id, $fax['fax_pages']);
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
 $renderer = new Horde_Form_Renderer();
-$send_form = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'send.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'send.php', 'post');
+$send_form = Horde::endBuffer();
 
 /* Set up template. */
 $template = $injector->createInstance('Horde_Template');
 $template->set('form', $send_form);
 $template->set('pages', $pages);
 $template->set('menu', $menu->getMenu());
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require HYLAX_TEMPLATES . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/fax/fax.html');
index 7280537..ac4678e 100644 (file)
@@ -30,7 +30,10 @@ $template->set('out_faxes', $hylax->gateway->numFaxesOut());
 $template->set('inbox', $fmt_inbox, true);
 $template->set('outbox', $fmt_outbox, true);
 $template->set('menu', Hylax::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require HYLAX_TEMPLATES . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/summary/summary.html');
index eb9ac58..1619f22 100644 (file)
@@ -42,7 +42,10 @@ $template = $injector->createInstance('Horde_Template');
 $template->set('form', '');
 $template->set('pages', $pages);
 $template->set('menu', Hylax::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require HYLAX_TEMPLATES . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/fax/fax.html');
index 3894961..5eb8160 100644 (file)
@@ -695,10 +695,13 @@ $t->set('allow_compose', !$compose_disable);
 if ($redirect) {
     /* Prepare the redirect template. */
     $t->set('cacheid', $composeCacheID);
-    $t->set('status', Horde_Util::bufferOutput(array('IMP', 'status')));
     $t->set('title', htmlspecialchars($title));
     $t->set('token', Horde::getRequestToken('imp.compose'));
 
+    Horde::startBuffer();
+    IMP::status();
+    $t->set('status', Horde::endBuffer());
+
     if ($registry->hasMethod('contacts/search')) {
         $t->set('has_search', true);
         $t->set('abook', Horde::link('#', _("Address Book"), 'widget', null, 'window.open(\'' . Horde::applicationUrl('contacts.php')->add(array('formname' => 'redirect', 'to_only' => 1)) . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;') . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>');
@@ -1013,7 +1016,10 @@ if ($redirect) {
         }
     }
 
-    $t->set('status', Horde_Util::bufferOutput(array('IMP', 'status')));
+    Horde::startBuffer();
+    IMP::status();
+    $t->set('status', Horde::endBuffer());
+
     $template_output = $t->fetch(IMP_TEMPLATES . '/imp/compose/compose.html');
 }
 
index 8d7ee81..33c74e1 100644 (file)
@@ -39,7 +39,9 @@ class Horde_Block_imp_summary extends Horde_Block
         $html = '<table cellspacing="0" width="100%">';
 
         /* Quota info, if available. */
-        $quota_msg = Horde_Util::bufferOutput(array('IMP', 'quota'));
+        Horde::startBuffer();
+        IMP::quota();
+        $quota_msg = Horde::endBuffer();
         if (!empty($quota_msg)) {
             $html .= '<tr><td colspan="3">' . $quota_msg . '</td></tr>';
         }
@@ -56,8 +58,10 @@ class Horde_Block_imp_summary extends Horde_Block
         if (!empty($newmsgs) &&
             ($GLOBALS['prefs']->getValue('nav_audio') ||
              $GLOBALS['prefs']->getValue('nav_popup'))) {
-            $html .= Horde_Util::bufferOutput(IMP::newmailAlerts($newmsgs)) .
-                Horde_Util::bufferOutput(array($GLOBALS['notification'], 'notify'), array('listeners' => 'audio'));
+            Horde::startBuffer();
+            IMP::newmailAlerts($newmsgs);
+            $GLOBALS['notification']->notify(array('listeners' => 'audio'));
+            $html .= Horde::endBuffer();
         }
 
         return $html . $html_out . '</table>';
index 051ec7a..c2882a6 100644 (file)
@@ -119,9 +119,10 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
         if ($_SESSION['imp']['view'] != 'mimp') {
             $uid = 'htmldata_' . uniqid(mt_rand());
 
+            Horde::addScriptFile('imp.js', 'imp');
+
             $data['js'] = array('IMP.iframeInject("' . $uid . '", ' . Horde_Serialize::serialize($data['data'], Horde_Serialize::JSON, $this->_mimepart->getCharset()) . ')');
-            $data['data'] = '<DIV>' . _("Loading...") . '</DIV><IFRAME class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none"></IFRAME>' .
-                Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp');
+            $data['data'] = '<DIV>' . _("Loading...") . '</DIV><IFRAME class="htmlMsgData" id="' . $uid . '" src="javascript:false" frameborder="0" style="display:none"></IFRAME>';
             $data['type'] = 'text/html; charset=UTF-8';
         }
 
index f1fa266..29e73bc 100644 (file)
@@ -37,9 +37,12 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver
         $ret = $this->_renderInline(true);
         if (!empty($ret)) {
             reset($ret);
-            $ret[key($ret)]['data'] = Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
-                $ret[key($ret)]['data'] .
-                Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+            Horde::startBuffer();
+            include $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc';
+            echo $ret[key($ret)]['data'];
+            include $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
+
+            $ret[key($ret)]['data'] = Horde::endBuffer();
         }
         return $ret;
     }
index 28b7115..98fc481 100644 (file)
@@ -93,7 +93,10 @@ class IMP_Test extends Horde_Test
 
         $self_url = Horde::selfUrl()->add('app', 'imp');
 
-        return $ret . Horde_Util::bufferOutput('require', IMP_TEMPLATES . '/test/mailserver.inc');
+        Horde::startBuffer();
+        require IMP_TEMPLATES . '/test/mailserver.inc';
+
+        return $ret . Horde::endBuffer();
     }
 
     /**
index c63de4d..5c9fd5c 100644 (file)
@@ -245,7 +245,9 @@ case 'print_attach':
             $t->set('headers', $headers);
 
             if (!$browser->isBrowser('mozilla')) {
-                $t->set('css', Horde_Util::bufferOutput(array('Horde_Themes', 'includeStylesheetFiles')));
+                Horde::startBuffer();
+                Horde_Themes::includeStylesheetFiles();
+                $t->set('css', Horde::endBuffer());
                 echo $t->fetch(IMP_TEMPLATES . '/print/headers.html');
                 break;
             }
index 192855f..32ca38c 100644 (file)
@@ -33,9 +33,9 @@ class Horde_Block_turba_minisearch extends Horde_Block {
     {
         if ($GLOBALS['browser']->hasFeature('iframes')) {
             Horde::addScriptFile('prototype.js', 'horde');
-            return Horde_Util::bufferOutput(
-                'include',
-                TURBA_TEMPLATES . '/block/minisearch.inc');
+            Horde::startBuffer();
+            include TURBA_TEMPLATES . '/block/minisearch.inc';
+            return Horde::endBuffer();
         } else {
             return '<em>' . _("A browser that supports iframes is required")
                 . '</em>';
index ff11b82..0fe96ed 100644 (file)
@@ -91,7 +91,10 @@ class Turba_Test extends Horde_Test
 
         $self_url = Horde::selfUrl()->add('app', 'turba');
 
-        return $ret . Horde_Util::bufferOutput('require', TURBA_TEMPLATES . '/test/ldapserver.inc');
+        Horde::startBuffer();
+        require TURBA_TEMPLATES . '/test/ldapserver.inc';
+
+        return $ret . Horde::endBuffer();
     }
 
     /**
index 7a32e53..9cc507a 100644 (file)
@@ -60,7 +60,11 @@ class Turba_BrowsePageTest extends Turba_TestBase {
         $this->_pageParams['registry']->pushApp('turba', array('check_perms' => false));
         $this->fakeAuth();
         $page = new Turba_BrowsePage($this->_pageParams);
-        $this->_output = Horde_Util::bufferOutput(array($page, 'run'));
+
+        Horde::startBuffer();
+        $page->run();
+        $this->_output = Horde::endBuffer();
+
         if ($push_result) {
             $this->_pageParams['registry']->popApp();
         }
index 4460872..3e04f13 100644 (file)
@@ -61,7 +61,11 @@ class Turba_ViewBrowseTest extends Turba_TestBase {
         $this->_pageParams['registry']->pushApp('turba', array('check_perms' => false));
         $this->fakeAuth();
         $page = new Turba_View_Browse($this->_pageParams);
-        $this->_output = Horde_Util::bufferOutput(array($page, 'run'));
+
+        Horde::startBuffer();
+        $page->run();
+        $this->_output = Horde::endBuffer();
+
         if ($push_result) {
             $this->_pageParams['registry']->popApp();
         }
index 5c3196c..999f35f 100644 (file)
@@ -44,11 +44,17 @@ if ($vars->get('submitbutton') == _("Delete")) {
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
 $renderer = new Horde_Form_Renderer();
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'delete.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'delete.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index 5ebc5e7..36b7b22 100644 (file)
@@ -39,12 +39,18 @@ if ($form->validate($vars)) {
 
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
-$renderer = &new Horde_Form_Renderer();
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'edit.php', 'post');
+$renderer = new Horde_Form_Renderer();
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'edit.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index 7e8997a..5ace933 100644 (file)
@@ -36,7 +36,10 @@ foreach ($domains as $id => $domain) {
 /* Set up the template fields. */
 $template->set('domains', $domains, true);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 /* Set up the field list. */
 $images = array('delete' => Horde::img('delete.png', _("Delete Domain")),
index c45cf42..08720ec 100644 (file)
@@ -175,11 +175,17 @@ if ($vars->get('submitbutton') == _("Delete")) {
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
 $renderer = &new Horde_Form_Renderer();
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'delete.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'delete.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index 4ce6fd9..03056c9 100644 (file)
@@ -100,11 +100,16 @@ if ($form->validate($vars)) {
 require_once 'Horde/Form/Renderer.php';
 $renderer = &new Horde_Form_Renderer();
 
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'edit.php', 'post');
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'edit.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index e6adccd..784e7fa 100644 (file)
@@ -104,11 +104,16 @@ if (!$vars->exists('mode') || $vars->getExists('retry')) {
 require_once 'Horde/Form/Renderer.php';
 $renderer = &new Horde_Form_Renderer();
 
-$main = Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'editAlias.php', 'post');
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'editAlias.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index c804072..57afa23 100644 (file)
@@ -101,11 +101,16 @@ if (!$vars->exists('mode') || $vars->getExists('retry')) {
 require_once 'Horde/Form/Renderer.php';
 $renderer = &new Horde_Form_Renderer();
 
-$main = Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'editForward.php', 'post');
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'editForward.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index 53181eb..dde6d1d 100644 (file)
@@ -126,7 +126,11 @@ $template->set('addresses', $addresses, true);
 $template->set('maxusers', $maxusers, true);
 $template->set('menu', Vilma::getMenu('string'));
 $template->set('tabs', $tabs->render());
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
+
 $template->set('pager', $pager->render());
 
 /* Set up the field list. */
index 79482bb..0634ff5 100644 (file)
@@ -56,11 +56,17 @@ if ($vars->get('submitbutton') == _("Delete")) {
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
 $renderer = &new Horde_Form_Renderer();
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'delete.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'delete.php', 'post');
+$main = Horde::endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index 26e951d..5495081 100644 (file)
@@ -83,11 +83,17 @@ if ($form->validate($vars)) {
 /* Render the form. */
 require_once 'Horde/Form/Renderer.php';
 $renderer = new Horde_Form_Renderer();
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'edit.php', 'post');
+
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'edit.php', 'post');
+$main = Horde:endBuffer();
 
 $template->set('main', $main);
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require VILMA_TEMPLATES . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
index f06caa1..a3b635b 100644 (file)
@@ -55,7 +55,10 @@ $images = array('delete' => Horde::img('delete.png', _("Delete User")),
 $template->set('images', $images);
 
 $template->set('menu', Vilma::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+Horde::startBuffer();
+$notification->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 /* Render the page. */
 require VILMA_TEMPLATES . '/common-header.inc';
index 12f3e3b..0ce899e 100644 (file)
@@ -39,7 +39,9 @@ class Horde_Block_Whups_myqueries extends Horde_Block {
         $myqueries = Whups_View::factory('SavedQueries',
                                          array('results' => $queries));
 
-        $html = Horde_Util::bufferOutput(array($myqueries, 'html'), false);
+        Horde::startBuffer();
+        $myqueries->html(false);
+        $html = Horde::endBuffer();
         if ($html) {
             return $html;
         }
index c2665dd..1e625ca 100644 (file)
@@ -306,7 +306,9 @@ class SyncPages extends Page {
             }
         }
 
-        return Horde_Util::bufferOutput(array($form, 'renderActive'), null, null, null, 'get');
+        Horde::startBuffer();
+        $form->renderActive(null, null, null, 'get');
+        return Horde::endBuffer();
     }
 
     /**