From c6f86a76f9ed9d8ec7f13c25c9ffff34ab5abce9 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 24 Jul 2010 14:59:24 -0400 Subject: [PATCH] Various renaming and code organization changes: Rename ansel gallery's "default" image to "key" image - it's not a default for anything, name it appropriately in the code Move all sql storage related code to Ansel_Storage. Don't use the share's database to manipulate non-share tables. --- ansel/lib/Api.php | 4 +- ansel/lib/Block/gallery.php | 4 +- ansel/lib/Block/my_galleries.php | 2 +- ansel/lib/Gallery.php | 52 ++++++++++--------------- ansel/lib/Gallery/Decorator/Date.php | 6 +-- ansel/lib/GalleryMode/Date.php | 18 +++------ ansel/lib/GalleryMode/Normal.php | 16 ++------ ansel/lib/ImageGenerator.php | 4 +- ansel/lib/ImageGenerator/PolaroidThumb.php | 2 +- ansel/lib/Storage.php | 33 ++++++++++++++++ ansel/lib/Tile/DateGallery.php | 2 +- ansel/lib/Tile/Gallery.php | 2 +- ansel/lib/View/EmbeddedRenderer/GalleryLink.php | 6 +-- ansel/lib/View/Results.php | 3 +- ansel/lib/Widget/OtherGalleries.php | 2 +- ansel/rss.php | 4 +- ansel/templates/group/category.inc | 2 +- ansel/templates/group/owner.inc | 2 +- 18 files changed, 85 insertions(+), 79 deletions(-) diff --git a/ansel/lib/Api.php b/ansel/lib/Api.php index fba48528b..08ad7601a 100644 --- a/ansel/lib/Api.php +++ b/ansel/lib/Api.php @@ -550,7 +550,7 @@ class Ansel_Api extends Horde_Registry_Api * (string)slug Ignore gallery_id, and use this as the slug * * - * @return integer The default image id. + * @return integer The key image id. */ public function getGalleryKeyImage($gallery_id, $params = array()) { @@ -564,7 +564,7 @@ class Ansel_Api extends Horde_Registry_Api $gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getGallery($gallery_id); } - return $gallery->getDefaultImage(empty($params['style']) ? 'ansel_default' : $params['style']); + return $gallery->getKeyImage(empty($params['style']) ? 'ansel_default' : $params['style']); } /** diff --git a/ansel/lib/Block/gallery.php b/ansel/lib/Block/gallery.php index 7294f69db..7c84e9bde 100644 --- a/ansel/lib/Block/gallery.php +++ b/ansel/lib/Block/gallery.php @@ -119,10 +119,10 @@ class Horde_Block_ansel_gallery extends Horde_Block true); $html .= '