The Ansel_Gallery constructor.
Ansel_Gallery
Ansel_Gallery
([ $attributes = array()], string $name)
-
string
$name: The name of the gallery
-
$attributes
Add an image to this gallery.
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.
Checks if the user can download the full photo
boolean
canDownload
()
Clear all of this gallery's default image stacks from the VFS and the gallery's data store.
void
clearStacks
()
Removes all generated and cached 'prettythumb' thumbnails for this
gallery
void
clearThumbs
()
Removes all generated and cached views for this gallery
void
clearViews
()
Copy image and related data to specified gallery.
-
array
$images: An array of image ids.
-
Ansel_Gallery
$gallery: The gallery to copy images to.
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
Returns the number of images in this gallery and, optionally, all sub-galleries.
integer
countImages
([boolean $subgalleries = false])
-
boolean
$subgalleries: Determines whether subgalleries should be counted or not.
Returns the default image for this gallery.
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.
Get the 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
Get an array describing where this gallery is in a breadcrumb trail.
An
getGalleryCrumbData
()
Returns the image in this gallery corresponding to the given id.
-
integer
$id: The ID of the image to retrieve.
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
Returns this share's owner's Identity object.
Identity
getOwner
()
Return the most recently added images in this gallery.
mixed
getRecentImages
([integer $limit = 10])
-
integer
$limit: The maximum number of images to return.
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.
array
getStyle
()
Returns this gallery's tags.
void
getTags
()
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.
Check for special capabilities of this gallery.
void
hasFeature
( $feature)
Determine if we need to unlock a password protected gallery
boolean
hasPasswd
()
Checks to see if a user has a given 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.
Checks if the gallery has any subgallery
void
hasSubGalleries
()
Check user age limtation
boolean
isOldEnough
()
Lists a slice of the image ids in this gallery.
mixed
listImages
([integer $from = 0], [integer $count = 0])
-
integer
$from: The image to start listing.
-
integer
$count: The numer of images to list.
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.
Remove the given image from this gallery.
boolean
removeImage
(mixed $image, [ $isStack = false])
-
mixed
$image: Image to delete. Can be an Ansel_Image or an image ID.
-
$isStack
Sets an attribute value in this object.
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.
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.
Sets this gallery's parent gallery.
mixed
setParent
(mixed $parent)
-
mixed
$parent: An Ansel_Gallery or a gallery_id.
Set/replace this gallery's tags.
void
setTags
(array $tags)
-
array
$tags: AN array of tag names to associate with this image.
Return a hash key for the given view and style.
string
_getViewHash
(string $view, [string $style = null])
-
string
$view: The view (thumb, prettythumb etc...)
-
string
$style: The named style.
Saves any changes to this object to the backend permanently.
mixed
_save
()
Simple factory to retrieve the proper mode object.
Ansel_Gallery_Mode
_setModeHelper
([string $type = 'Normal'])
-
string
$type: The mode to use
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