remove an pitifully small amount of TODOs
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 18 Feb 2010 01:52:11 +0000 (20:52 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 18 Feb 2010 01:52:11 +0000 (20:52 -0500)
15 files changed:
ansel/edit_dates.php
ansel/lib/Ajax/Imple/LocationAutoCompleter.php
ansel/lib/Faces/Base.php
ansel/lib/Gallery.php
ansel/lib/Storage.php
ansel/lib/Tile/DateGallery.php
ansel/lib/View/GalleryRenderer/Base.php
ansel/lib/Widget/Actions.php
ansel/lib/Widget/Base.php
ansel/lib/Widget/GalleryFaces.php
ansel/lib/Widget/Geotag.php
ansel/lib/Widget/ImageFaces.php
ansel/lib/Widget/OtherGalleries.php
ansel/rss.php
ansel/scripts/remote_import.php

index 3621671..bc84c09 100644 (file)
@@ -24,9 +24,6 @@ if (!empty($gallery_id)) {
         Horde_Util::closeWindowJS('window.opener.location.href = window.opener.location.href; window.close();');
         exit;
     }
-} else {
-    // TODO - right now we should *always* have a gallery_id. If we get here
-    //        from a results view, we may not, but that's not implemented yet.
 }
 
 /* Make sure we have at least one image */
index fbab220..2046d48 100644 (file)
@@ -31,7 +31,6 @@ class Ansel_Ajax_Imple_LocationAutoCompleter extends Horde_Ajax_Imple_AutoComple
             if ($results instanceof PEAR_Error) {
                 Horde::logMessage($results, __FILE__, __LINE__, PEAR_LOG_ERR);
             } else {
-                // @TODO: This should be a config param?
                 $_SESSION['ansel']['ajax_locationac'] = (count($results) > 50);
             }
         }
index c3c8097..16d2083 100644 (file)
@@ -429,22 +429,21 @@ class Ansel_Faces_Base
      * @param string  $name      Face name
      *
      * @return array Faces found
-     * @throws Horde_Exception
+     * @throws Ansel_Exception, Horde_Exception_PermissionDenied
      */
     public function saveCustomFace($face_id, $image, $x1, $y1, $x2, $y2, $name = '')
     {
         $image = &$GLOBALS['ansel_storage']->getImage($image);
         $gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
         if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
-            //TODO: Do we throw exceptions for access denied?
-            throw new Horde_Exception('Access denied editing the photo.');
+            throw new Horde_Exception_PermissionDenied('Access denied editing the photo.');
         }
 
         if (empty($face_id)) {
             $new = true;
             $face_id = $GLOBALS['ansel_db']->nextId('ansel_faces');
             if ($face_id instanceof PEAR_Error) {
-                throw new Horde_Exception_Prior($face_id);
+                throw new Ansel_Exception($face_id);
             }
         }
 
index 1716a6c..e85694f 100644 (file)
@@ -112,7 +112,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      *
      * @return mixed true || PEAR_Error on failure.
      */
-    function _save()
+    public function _save()
     {
         // Check for invalid characters in the slug.
         if (!empty($this->data['attribute_slug']) &&
index a260e78..21cf63f 100644 (file)
@@ -911,7 +911,7 @@ class Ansel_Storage
     *                               1 - descending
     *
     * @return array of Ansel_Gallery objects
-    * @throws Horde_Exception
+    * @throws Ansel_Exception
     */
     public function listGalleries($perm = Horde_Perms::SHOW,
                            $attributes = null,
index 349cdff..4305c28 100644 (file)
@@ -65,11 +65,6 @@ class Ansel_Tile_DateGallery {
                                'day' => date('j', $full_date->timestamp()));
         }
 
-        /* Get the currently displayed gallery view type */
-        // @TODO: $view would only be needed if we are displaying this tile in a
-        //        search result view as well. (Not implemented yet)
-        //$view = Horde_Util::getFormData('view', 'Gallery');
-
         /* Check permissions on the gallery and get appropriate tile image */
         if ($dgallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             if (is_null($style)) {
index ff17370..a88bd2b 100644 (file)
@@ -35,7 +35,7 @@ abstract class Ansel_View_GalleryRenderer_Base
 
     /**
      * The current page we are viewing
-     * //TODO: use __get() for these type of things...
+     * 
      * @var integer
      */
     public $page = 0;
index adab0f2..8fa97f7 100644 (file)
@@ -22,8 +22,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
     }
 
     /**
-     * TODO
-     *
+     * 
      * @see ansel/lib/Widget/Ansel_Widget_Base#html()
      */
     public function html()
index 5de8f08..902ee7d 100644 (file)
@@ -123,7 +123,6 @@ abstract class Ansel_Widget_Base
      * Determine if a particular view (Image, Gallery etc..) is supported
      * by this widget.
      *
-     * @TODO
      * @param string $view  The view to check
      *
      * @return boolean
index 89d0b9f..f26a000 100644 (file)
@@ -13,9 +13,9 @@
 class Ansel_Widget_GalleryFaces extends Ansel_Widget_Base
 {
     /**
-     * @TODO
+     * Supported views for this widget
      *
-     * @var unknown_type
+     * @var array
      */
     protected $_supported_views = array('Gallery');
 
index ef2597e..e8d06ff 100644 (file)
@@ -9,7 +9,7 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
  * @TODO: Refactor the JS out to a seperate file, output needed values in the
- *        GLOBAL Ansel javascript object.
+ *        GLOBAL Ansel javascript object. Rewrite for Horde_Map js.
  *
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  * @package Ansel
index b566ed9..6187f92 100644 (file)
@@ -13,9 +13,9 @@
 class Ansel_Widget_ImageFaces extends Ansel_Widget_Base
 {
     /**
-     * @TODO
+     * The views this Widget may appear in
      *
-     * @var unknown_type
+     * @var array
      */
     private $_supported_views = array('Image');
 
index da874ea..8ee5703 100644 (file)
@@ -54,9 +54,6 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
     /**
      * Build the HTML for the other galleries widget content.
      *
-     * @TODO Allow the sort order and maybe the count of galleries returned
-     *       to be configurable via the params array.
-     *
      * @return string  The HTML
      */
     protected function _getOtherGalleries()
@@ -66,23 +63,22 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
         /* Set up the tree */
         $tree = Horde_Tree::singleton('otherAnselGalleries_' . md5($owner), 'Javascript');
         $tree->setOption(array('class' => 'anselWidgets'));
-        $gals = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, $owner,
-                                                         null, true, 0, 0,
-                                                         'name', 0);
+
+        try {
+            $gals = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, $owner,
+                                                             null, true, 0, 0,
+                                                            'name', 0);
+        } catch (Ansel_Exception $e) {
+            Horde::logMessage($gal, __FILE__, __LINE__, PEAR_LOG_ERR);
+            return '';
+        }
 
         $html = '<div style="display:'
             . (($GLOBALS['prefs']->getValue('show_othergalleries')) ? 'block' : 'none')
             . ';background:' . $this->_style['background']
             . ';width:100%;max-height:300px;overflow:auto;" id="othergalleries" >';
 
-        //@TODO - for now, Horde_Share will still return PEAR_Error,
-        //        this will be fixed when Ansel_Gallery is refactored.
         foreach($gals as $gal) {
-            if (is_a($gal, 'PEAR_Error')) {
-                Horde::logMessage($gal, __FILE__, __LINE__, PEAR_LOG_ERR);
-                return '';
-            }
-
             $parents = $gal->get('parents');
             if (empty($parents)) {
                 $parent = null;
@@ -118,8 +114,6 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
                  ? 'hide'
                  : 'show') . '">&nbsp;</a></div>' . "\n";
 
-
-
         return $html;
     }
 }
index e1bff42..4b81e03 100644 (file)
@@ -39,7 +39,6 @@ if (empty($rss)) {
     $author = '';
 
     // Determine what we are requesting
-    // @TODO - category
     switch ($stream_type) {
     case 'all':
         $images = $ansel_storage->getRecentImages();
index c465cc8..4303c3c 100755 (executable)
@@ -272,8 +272,6 @@ function processDirectory($dir, $parent = null, $gallery_id = null, $slug = null
 /**
  * Read an image from the filesystem.
  *
- * @TODO: pass in location of magic_db?
- *
  * @param string $file     The filename of the image.
  *
  * @return array  The image data of the file as an array or PEAR_Error