From ace4fa3d7de342930641ae9da807abefe49c5284 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sat, 21 Aug 2010 22:11:09 -0400 Subject: [PATCH] CS, whitespace, remove some references, add a type hint or two --- ansel/lib/Gallery.php | 1 - ansel/lib/GalleryMode/Normal.php | 2 -- ansel/lib/View/Base.php | 24 ++++++++++++---------- ansel/lib/View/Gallery.php | 16 +++++++-------- ansel/lib/View/GalleryRenderer/Base.php | 4 +--- ansel/lib/View/GalleryRenderer/GalleryLightbox.php | 1 - 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index dda5f0d74..5d278aa0b 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -471,7 +471,6 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical return $this->_modeHelper->getGalleryChildren($perm, $from, $to, $noauto); } - /** * Return the count of this gallery's children * diff --git a/ansel/lib/GalleryMode/Normal.php b/ansel/lib/GalleryMode/Normal.php index f2fe95f31..6d414447d 100644 --- a/ansel/lib/GalleryMode/Normal.php +++ b/ansel/lib/GalleryMode/Normal.php @@ -11,7 +11,6 @@ * @author Michael J. Rubinsky * @package Ansel */ - class Ansel_GalleryMode_Normal extends Ansel_GalleryMode_Base { /** @@ -309,5 +308,4 @@ class Ansel_GalleryMode_Normal extends Ansel_GalleryMode_Base return $this->_gallery->data['attribute_images']; } - } diff --git a/ansel/lib/View/Base.php b/ansel/lib/View/Base.php index 93da194c3..d749bae31 100644 --- a/ansel/lib/View/Base.php +++ b/ansel/lib/View/Base.php @@ -121,7 +121,7 @@ abstract class Ansel_View_Base } /** - * + * Todo * * @param integer $galleryId The gallery id * @param string $slug The gallery slug @@ -217,10 +217,10 @@ abstract class Ansel_View_Base * * @param array $params An array of parameters for this method: *
-     *      images -     Array of Ansel_Images to generate JSON for [null]
-     *      full   -     Should a full URL be generated? [false]
-     *      from   -     Starting image count [0]
-     *      count  -     The number of images to include (starting at from) [0]
+     *      images     - Array of Ansel_Images to generate JSON for [null]
+     *      full       - Should a full URL be generated? [false]
+     *      from       - Starting image count [0]
+     *      count      - The number of images to include (starting at from) [0]
      *      image_view - The type of ImageGenerator to obtain the src url for. [screen]
      *      view_links - Should the JSON include links to the Image and/or Gallery View? [false]
      *      perpage    - Number of images per page [from user prefs]
@@ -232,12 +232,14 @@ abstract class Ansel_View_Base
     {
         global $conf, $prefs;
 
-        $default = array('full' => false,
-                         'from' => 0,
-                         'count' => 0,
-                         'image_view' => 'screen',
-                         'view_links' => false,
-                         'perpage' => $prefs->getValue('tilesperpage', $conf['thumbnail']['perpage']));
+        $default = array(
+            'full' => false,
+            'from' => 0,
+            'count' => 0,
+            'image_view' => 'screen',
+            'view_links' => false,
+            'perpage' => $prefs->getValue('tilesperpage', $conf['thumbnail']['perpage']),
+        );
 
         $params = array_merge($default, $params);
 
diff --git a/ansel/lib/View/Gallery.php b/ansel/lib/View/Gallery.php
index cdba189c7..8bc89aef2 100644
--- a/ansel/lib/View/Gallery.php
+++ b/ansel/lib/View/Gallery.php
@@ -55,7 +55,6 @@ class Ansel_View_Gallery extends Ansel_View_Base
                                    true);
 
             $params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
-
             Horde::applicationUrl('disclamer.php')->add($params)->setRaw(true)->redirect();
             exit;
         }
@@ -70,12 +69,12 @@ class Ansel_View_Gallery extends Ansel_View_Base
                       'day' => isset($this->_params['day']) ? $this->_params['day'] : 0));
 
                 $galleryurl = Ansel::getUrlFor('view', array_merge(
-                                   array('gallery' => $this->gallery->id,
-                                         'slug' => empty($params['slug']) ? '' : $params['slug'],
-                                         'page' => empty($params['page']) ? 0 : $params['page'],
-                                         'view' => 'Gallery'),
-                                   $date),
-                                   true);
+                    array('gallery' => $this->gallery->id,
+                          'slug' => empty($params['slug']) ? '' : $params['slug'],
+                          'page' => empty($params['page']) ? 0 : $params['page'],
+                          'view' => 'Gallery'),
+                    $date),
+                    true);
 
             $params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
             Horde::applicationUrl('protect.php')->add($params)->setRaw(true)->redirect();
@@ -89,7 +88,7 @@ class Ansel_View_Gallery extends Ansel_View_Base
         // Since this is a gallery view, the resource is just a reference to the
         // gallery. We keep both instance variables becuase both gallery and
         // image views are assumed to have a gallery object.
-        $this->resource = &$this->gallery;
+        $this->resource = $this->gallery;
 
         /* Do we have an explicit style set? If not, use the gallery's */
         if (!empty($this->_params['style'])) {
@@ -139,5 +138,4 @@ class Ansel_View_Gallery extends Ansel_View_Base
     {
         return 'Gallery';
     }
-
 }
diff --git a/ansel/lib/View/GalleryRenderer/Base.php b/ansel/lib/View/GalleryRenderer/Base.php
index 744a70751..2e98d871d 100644
--- a/ansel/lib/View/GalleryRenderer/Base.php
+++ b/ansel/lib/View/GalleryRenderer/Base.php
@@ -104,10 +104,8 @@ abstract class Ansel_View_GalleryRenderer_Base
      * Constructor
      *
      * @param Ansel_View_Gallery  The view object for this renderer.
-     *
-     * @return Ansel_View_Renderer_Gallery
      */
-    public function __construct($view)
+    public function __construct(Ansel_View_Gallery $view)
     {
         $this->view = $view;
     }
diff --git a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php
index 7e19e40f1..79c179bb7 100644
--- a/ansel/lib/View/GalleryRenderer/GalleryLightbox.php
+++ b/ansel/lib/View/GalleryRenderer/GalleryLightbox.php
@@ -145,5 +145,4 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende
 
         return Horde::endBuffer();
     }
-
 }
-- 
2.11.0