Class Ansel_Gallery

Description

Class to encapsulate a single gallery. Implemented as an extension of the Horde_Share_Object class.

Located in /lib/Ansel.php (line 1050)

Horde_Share_Object_sql_hierarchical
   |
   --Ansel_Gallery
Variable Summary
 mixed $id
 Ansel_Gallery_Mode $_modeHelper
Method Summary
 Ansel_Gallery Ansel_Gallery ([ $attributes = array()], string $name)
 integer addImage (array $image_data, [boolean $default = false])
 boolean canDownload ()
 void clearStacks ()
 void clearThumbs ()
 void clearViews ()
 integer copyImagesTo (array $images, Ansel_Gallery $gallery)
 integer countGalleryChildren ([integer $perm = PERMS_SHOW], [boolean $galleries_only = false], [ $noauto = true])
 integer countImages ([boolean $subgalleries = false])
 void getDate ()
 mixed getDefaultImage ([string $style = null])
 A getGalleryChildren ([integer $perm = PERMS_SHOW], [integer $from = 0], [integer $to = 0], [boolean $noauto = true])
 Ansel_Image &getImage (integer $id)
 void getImages ([integer $from = 0], [integer $count = 0], mixed 2)
 Identity getOwner ()
 mixed getRecentImages ([integer $limit = 10])
 array getStyle ()
 void getTags ()
 void getTile ([Ansel_Gallery $parent = null], [string $style = null], [boolean $mini = false], [array $params = array()])
 void hasFeature ( $feature)
 boolean hasPasswd ()
 boolean hasPermission (string $userid, integer $permission, [string $creator = null])
 void hasSubGalleries ()
 boolean isOldEnough ()
 mixed listImages ([integer $from = 0], [integer $count = 0])
 integer moveImagesTo (array $images, Ansel_Gallery $gallery)
 boolean removeImage (mixed $image, [ $isStack = false])
 mixed set (string $attribute, mixed $value, [boolean $update = false])
 void setDate ( $date)
 void setImageOrder (integer $imageId, integer $pos)
 mixed setParent (mixed $parent)
 void setTags (array $tags)
 string _getViewHash (string $view, [string $style = null])
 mixed _save ()
 Ansel_Gallery_Mode _setModeHelper ([string $type = 'Normal'])
 void _updateImageCount (integer $images, [boolean $add = true], [integer $gallery_id = null])
 void __sleep ()
 void __wakeup ()
Variables
mixed $id (line 1055)

Cache the Gallery Id - to match the Ansel_Image interface

Ansel_Gallery_Mode $_modeHelper (line 1062)

The gallery mode helper

  • var: object
Methods
Constructor Ansel_Gallery (line 1088)

The Ansel_Gallery constructor.

Ansel_Gallery Ansel_Gallery ([ $attributes = array()], string $name)
  • string $name: The name of the gallery
  • $attributes
addImage (line 1236)

Add an image to this gallery.

  • return: The id of the new image.
integer addImage (array $image_data, [boolean $default = false])
  • array $image_data: The image to add. Required keys include 'image_caption', and 'data'. Optional keys include 'image_filename' and 'image_type'
  • boolean $default: Make this image the new default tile image.
canDownload (line 1136)

Checks if the user can download the full photo

  • return: Whether or not user can download full photos
boolean canDownload ()
clearStacks (line 1301)

Clear all of this gallery's default image stacks from the VFS and the gallery's data store.

void clearStacks ()
clearThumbs (line 1319)

Removes all generated and cached 'prettythumb' thumbnails for this

gallery

void clearThumbs ()
clearViews (line 1332)

Removes all generated and cached views for this gallery

void clearViews ()
copyImagesTo (line 1362)

Copy image and related data to specified gallery.

  • return: | PEAR_Error The number of images copied or error message
integer copyImagesTo (array $images, Ansel_Gallery $gallery)
  • array $images: An array of image ids.
  • Ansel_Gallery $gallery: The gallery to copy images to.
countGalleryChildren (line 1513)

Return the count of this gallery's children

  • return: The count of this gallery's children.
integer countGalleryChildren ([integer $perm = PERMS_SHOW], [boolean $galleries_only = false], [ $noauto = true])
  • integer $perm: The permissions to require.
  • boolean $galleries_only: Only include galleries, no images.
  • $noauto
countImages (line 1586)

Returns the number of images in this gallery and, optionally, all sub-galleries.

  • return: number of images in this gallery
integer countImages ([boolean $subgalleries = false])
  • boolean $subgalleries: Determines whether subgalleries should be counted or not.
getDate (line 1956)
void getDate ()
getDefaultImage (line 1601)

Returns the default image for this gallery.

  • return: The image_id of the default image or false.
mixed getDefaultImage ([string $style = null])
  • string $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.
getGalleryChildren (line 1499)

Get the children of this gallery.

  • return: mixed array of Ansel_Gallery and Ansel_Image objects that are children of this gallery.
A getGalleryChildren ([integer $perm = PERMS_SHOW], [integer $from = 0], [integer $to = 0], [boolean $noauto = true])
  • 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
getGalleryCrumbData (line 1967)

Get an array describing where this gallery is in a breadcrumb trail.

  • return: array of 'title' and 'navdata' hashes with the [0] element being the deepest part.
An getGalleryCrumbData ()
getImage (line 1564)

Returns the image in this gallery corresponding to the given id.

  • return: The image object corresponding to the given id.
Ansel_Image &getImage (integer $id)
  • integer $id: The ID of the image to retrieve.
getImages (line 1539)

Gets a slice of the images in this gallery.

void getImages ([integer $from = 0], [integer $count = 0], mixed 2)
  • integer $from: The image to start fetching.
  • integer $count: The numer of images to return.
  • mixed 2: An array of Ansel_Image objects | PEAR_Error
getOwner (line 1455)

Returns this share's owner's Identity object.

  • return: object for the owner of this gallery.
Identity getOwner ()
getRecentImages (line 1551)

Return the most recently added images in this gallery.

  • return: An array of Ansel_Image objects | PEAR_Error
mixed getRecentImages ([integer $limit = 10])
  • integer $limit: The maximum number of images to return.
getStyle (line 1738)

Return the style definition for this gallery. Returns the first available style in this order: Explicitly configured style if available, if configured style is not available, use ansel_default. If nothing has been configured, the user's selected default is attempted.

  • return: The style definition array.
array getStyle ()
getTags (line 1706)

Returns this gallery's tags.

void getTags ()
getTile (line 1471)

Output the HTML for this gallery's tile.

void getTile ([Ansel_Gallery $parent = null], [string $style = null], [boolean $mini = false], [array $params = array()])
  • Ansel_Gallery $parent: The parent Ansel_Gallery object
  • string $style: A named gallery style to use.
  • boolean $mini: Force the use of a mini thumbnail?
  • array $params: Any additional parameters the Ansel_Tile object may need.
hasFeature (line 1106)

Check for special capabilities of this gallery.

void hasFeature ( $feature)
  • $feature
hasPasswd (line 1831)

Determine if we need to unlock a password protected gallery

boolean hasPasswd ()
hasPermission (line 1782)

Checks to see if a user has a given permission.

  • return: Whether or not $userid has $permission.
boolean hasPermission (string $userid, integer $permission, [string $creator = null])
  • string $userid: The userid of the user.
  • integer $permission: A PERMS_* constant to test for.
  • string $creator: The creator of the event.
hasSubGalleries (line 1572)

Checks if the gallery has any subgallery

void hasSubGalleries ()
isOldEnough (line 1799)

Check user age limtation

boolean isOldEnough ()
listImages (line 1526)

Lists a slice of the image ids in this gallery.

  • return: An array of image_ids | PEAR_Error
mixed listImages ([integer $from = 0], [integer $count = 0])
  • integer $from: The image to start listing.
  • integer $count: The numer of images to list.
moveImagesTo (line 1349)

Move images from this gallery to a new gallery.

  • return: | PEAR_Error The number of images moved, or an error message.
integer moveImagesTo (array $images, Ansel_Gallery $gallery)
  • array $images: An array of image ids.
  • Ansel_Gallery $gallery: The gallery to move the images to.
removeImage (line 1445)

Remove the given image from this gallery.

  • return: True on success, false on failure.
boolean removeImage (mixed $image, [ $isStack = false])
  • mixed $image: Image to delete. Can be an Ansel_Image or an image ID.
  • $isStack
set (line 1914)

Sets an attribute value in this object.

  • return: True if setting the attribute did succeed, a PEAR_Error otherwise.
mixed set (string $attribute, mixed $value, [boolean $update = false])
  • string $attribute: The attribute to set.
  • mixed $value: The value for $attribute.
  • boolean $update: Commit only this change to storage.
setDate (line 1951)
void setDate ( $date)
  • $date
setImageOrder (line 1432)

Set the order of an image in this gallery.

void setImageOrder (integer $imageId, integer $pos)
  • integer $imageId: The image to sort.
  • integer $pos: The sort position of the image.
setParent (line 1856)

Sets this gallery's parent gallery.

  • return: Ture || PEAR_Error
mixed setParent (mixed $parent)
  • mixed $parent: An Ansel_Gallery or a gallery_id.
setTags (line 1720)

Set/replace this gallery's tags.

void setTags (array $tags)
  • array $tags: AN array of tag names to associate with this image.
_getViewHash (line 1758)

Return a hash key for the given view and style.

  • return: A md5 hash suitable for use as a key.
string _getViewHash (string $view, [string $style = null])
  • string $view: The view (thumb, prettythumb etc...)
  • string $style: The named style.
_save (line 1165)

Saves any changes to this object to the backend permanently.

  • return: true || PEAR_Error on failure.
mixed _save ()
_setModeHelper (line 1122)

Simple factory to retrieve the proper mode object.

  • return: object
Ansel_Gallery_Mode _setModeHelper ([string $type = 'Normal'])
  • string $type: The mode to use
_updateImageCount (line 1197)

Update the gallery image count.

void _updateImageCount (integer $images, [boolean $add = true], [integer $gallery_id = null])
  • integer $images: Number of images in action
  • boolean $add: Action to take (add or remove)
  • integer $gallery_id: Gallery id to update images for
__sleep (line 1067)
void __sleep ()
__wakeup (line 1076)
void __wakeup ()

Documentation generated on Sun, 30 Jan 2011 05:08:43 +0000 by phpDocumentor 1.4.3