Overview

Packages

  • Ansel
  • None

Classes

  • Ansel
  • Ansel_Ajax_Application
  • Ansel_Ajax_Imple_EditCaption
  • Ansel_Ajax_Imple_EditFaces
  • Ansel_Ajax_Imple_EditGalleryFaces
  • Ansel_Ajax_Imple_Embed
  • Ansel_Ajax_Imple_GallerySlugCheck
  • Ansel_Ajax_Imple_ImageSaveGeotag
  • Ansel_Ajax_Imple_LocationAutoCompleter
  • Ansel_Ajax_Imple_MapLayerSelect
  • Ansel_Ajax_Imple_TagActions
  • Ansel_Ajax_Imple_ToggleGalleryActions
  • Ansel_Ajax_Imple_ToggleOtherGalleries
  • Ansel_Ajax_Imple_UploadNotification
  • Ansel_Api
  • Ansel_Exception
  • Ansel_Faces
  • Ansel_Faces_Base
  • Ansel_Faces_Facedetect
  • Ansel_Faces_User
  • Ansel_Factory_Faces
  • Ansel_Factory_Storage
  • Ansel_Factory_Styles
  • Ansel_Form_Ecard
  • Ansel_Form_Image
  • Ansel_Form_ImageDate
  • Ansel_Form_Upload
  • Ansel_Gallery
  • Ansel_Gallery_Decorator_Date
  • Ansel_GalleryMode_Base
  • Ansel_GalleryMode_Date
  • Ansel_GalleryMode_Normal
  • Ansel_Image
  • Ansel_ImageGenerator
  • Ansel_ImageGenerator_Mini
  • Ansel_ImageGenerator_PolaroidThumb
  • Ansel_ImageGenerator_PolaroidThumbStack
  • Ansel_ImageGenerator_RoundedThumb
  • Ansel_ImageGenerator_RoundedThumbStack
  • Ansel_ImageGenerator_Screen
  • Ansel_ImageGenerator_ShadowThumb
  • Ansel_ImageGenerator_ShadowThumbStack
  • Ansel_ImageGenerator_SquareThumb
  • Ansel_ImageGenerator_Thumb
  • Ansel_LoginTasks_SystemTask_Upgrade
  • Ansel_Report
  • Ansel_Report_letter
  • Ansel_Report_mail
  • Ansel_Report_tickets
  • Ansel_Search
  • Ansel_Search_exif
  • Ansel_Search_Tag
  • Ansel_Storage
  • Ansel_Style
  • Ansel_Tagger
  • Ansel_Test
  • Ansel_Tile_DateGallery
  • Ansel_Tile_Gallery
  • Ansel_Tile_Image
  • Ansel_View_Ansel
  • Ansel_View_Base
  • Ansel_View_EmbeddedRenderer_GalleryLink
  • Ansel_View_EmbeddedRenderer_Mini
  • Ansel_View_EmbeddedRenderer_Slideshow
  • Ansel_View_Gallery
  • Ansel_View_GalleryProperties
  • Ansel_View_GalleryRenderer_Base
  • Ansel_View_GalleryRenderer_Gallery
  • Ansel_View_GalleryRenderer_GalleryLightbox
  • Ansel_View_Image
  • Ansel_View_List
  • Ansel_View_Results
  • Ansel_View_Slideshow
  • Ansel_View_Upload
  • Ansel_Widget
  • Ansel_Widget_Actions
  • Ansel_Widget_Base
  • Ansel_Widget_GalleryFaces
  • Ansel_Widget_Geotag
  • Ansel_Widget_ImageFaces
  • Ansel_Widget_Links
  • Ansel_Widget_OtherGalleries
  • Ansel_Widget_OwnerFaces
  • Ansel_Widget_SimilarPhotos
  • Ansel_Widget_Tags
  • Ansel_XPPublisher
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Ansel_GalleryMode_Base:: Class for encapsulating gallery methods that
  4:  * depend on the current display mode of the gallery.
  5:  *
  6:  * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
  7:  *
  8:  * See the enclosed file COPYING for license information (GPL). If you
  9:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 10:  *
 11:  * @author Michael J. Rubinsky <mrubinsk@horde.org>
 12:  * @package Ansel
 13:  */
 14: abstract class Ansel_GalleryMode_Base
 15: {
 16:     /**
 17:      * @var Ansel_Gallery
 18:      */
 19:     protected $_gallery;
 20: 
 21:     /**
 22:      *
 23:      * @var array
 24:      */
 25:     protected $_features = array();
 26: 
 27:     /**
 28:      * Constructor
 29:      *
 30:      * @param Ansel_Gallery $gallery  The gallery to bind to.
 31:      *
 32:      * @return Ansel_GalleryMode_Base
 33:      */
 34:     public function __construct($gallery)
 35:     {
 36:         $this->_gallery = $gallery;
 37:     }
 38: 
 39:     public function hasFeature($feature)
 40:     {
 41:         return in_array($feature, $this->_features);
 42:     }
 43: 
 44:     /**
 45:      * @TODO: Figure out if we can get rid of this and only include it in the
 46:      *        objects that actually need it.
 47:      * @param array $date   Date parts array
 48:      */
 49:     public function setDate($date = array())
 50:     {
 51:     }
 52: 
 53:     /**
 54:      *
 55:      * @return array  Date parts array.
 56:      */
 57:     public function getDate()
 58:     {
 59:         return array();
 60:     }
 61: 
 62:     /**
 63:      * Get the children of this gallery.
 64:      *
 65:      * @param integer $perm   The permissions to limit to.
 66:      * @param integer $from   The child to start at.
 67:      * @param integer $count  The number of children to return.
 68:      *
 69:      * @return array  A mixed array of Ansel_Gallery and Ansel_Image objects
 70:      *                that are children of this gallery.
 71:      */
 72:     abstract public function getGalleryChildren($perm = Horde_Perms::SHOW, $from = 0, $to = 0);
 73: 
 74:     /**
 75:      * Return the count this gallery's children
 76:      *
 77:      * @param integer $perm            The permissions to require.
 78:      * @param boolean $galleries_only  Only include galleries, no images.
 79:      *
 80:      * @return integer The count of this gallery's children.
 81:      */
 82:     abstract public function countGalleryChildren($perm = Horde_Perms::SHOW, $galleries_only = false);
 83: 
 84:     /**
 85:      * Get an array describing where this gallery is in a breadcrumb trail.
 86:      *
 87:      * @return  An array of 'title' and 'navdata' hashes with the [0] element
 88:      *          being the deepest part.
 89:      */
 90:     abstract public function getGalleryCrumbData();
 91: 
 92:     /**
 93:      * List a slice of the image ids in this gallery.
 94:      *
 95:      * @param integer $from  The image to start listing.
 96:      * @param integer $count The numer of images to list.
 97:      *
 98:      * @return array  An array of image_ids
 99:      */
100:     abstract public function listImages($from = 0, $count = 0);
101: 
102:     /**
103:      * Gets a slice of the images in this gallery.
104:      *
105:      * @param integer $from  The image to start fetching.
106:      * @param integer $count The numer of images to return.
107:      *
108:      * @param array An array of Ansel_Image objects
109:      */
110:     abstract public function getImages($from = 0, $count = 0);
111: 
112:     /**
113:      * Move images from this gallery to another.
114:      *
115:      * @param array $images           The image ids to move.
116:      * @param Ansel_Gallery $gallery  The gallery to move images into.
117:      *
118:      * @return boolean
119:      * @throws Ansel_Exception
120:      * @throws Horde_Exception_PermissionDenied
121:      */
122:     abstract public function moveImagesTo($images, $gallery);
123: 
124:     /**
125:      * Remove an image from Ansel.
126:      *
127:      * @param integer | Ansel_Image $image  The image id or object
128:      * @param boolean $isStack              This represents a stack image
129:      *
130:      * @return boolean
131:      */
132:     abstract public function removeImage($image, $isStack);
133: 
134:     /**
135:      * Checks if the gallery has any subgallery
136:      *
137:      * @return boolean
138:      */
139:     abstract public function hasSubGalleries();
140: 
141:     /**
142:      * Returns the number of images in this gallery and, optionally, all
143:      * sub-galleries.
144:      *
145:      * @param boolean $subgalleries  Determine whether subgalleries should
146:      *                               be counted or not.
147:      *
148:      * @return integer  The number of images in this gallery
149:      */
150:     abstract public function countImages($subgalleries = false);
151: }
152: 
API documentation generated by ApiGen