Property | Type | Description | |
---|---|---|---|
$_modeHelper | Ansel_GalleryMode_ | The gallery mode helper | |
$_share | Horde_Share_Object | The share object for this gallery. |
Method | Description | |
---|---|---|
__construct ( Horde_Share_Object $share ) : Ansel_Gallery | The Ansel_Gallery constructor. | |
__get ( string $property ) : mixed | Helper for accessing the gallery id | |
addImage ( array $image_data, boolean $default = false ) : integer | Add an image to this gallery. | |
addImageObject ( Ansel_Image $image, boolean $default = false ) : integer | Adds an Ansel_Image object to this gallery. | |
canDownload ( ) : boolean | Checks if the user can download the full photo | |
clearStacks ( ) | Clear all of this gallery's key image stacks from the VFS and the gallery's data store. | |
clearThumbs ( ) | Removes all generated and cached thumbnails for this gallery. | |
clearViews ( ) | Removes all generated and cached views for this gallery. | |
copyImagesTo ( array $images, Ansel_Gallery $gallery ) : integer | Copy image and related data to specified gallery. | |
countChildren ( $user, $perm = Horde_Perms::SHOW, $allLevels = true ) | ||
countGalleryChildren ( integer $perm = Horde_Perms::SHOW, boolean $galleries_only = false, boolean $noauto = true ) : integer | Return the count of this gallery's children | |
countImages ( boolean $subgalleries = false ) : integer | Returns the number of images in this gallery and, optionally, all sub-galleries. | |
get ( string $property ) : mixed | Get a gallery property | |
getChildren ( string $user, integer $perm = Horde_Perms::SHOW, boolean $allLevels = true ) : array | Get all children of this share. | |
getDate ( ) | ||
getGalleryChildren ( integer $perm = Horde_Perms::SHOW, integer $from, integer $to, boolean $noauto = true ) : A | Get the children of this gallery. | |
getGalleryCrumbData ( ) : An | Get an array describing where this gallery is in a breadcrumb trail. | |
getIdentity ( ) : Horde_Prefs_Identity | Returns this share's owner's Identity object. | |
getImage ( integer $id ) : Ansel_Image | Returns the image in this gallery corresponding to the given id. | |
getImages ( integer $from, integer $count ) | Gets a slice of the images in this gallery. | |
getKeyImage ( Ansel_Style $style = null ) : mixed | Returns the key image for this gallery. | |
getParent ( ) : Ansel_Gallery | ||
getParents ( ) : array | ||
getPermission ( ) : Horde_Perms_Permission | Returns the permission of this share. | |
getRecentImages ( integer $limit = 10 ) : array | Return the most recently added images in this gallery. | |
getShare ( ) : Horde_Share_Object | Get the gallery's share object. | |
getStyle ( ) : Ansel_Style | Return the style definition for this gallery. | |
getTags ( ) : array | Returns this gallery's tags. | |
getTile ( Ansel_Gallery $parent = null, Ansel_Style $style = null, boolean $mini = false, array $params = [] ) : Ansel_Tile_Gallery | Output the HTML for this gallery's tile. | |
hasFeature ( string $feature ) : boolean | Check for special capabilities of this gallery. | |
hasPasswd ( ) : boolean | Determine if we need to unlock a password protected gallery | |
hasPermission ( string $userid, integer $permission, string $creator = null ) : boolean | Checks to see if a user has a given permission. | |
hasSubGalleries ( ) : boolean | Checks if the gallery has any subgallery | |
isOldEnough ( ) : boolean | Check user age limtation | |
listImages ( integer $from, integer $count ) : array | Lists a slice of the image ids in this gallery. | |
moveImagesTo ( array $images, Ansel_Gallery $gallery ) : integer | Move images from this gallery to a new gallery. | |
removeImage ( mixed $image, boolean $isStack = false ) | Remove the given image from this gallery. | |
removeTag ( string $tag ) | Remove a single tag from this gallery's tag collection | |
resetKeyImage ( ) | Reset the gallery's key image. This will force Ansel to attempt to fetch a new key image the next time one is requested. | |
save ( ) | Saves any changes to this object to the backend permanently. | |
serialize ( ) : string | Serialize this object. | |
set ( string $attribute, mixed $value, boolean $update = false ) | Sets an attribute value in this object. | |
setDate ( $date ) | ||
setImageOrder ( integer $imageId, integer $pos ) | Set the order of an image in this gallery. | |
setParent ( mixed $parent ) | Sets this gallery's parent gallery. | |
setPermission ( Horde_Perms_Permission $permission, $update = true ) | ||
setTags ( array $tags, $replace = true ) | Set/replace this gallery's tags. | |
toArray ( ) | ||
toJson ( boolean $full = false ) : StdClass | Returns a json representation of this gallery. | |
unserialize ( $data ) | ||
updateImageCount ( integer $images, boolean $add = true ) | Update the gallery image count. |
Method | Description | |
---|---|---|
_getDefaultImageId ( ) : integer | boolean | Returns the id for the key image of this gallery. | |
_setModeHelper ( string $type = 'Normal' ) : Ansel_Gallery_Mode | Simple factory to set the proper mode object. |
public __construct ( Horde_Share_Object $share ) : Ansel_Gallery | ||
$share | Horde_Share_Object | |
return | Ansel_Gallery |
protected _getDefaultImageId ( ) : integer | boolean | ||
return | integer | boolean | The image id or false if none found. |
protected _setModeHelper ( string $type = 'Normal' ) : Ansel_Gallery_Mode | ||
$type | string | The mode to use |
return | Ansel_Gallery_Mode | object |
public addImage ( array $image_data, boolean $default = false ) : integer | ||
$image_data | array | 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.'image_caption', and 'data'. Optional keys include 'image_filename' and 'image_type' |
$default | boolean | Make this image the new default tile image. |
return | integer | The id of the new image. |
public addImageObject ( Ansel_Image $image, boolean $default = false ) : integer | ||
$image | Ansel_Image | The ansel image object to add |
$default | boolean | Set this image as the gallery's key image. |
return | integer | The new image id |
public canDownload ( ) : boolean | ||
return | boolean | Whether or not user can download full photos |
public clearStacks ( ) |
public clearThumbs ( ) |
public clearViews ( ) |
public copyImagesTo ( array $images, Ansel_Gallery $gallery ) : integer | ||
$images | array | An array of image ids. |
$gallery | Ansel_Gallery | The gallery to copy images to. |
return | integer | The number of images copied |
public countChildren ( $user, $perm = Horde_Perms::SHOW, $allLevels = true ) |
public countGalleryChildren ( integer $perm = Horde_Perms::SHOW, boolean $galleries_only = false, boolean $noauto = true ) : integer | ||
$perm | integer | The permissions to require. |
$galleries_only | boolean | Only include galleries, no images. |
$noauto | boolean | Do not auto drill down into gallery tree. |
return | integer | The count of this gallery's children. |
public countImages ( boolean $subgalleries = false ) : integer | ||
$subgalleries | boolean | Determines whether subgalleries should be counted or not. |
return | integer | number of images in this gallery |
public getChildren ( string $user, integer $perm = Horde_Perms::SHOW, boolean $allLevels = true ) : array | ||
$user | string | The user to use for checking perms |
$perm | integer | Horde_Perms::* constant. If NULL will return all shares regardless of permissions. |
$allLevels | boolean | Return all levels. |
return | array | An array of Ansel_Gallery objects |
public getGalleryChildren ( integer $perm = Horde_Perms::SHOW, integer $from, integer $to, boolean $noauto = true ) : A | ||
$perm | integer | The permissions to limit to. |
$from | integer | The child to start at. |
$to | integer | The child to end with. |
$noauto | boolean | Prevent auto |
return | A | mixed array of Ansel_Gallery and Ansel_Image objects that are children of this gallery. |
public getGalleryCrumbData ( ) : An | ||
return | An | array of 'title' and 'navdata' hashes with the [0] element being the deepest part. |
public getIdentity ( ) : Horde_Prefs_Identity | ||
return | Horde_Prefs_Identity | object for the owner of this gallery. |
public getKeyImage ( Ansel_Style $style = null ) : mixed | ||
$style | Ansel_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. |
return | mixed | The image_id of the key image or false. |
public getParents ( ) : array | ||
return | array | An array of Ansel_Gallery objects. |
public getPermission ( ) : Horde_Perms_Permission | ||
return | Horde_Perms_Permission | Permission object that represents the permissions on this share. |
public getRecentImages ( integer $limit = 10 ) : array | ||
$limit | integer | The maximum number of images to return. |
return | array | An array of Ansel_Image objects |
public getStyle ( ) : Ansel_Style | ||
return | Ansel_Style | The style definition array. |
public getTile ( Ansel_Gallery $parent = null, Ansel_Style $style = null, boolean $mini = false, array $params = [] ) : Ansel_Tile_Gallery | ||
$parent | Ansel_Gallery | The parent Ansel_Gallery object |
$style | Ansel_Style | A style object to use. |
$mini | boolean | Force the use of a mini thumbnail? |
$params | array | Any additional parameters the Ansel_Tile object may need. |
return | Ansel_Tile_Gallery |
public hasFeature ( string $feature ) : boolean | ||
$feature | string | The feature to check for. |
return | boolean |
public hasSubGalleries ( ) : boolean | ||
return | boolean |
public isOldEnough ( ) : boolean | ||
return | boolean |
public moveImagesTo ( array $images, Ansel_Gallery $gallery ) : integer | ||
$images | array | An array of image ids. |
$gallery | Ansel_Gallery | The gallery to move the images to. |
return | integer | The number of images moved. |
public removeImage ( mixed $image, boolean $isStack = false ) | ||
$image | mixed | Image to delete. Can be an Ansel_Image or an image ID. |
$isStack | boolean | Indicates if this image represents a stack image. |
public resetKeyImage ( ) |
public setImageOrder ( integer $imageId, integer $pos ) | ||
$imageId | integer | The image to sort. |
$pos | integer | The sort position of the image. |
public setPermission ( Horde_Perms_Permission $permission, $update = true ) | ||
$permission | Horde_Perms_Permission |
public toJson ( boolean $full = false ) : StdClass | ||
$full | boolean | Return all information (subgalleries and images)? |
return | StdClass | 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 |
public updateImageCount ( integer $images, boolean $add = true ) | ||
$images | integer | Number of images in action |
$add | boolean | True if adding, false if removing |