VERSION
VERSION
Serializable version constant
Class to encapsulate a single gallery. Implemented as an extension of the Horde_Share_Object class.
Copyright 2001-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
__construct(\Horde_Share_Object $share) : \Ansel_Gallery
The Ansel_Gallery constructor.
\Horde_Share_Object | $share |
getParent() : \Ansel_Gallery
addImageObject(\Ansel_Image $image, boolean $default = false) : integer
Adds an Ansel_Image object to this gallery.
\Ansel_Image | $image | The ansel image object to add |
boolean | $default | Set this image as the gallery's key image. |
The new image id
addImage(array $image_data, boolean $default = false) : integer
Add an image to this gallery.
array | $image_data | The image to add. Keys include: image_filename - The filename of the image [REQUIRED]. data - The binary image data [REQUIRED] image_caption - The caption/description. Defaults to filename. image_type - The MIME type of the image. Attempts to detect.
|
boolean | $default | Make this image the new default tile image. |
The id of the new image.
moveImagesTo(array $images, \Ansel_Gallery $gallery) : integer
Move images from this gallery to a new gallery.
array | $images | An array of image ids. |
\Ansel_Gallery | $gallery | The gallery to move the images to. |
The number of images moved.
copyImagesTo(array $images, \Ansel_Gallery $gallery) : integer
Copy image and related data to specified gallery.
array | $images | An array of image ids. |
\Ansel_Gallery | $gallery | The gallery to copy images to. |
The number of images copied
removeImage(mixed $image, boolean $isStack = false)
Remove the given image from this gallery.
mixed | $image | Image to delete. Can be an Ansel_Image or an image ID. |
boolean | $isStack | Indicates if this image represents a stack image. |
Ansel_Exception
getTile(\Ansel_Gallery $parent = null, \Ansel_Style $style = null, boolean $mini = false, array $params = array()) : \Ansel_Tile_Gallery
Output the HTML for this gallery's tile.
\Ansel_Gallery | $parent | The parent Ansel_Gallery object |
\Ansel_Style | $style | A style object to use. |
boolean | $mini | Force the use of a mini thumbnail? |
array | $params | Any additional parameters the Ansel_Tile object may need. |
getChildren(string $user, integer $perm = \Horde_Perms::SHOW, boolean $allLevels = true) : array
Get all children of this share.
string | $user | The user to use for checking perms |
integer | $perm | Horde_Perms::* constant. If NULL will return all shares regardless of permissions. |
boolean | $allLevels | Return all levels. |
An array of Ansel_Gallery objects
getGalleryChildren(integer $perm = \Horde_Perms::SHOW, integer $from, integer $to, boolean $noauto = true) : \A
Get the children of this gallery.
integer | $perm | The permissions to limit to. |
integer | $from | The child to start at. |
integer | $to | The child to end with. |
boolean | $noauto | Prevent auto |
mixed array of Ansel_Gallery and Ansel_Image objects that are children of this gallery.
countGalleryChildren(integer $perm = \Horde_Perms::SHOW, boolean $galleries_only = false, boolean $noauto = true) : integer
Return the count of this gallery's children
integer | $perm | The permissions to require. |
boolean | $galleries_only | Only include galleries, no images. |
boolean | $noauto | Do not auto drill down into gallery tree. |
The count of this gallery's children.
getImage(integer $id) : \Ansel_Image
Returns the image in this gallery corresponding to the given id.
integer | $id | The ID of the image to retrieve. |
The image object corresponding to the given id.
getKeyImage(\Ansel_Style $style = null) : mixed
Returns the key image for this gallery.
\Ansel_Style | $style | Force the use of this style, if it's available otherwise use whatever style is choosen for this gallery. If prettythumbs are not available then we always use ansel_default style. |
The image_id of the key image or false.
getStyle() : \Ansel_Style
Return the style definition for this gallery.
The style definition array.
hasPermission(string $userid, integer $permission, string $creator = null) : boolean
Checks to see if a user has a given permission.
string | $userid | The userid of the user. |
integer | $permission | A Horde_Perms::* constant to test for. |
string | $creator | The creator of the event. |
Whether or not $userid has $permission.
toJson(boolean $full = false) : \StdClass
Returns a json representation of this gallery.
boolean | $full | Return all information (subgalleries and images)? |
An object describing the gallery
'id' - gallery id 'p' - gallery's parent's id (null if top level) 'pn' - gallery's parent's name (null if top level) 'n' - gallery name 'dc' - date created 'dm' - date modified 'd' - description 'ki' - key image 'sg' - an object with the following properties: 'n' - gallery name 'dc' - date created 'dm' - date modified 'd' - description 'ki' - key image 'imgs' - an array of image objects with the following properties: 'id' - the image id 'url' - the image url