Jonah: Util::bufferOutput() -> Horde::startBuffer()
authorBen Klang <ben@alkaloid.net>
Tue, 4 May 2010 14:25:23 +0000 (10:25 -0400)
committerBen Klang <ben@alkaloid.net>
Tue, 4 May 2010 14:36:31 +0000 (10:36 -0400)
See http://wiki.horde.org/Doc/Dev/BufferH4

12 files changed:
jonah/channels/aggregate.php
jonah/channels/delete.php
jonah/channels/edit.php
jonah/channels/index.php
jonah/delivery/html.php
jonah/feed.php
jonah/stories/delete.php
jonah/stories/edit.php
jonah/stories/index.php
jonah/stories/results.php
jonah/stories/share.php
jonah/stories/view.php

index 4cd9811..a6468a2 100644 (file)
@@ -135,12 +135,18 @@ foreach ($ids as $id) {
     $form->insertVariableBefore('channel_name', '', 'subchannel' . $id, 'link', false, false, null, array(_getLinks($channel_id, $id, $name, $url)));
 }
 
-$main = Horde_Util::bufferOutput(array($form, 'renderActive'), $renderer, $vars, 'aggregate.php', 'post');
+Horde::startBuffer();
+$form->renderActive($renderer, $vars, 'aggregate.php', 'post');
+$main = Horde::endBuffer();
 
 $template = new Horde_Template();
 $template->set('main', $main);
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/main/main.html');
index d24868e..854e19e 100644 (file)
@@ -79,9 +79,18 @@ if ($form_submit == _("Delete")) {
 }
 
 $template = new Horde_Template();
-$template->set('main', Horde_Util::bufferOutput(array($form, 'renderActive'), new Horde_Form_Renderer(), $vars, 'delete.php', 'post'));
+
+// Buffer the main form and send to the template
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'delete.php', 'post');
+$template->set('main', Horde::endBuffer());
+
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/main/main.html');
index d39b694..9b25602 100644 (file)
@@ -78,12 +78,18 @@ if ($formname && !$changed_type) {
 }
 
 $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 = new Horde_Template();
 $template->set('main', $main);
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 $title = $form->getTitle();
 require JONAH_TEMPLATES . '/common-header.inc';
index 7f85520..eeefe1d 100644 (file)
@@ -87,7 +87,11 @@ $template->set('listheaders', array(array('attrs' => ' class="sortdown"', 'label
 $template->set('channels', $channels, true);
 $template->set('menu', Jonah::getMenu('string'));
 $template->set('search_img', Horde_Themes::img('search.png'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 $title = _("Feeds");
 Horde::addScriptFile('prototype.js', 'horde', true);
index ed8133c..6f6f3d1 100644 (file)
@@ -62,7 +62,11 @@ $template->set('format', $criteria['channel_format']);
 $template->set('options', $options);
 $template->set('stories', $news->renderChannel($criteria['channel_id'], $criteria['channel_format']));
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/delivery/html.html');
index 382433d..2d7fb21 100644 (file)
@@ -54,7 +54,11 @@ $template->set('format', $criteria['channel_format']);
 $template->set('options', $options);
 $template->set('stories', $news->renderChannel($criteria['channel_id'], $criteria['channel_format']));
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/delivery/html.html');
index 8a7d038..0a1330f 100644 (file)
@@ -86,9 +86,17 @@ if ($form_submit == _("Delete")) {
 }
 
 $template = new Horde_Template();
-$template->set('main', Horde_Util::bufferOutput(array($form, 'renderActive'), new Horde_Form_Renderer(), $vars, 'delete.php', 'post'));
+
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'delete.php', 'post');
+$template->set('main', Horde::endBuffer());
+
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/main/main.html');
index 3539c6c..e280538 100644 (file)
@@ -69,9 +69,17 @@ Horde::addScriptFile('open_calendar.js', 'horde');
 
 /* Render the form. */
 $template = new Horde_Template();
-$template->set('main', Horde_Util::bufferOutput(array($form, 'renderActive'), $form->getRenderer(), $vars, 'edit.php', 'post'));
+
+Horde::startBuffer();
+$form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
+$template->set('main', Horde::endBuffer());
+
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 $title = $form->getTitle();
 require JONAH_TEMPLATES . '/common-header.inc';
index ddd7745..fb3409c 100644 (file)
@@ -124,7 +124,11 @@ $template->set('stories', $stories, true);
 $template->set('read', $channel['channel_type'] == JONAH_INTERNAL_CHANNEL || $channel['channel_type'] == JONAH_COMPOSITE_CHANNEL, true);
 $template->set('comments', $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages') && $channel['channel_type'] == JONAH_INTERNAL_CHANNEL, true);
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 $title = $channel['channel_name'];
 require JONAH_TEMPLATES . '/common-header.inc';
index b527845..b4c5398 100644 (file)
@@ -116,7 +116,11 @@ $template->set('stories', $stories, true);
 $template->set('read', true, true);
 $template->set('comments', $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages'), true);
 $template->set('menu', Jonah::getMenu('string'));
-$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/stories/index.html');
index 4549f29..47924bc 100644 (file)
@@ -124,8 +124,15 @@ if ($form->validate($vars)) {
 }
 
 $share_template = new Horde_Template();
-$share_template->set('main', Horde_Util::bufferOutput(array($form, 'renderActive'), new Horde_Form_Renderer(), $vars, 'share.php', 'post'));
-$share_template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the form and notifications and send to the template
+Horde::startBuffer();
+$form->renderActive(null, $vars, 'share.php', 'post');
+$share_template->set('main', Horde::endBuffer());
+
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $share_template->fetch(JONAH_TEMPLATES . '/stories/share.html');
index 74a0ec5..c2546c4 100644 (file)
@@ -106,7 +106,11 @@ if ($conf['comments']['allow']) {
 }
 
 $view_template->set('menu', Jonah::getMenu('string'));
-$view_template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+
+// Buffer the notifications and send to the template
+Horde::startBuffer();
+$GLOBALS['notification']->notify(array('listeners' => 'status'));
+$template->set('notify', Horde::endBuffer());
 
 require JONAH_TEMPLATES . '/common-header.inc';
 echo $view_template->fetch(JONAH_TEMPLATES . '/stories/view.html');