From cf9deddd51a113bbde23e9d2027906a73d5237d4 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 4 May 2010 10:25:23 -0400 Subject: [PATCH] Jonah: Util::bufferOutput() -> Horde::startBuffer() See http://wiki.horde.org/Doc/Dev/BufferH4 --- jonah/channels/aggregate.php | 10 ++++++++-- jonah/channels/delete.php | 13 +++++++++++-- jonah/channels/edit.php | 10 ++++++++-- jonah/channels/index.php | 6 +++++- jonah/delivery/html.php | 6 +++++- jonah/feed.php | 6 +++++- jonah/stories/delete.php | 12 ++++++++++-- jonah/stories/edit.php | 12 ++++++++++-- jonah/stories/index.php | 6 +++++- jonah/stories/results.php | 6 +++++- jonah/stories/share.php | 11 +++++++++-- jonah/stories/view.php | 6 +++++- 12 files changed, 86 insertions(+), 18 deletions(-) diff --git a/jonah/channels/aggregate.php b/jonah/channels/aggregate.php index 4cd9811a5..a6468a24a 100644 --- a/jonah/channels/aggregate.php +++ b/jonah/channels/aggregate.php @@ -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'); diff --git a/jonah/channels/delete.php b/jonah/channels/delete.php index d24868e95..854e19e9d 100644 --- a/jonah/channels/delete.php +++ b/jonah/channels/delete.php @@ -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'); diff --git a/jonah/channels/edit.php b/jonah/channels/edit.php index d39b69419..9b2560237 100644 --- a/jonah/channels/edit.php +++ b/jonah/channels/edit.php @@ -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'; diff --git a/jonah/channels/index.php b/jonah/channels/index.php index 7f8552062..eeefe1d71 100644 --- a/jonah/channels/index.php +++ b/jonah/channels/index.php @@ -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); diff --git a/jonah/delivery/html.php b/jonah/delivery/html.php index ed8133c2b..6f6f3d106 100644 --- a/jonah/delivery/html.php +++ b/jonah/delivery/html.php @@ -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'); diff --git a/jonah/feed.php b/jonah/feed.php index 382433dc3..2d7fb21e4 100644 --- a/jonah/feed.php +++ b/jonah/feed.php @@ -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'); diff --git a/jonah/stories/delete.php b/jonah/stories/delete.php index 8a7d038dd..0a1330f8e 100644 --- a/jonah/stories/delete.php +++ b/jonah/stories/delete.php @@ -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'); diff --git a/jonah/stories/edit.php b/jonah/stories/edit.php index 3539c6c5b..e2805383a 100644 --- a/jonah/stories/edit.php +++ b/jonah/stories/edit.php @@ -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'; diff --git a/jonah/stories/index.php b/jonah/stories/index.php index ddd774594..fb3409c96 100644 --- a/jonah/stories/index.php +++ b/jonah/stories/index.php @@ -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'; diff --git a/jonah/stories/results.php b/jonah/stories/results.php index b52784517..b4c5398d7 100644 --- a/jonah/stories/results.php +++ b/jonah/stories/results.php @@ -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'); diff --git a/jonah/stories/share.php b/jonah/stories/share.php index 4549f297f..47924bc3a 100644 --- a/jonah/stories/share.php +++ b/jonah/stories/share.php @@ -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'); diff --git a/jonah/stories/view.php b/jonah/stories/view.php index 74a0ec53c..c2546c4f4 100644 --- a/jonah/stories/view.php +++ b/jonah/stories/view.php @@ -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'); -- 2.11.0