From: Michael J. Rubinsky Date: Mon, 31 May 2010 00:05:39 +0000 (-0400) Subject: use Horde::startBuffer() Horde::endBuffer() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f8cfcdf67172db5433a4a587b05e9d2fad8ca0db;p=horde.git use Horde::startBuffer() Horde::endBuffer() --- diff --git a/ansel/lib/Ajax/Imple/EditFaces.php b/ansel/lib/Ajax/Imple/EditFaces.php index 1b43f309d..5f59bbf60 100644 --- a/ansel/lib/Ajax/Imple/EditFaces.php +++ b/ansel/lib/Ajax/Imple/EditFaces.php @@ -57,9 +57,9 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base $imgdir = Horde_Themes::img(null, 'horde'); $customurl = Horde::applicationUrl('faces/custom.php'); $url = (!empty($args['url']) ? urldecode($args['url']) : ''); - ob_start(); + Horde::startBuffer(); require_once ANSEL_TEMPLATES . '/faces/image.inc'; - $html = ob_get_clean(); + $html = Horde::endBuffer(); return array('response' => 1, 'message' => $html); } else { diff --git a/ansel/lib/Tile/DateGallery.php b/ansel/lib/Tile/DateGallery.php index 094a9fb0d..16baccc4d 100644 --- a/ansel/lib/Tile/DateGallery.php +++ b/ansel/lib/Tile/DateGallery.php @@ -113,9 +113,9 @@ class Ansel_Tile_DateGallery { /* Background color is needed if displaying a mini tile */ $background_color = $style['background']; - ob_start(); + Horde::startBuffer(); include ANSEL_TEMPLATES . '/tile/dategallery' . ($mini ? 'mini' : '') . '.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } } diff --git a/ansel/lib/Tile/Gallery.php b/ansel/lib/Tile/Gallery.php index dd5ae87a1..e32e65312 100644 --- a/ansel/lib/Tile/Gallery.php +++ b/ansel/lib/Tile/Gallery.php @@ -120,9 +120,9 @@ class Ansel_Tile_Gallery { $modified = _("Modified") . ' ' . strftime($date_format, (int)$gallery->get('last_modified')); - ob_start(); + Horde::startBuffer(); include ANSEL_TEMPLATES . '/tile/gallery' . ($mini ? 'mini' : '') . '.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } } diff --git a/ansel/lib/Tile/Image.php b/ansel/lib/Tile/Image.php index 3b133a698..2abe5eaeb 100644 --- a/ansel/lib/Tile/Image.php +++ b/ansel/lib/Tile/Image.php @@ -111,7 +111,7 @@ class Ansel_Tile_Image { $title = $image->filename; } - ob_start(); + Horde::startBuffer(); // In-line caption editing if we have Horde_Perms::EDIT if ($option_edit) { $imple = Horde_Ajax_Imple::factory(array('ansel', 'EditCaption'), @@ -119,9 +119,9 @@ class Ansel_Tile_Image { 'domid' => $image->id . 'caption')); $imple->attach(); } - + include ANSEL_BASE . '/templates/tile/image.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } } diff --git a/ansel/lib/View/GalleryRenderer/Gallery.php b/ansel/lib/View/GalleryRenderer/Gallery.php index d2c1a76bb..feb47d5e9 100644 --- a/ansel/lib/View/GalleryRenderer/Gallery.php +++ b/ansel/lib/View/GalleryRenderer/Gallery.php @@ -93,7 +93,8 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base // Note that we can't use Horde_Util::bufferOutput() here since the // include file would be included inside that method's scope, and not // this one. - ob_start(); + //ob_start(); + Horde::startBuffer(); if (!empty($this->view->api)) { $includes = $GLOBALS['injector']->createInstance('Horde_Script_Files'); $includes->add('prototype.js', 'horde', true, true); @@ -123,7 +124,7 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base } Horde::addScriptFile('popup.js', 'horde'); include ANSEL_TEMPLATES . '/view/gallery.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } } diff --git a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php index 1dad99e4e..9851ad7f5 100644 --- a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php +++ b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php @@ -115,10 +115,7 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende 'url_callback' => $callback); $pager = new Horde_Ui_Pager('page', $vars, $params); - - /* Start buffering */ - ob_start(); - + Horde::startBuffer(); /* Create the js variables to pass to the lightbox script */ $jsvars = array('graphics_dir' => Horde::applicationUrl(Horde_Themes::img(), true, -1), 'image_text' => _("Photo"), @@ -147,7 +144,8 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende $count = 0; include ANSEL_TEMPLATES . '/view/gallerylightbox.inc'; - return ob_get_clean(); + + return Horde::endBuffer(); } } diff --git a/ansel/lib/View/Image.php b/ansel/lib/View/Image.php index 7cdbdd8a3..dc509d0fc 100644 --- a/ansel/lib/View/Image.php +++ b/ansel/lib/View/Image.php @@ -344,7 +344,7 @@ class Ansel_View_Image extends Ansel_View_Base } /* Buffer the template file and return the html */ - ob_start(); + Horde::startBuffer(); //@TODO: Refactor styles to allow dynamic inclusion/exclusion of widgets. /* These items currently don't work when viewing through the api */ @@ -387,7 +387,7 @@ class Ansel_View_Image extends Ansel_View_Base } require ANSEL_TEMPLATES . '/view/image.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } /** diff --git a/ansel/lib/View/List.php b/ansel/lib/View/List.php index 02b794e8c..56d6ff94a 100644 --- a/ansel/lib/View/List.php +++ b/ansel/lib/View/List.php @@ -253,11 +253,13 @@ class Ansel_View_List extends Ansel_View_Base $count = 0; $width = round(100 / $prefs->getValue('tilesperrow')); - ob_start(); + Horde::startBuffer(); include ANSEL_TEMPLATES . '/view/list.inc'; - $html = ob_get_clean(); + $html = Horde::endBuffer(); + return $html; } + return ''; } diff --git a/ansel/lib/View/Results.php b/ansel/lib/View/Results.php index 5fb18d680..13426ed67 100644 --- a/ansel/lib/View/Results.php +++ b/ansel/lib/View/Results.php @@ -256,9 +256,9 @@ class Ansel_View_Results extends Ansel_View_Base $this->_pager = new Horde_Ui_Pager('page', $vars, array('num' => $total, 'url' => $viewurl, 'perpage' => $this->_perPage)); - ob_start(); + Horde::startBuffer(); include ANSEL_TEMPLATES . '/view/results.inc'; - return ob_get_clean(); + return Horde::endBuffer(); } public function viewType() diff --git a/ansel/lib/View/Slideshow.php b/ansel/lib/View/Slideshow.php index 161050fa4..f6e183372 100644 --- a/ansel/lib/View/Slideshow.php +++ b/ansel/lib/View/Slideshow.php @@ -22,10 +22,9 @@ class Ansel_View_Slideshow extends Ansel_View_Image { global $registry, $prefs; $imageIndex = $this->_revList[$this->resource->id]; - ob_start(); + Horde::startBuffer(); require ANSEL_TEMPLATES . '/view/slideshow.inc'; - return ob_get_clean(); - + return Horde::endBuffer(); } public function viewType() diff --git a/ansel/lib/Widget/Actions.php b/ansel/lib/Widget/Actions.php index 7beaf7edf..e8c77829e 100644 --- a/ansel/lib/Widget/Actions.php +++ b/ansel/lib/Widget/Actions.php @@ -104,10 +104,10 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base $html = ''; $selfurl = Horde::selfUrl(true, true); $html .= '
' . $this->_getTagHTML() . '
'; if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) { - ob_start(); + Horde::startBuffer(); /* Attach the Ajax action */ $imple = Horde_Ajax_Imple::factory(array('ansel', 'TagActions'), array('bindTo' => array('add' => 'tagbutton'), 'gallery' => $this->_view->gallery->id, 'image' => $image_id)); $imple->attach(); - $html .= ob_get_clean(); + $html .= Horde::endBuffer(); $actionUrl = Horde_Util::addParameter('image.php', array('image' => $this->_view->resource->id, diff --git a/ansel/rss.php b/ansel/rss.php index 1f95e4e88..c087895b1 100644 --- a/ansel/rss.php +++ b/ansel/rss.php @@ -285,9 +285,9 @@ if (empty($rss)) { $stream_rss2 = Horde_Util::addParameter(Horde::applicationUrl('rss.php', true, -1), $getparams); $images = $imgs; - ob_start(); + Horde::startBuffer(); include ANSEL_TEMPLATES . '/rss/' . $type . '.inc'; - $rss = ob_get_clean(); + $rss = Horde::endBuffer(); if ($conf['ansel_cache']['usecache']) { $GLOBALS['injector']->getInstance('Horde_Cache')->set($cache_key, $rss);