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