Fix trying to access protected members, add a getter for Ansel_View parameters
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 11 Nov 2009 21:33:36 +0000 (16:33 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 11 Nov 2009 21:33:36 +0000 (16:33 -0500)
ansel/lib/View/Base.php
ansel/templates/view/gallery.inc
ansel/templates/view/gallerylightbox.inc

index 9d50aeb..9eb8bb8 100644 (file)
@@ -227,6 +227,16 @@ abstract class Ansel_View_Base
     }
 
     /**
+     * Getter for the view parameters.
+     *
+     * @return unknown_type
+     */
+    public function getParams()
+    {
+        return $this->_params;
+    }
+
+    /**
      * @abstract
      * @return unknown_type
      */
index 4a00969..ce6a38b 100644 (file)
@@ -1,4 +1,4 @@
-<?php if (empty($this->view->_params['api'])): ?>
+<?php if (empty($this->view->api)): ?>
 <script type="text/javascript">
 var loading;
 
@@ -121,9 +121,9 @@ function downloadSelected()
     <input type="hidden" name="actionID" value="" />
     <input type="hidden" name="gallery" value="<?php echo htmlspecialchars($this->galleryId) ?>" />
     <input type="hidden" name="page" value="<?php echo htmlspecialchars($this->page) ?>" />
-    <input type="hidden" name="year" value="<?php echo (empty($this->view->_params['year']) ? 0 : $this->view->_params['year']) ?>" />
-    <input type="hidden" name="month" value="<?php echo (empty($this->view->_params['month']) ? 0 : $this->view->_params['month']) ?>" />
-    <input type="hidden" name="day" value="<?php echo (empty($this->view->_params['day']) ? 0 : $this->view->_params['day']) ?>" />
+    <input type="hidden" name="year" value="<?php echo (empty($this->view->year) ? 0 : $this->view->year) ?>" />
+    <input type="hidden" name="month" value="<?php echo (empty($this->view->month) ? 0 : $this->view->month) ?>" />
+    <input type="hidden" name="day" value="<?php echo (empty($this->view->day) ? 0 : $this->view->day) ?>" />
 
     <?php endif; ?>
     <?php if (!empty($option_select) && $this->numTiles): ?>
@@ -148,7 +148,7 @@ function downloadSelected()
           <?php
           foreach ($this->children as $child) {
               echo '<td width="' . $cellwidth . '%" class="ansel-tile">'
-                  . $child->getTile($this->view->gallery, $this->style['name'], false, $this->view->_params) . '</td>';
+                  . $child->getTile($this->view->gallery, $this->style['name'], false, $this->view->getParams()) . '</td>';
               if (!(++$count % $tilesperrow)) {
                 echo '</tr><tr>';
               }
index 1e6e35d..1f48e34 100644 (file)
@@ -1,4 +1,4 @@
-<?php if (empty($this->view->_params['api'])): ?>
+<?php if (empty($this->view->api)): ?>
 <script type="text/javascript">
 var loading;
 
@@ -138,9 +138,9 @@ function downloadSelected()
     <input type="hidden" name="actionID" value="" />
     <input type="hidden" name="gallery" value="<?php echo $this->galleryId ?>" />
     <input type="hidden" name="page" value="<?php echo htmlspecialchars($this->page) ?>" />
-    <input type="hidden" name="year" value="<?php echo (empty($this->view->_params['year']) ? 0 : $this->view->_params['year']) ?>" />
-    <input type="hidden" name="month" value="<?php echo (empty($this->view->_params['month']) ? 0 : $this->view->_params['month']) ?>" />
-    <input type="hidden" name="day" value="<?php echo (empty($this->view->_params['day']) ? 0 : $this->view->_params['day']) ?>" />
+    <input type="hidden" name="year" value="<?php echo (empty($this->view->year) ? 0 : $this->view->year) ?>" />
+    <input type="hidden" name="month" value="<?php echo (empty($this->view->month) ? 0 : $this->view->month) ?>" />
+    <input type="hidden" name="day" value="<?php echo (empty($this->view->day) ? 0 : $this->view->day) ?>" />
     <?php endif; ?>
     <?php if (!empty($option_select) && $this->numTiles): ?>
         <table class="anselActions" cellspacing="0" width="100%"><tr><td>
@@ -176,7 +176,7 @@ function downloadSelected()
        <?php
        foreach ($this->children as $child) {
            echo '<td width="' . $cellwidth . '%" class="ansel-tile">'
-               . $child->getTile($this->view->gallery, $this->style['name'], false, $this->view->_params) . '</td>';
+               . $child->getTile($this->view->gallery, $this->style['name'], false, $this->view->getParams()) . '</td>';
            if (!(++$count % $tilesperrow)) {
                 echo '</tr><tr>';
            }