use Horde::startBuffer() Horde::endBuffer()
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 May 2010 00:05:39 +0000 (20:05 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 31 May 2010 00:05:39 +0000 (20:05 -0400)
15 files changed:
ansel/lib/Ajax/Imple/EditFaces.php
ansel/lib/Tile/DateGallery.php
ansel/lib/Tile/Gallery.php
ansel/lib/Tile/Image.php
ansel/lib/View/GalleryRenderer/Gallery.php
ansel/lib/View/GalleryRenderer/GalleryLightbox.php
ansel/lib/View/Image.php
ansel/lib/View/List.php
ansel/lib/View/Results.php
ansel/lib/View/Slideshow.php
ansel/lib/Widget/Actions.php
ansel/lib/Widget/ImageFaces.php
ansel/lib/Widget/OtherGalleries.php
ansel/lib/Widget/Tags.php
ansel/rss.php

index 1b43f30..5f59bbf 100644 (file)
@@ -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 {
index 094a9fb..16baccc 100644 (file)
@@ -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();
     }
 
 }
index dd5ae87..e32e653 100644 (file)
@@ -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();
     }
 
 }
index 3b133a6..2abe5ea 100644 (file)
@@ -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();
     }
 
 }
index d2c1a76..feb47d5 100644 (file)
@@ -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();
     }
 
 }
index 1dad99e..9851ad7 100644 (file)
@@ -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();
     }
 
 }
index 7cdbdd8..dc509d0 100644 (file)
@@ -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();
     }
 
     /**
index 02b794e..56d6ff9 100644 (file)
@@ -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 '';
     }
 
index 5fb18d6..13426ed 100644 (file)
@@ -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()
index 161050f..f6e1833 100644 (file)
@@ -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()
index 7beaf7e..e8c7782 100644 (file)
@@ -104,10 +104,10 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
         $html = '<div style="display:' . (($GLOBALS['prefs']->getValue('show_actions')) ? 'block' : 'none') . ';" id="gallery-actions">';
 
         /* Attach the ajax action */
-        ob_start();
+        Horde::startBuffer();
         $imple = Horde_Ajax_Imple::factory(array('ansel', 'ToggleGalleryActions'), array('bindTo' => 'gallery-actions'));
         $imple->attach();
-        $html .= ob_get_clean();
+        $html .= Horde::endBuffer();
 
         /* Buid the url parameters to the zip link */
         $view_params = array(
index 6187f92..ce20946 100644 (file)
@@ -71,7 +71,7 @@ class Ansel_Widget_ImageFaces extends Ansel_Widget_Base
                     . _("Manual face selection") . '</a>';
 
             // Attach the ajax edit actions
-            ob_start();
+            Horde::startBuffer();
             $imple = Horde_Ajax_Imple::factory(
                 array('ansel', 'EditFaces'),
                 array('image_id' => $this->_view->resource->id,
@@ -79,7 +79,7 @@ class Ansel_Widget_ImageFaces extends Ansel_Widget_Base
                       'selfUrl' => $this->_params['selfUrl']));
 
             $imple->attach();
-            $html .= ob_get_clean();
+            $html .= Horde::endBuffer();
         }
 
         // Build the main content area of the widget
index f75eab9..088e8eb 100644 (file)
@@ -97,13 +97,13 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
                            ($gal->id == $this->_view->gallery->id),
                            array('icon' => $img, 'icondir' => '', 'url' => $link));
         }
-        ob_start();
+        Horde::startBuffer();
         $imple = Horde_Ajax_Imple::factory(array('ansel', 'ToggleOtherGalleries'), array('bindTo' => 'othergalleries'));
         $imple->attach();
 
         $tree->sort('label');
         $tree->renderTree();
-        $html .= ob_get_clean();
+        $html .= Horde::endBuffer();
         $html .= '</div>';
         $selfurl = Horde::selfUrl(true, true);
         $html .=  '<div class="control"><a href="'
index dead767..0fdb65a 100644 (file)
@@ -34,14 +34,14 @@ class Ansel_Widget_Tags extends Ansel_Widget_Base
         $html = $this->_htmlBegin();
         $html .= '<div id="tags">' . $this->_getTagHTML() . '</div>';
         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,
index 1f95e4e..c087895 100644 (file)
@@ -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);