Overview

Packages

  • Ansel
  • None

Classes

  • Ansel
  • Ansel_Ajax_Application
  • Ansel_Ajax_Imple_EditCaption
  • Ansel_Ajax_Imple_EditFaces
  • Ansel_Ajax_Imple_EditGalleryFaces
  • Ansel_Ajax_Imple_Embed
  • Ansel_Ajax_Imple_GallerySlugCheck
  • Ansel_Ajax_Imple_ImageSaveGeotag
  • Ansel_Ajax_Imple_LocationAutoCompleter
  • Ansel_Ajax_Imple_MapLayerSelect
  • Ansel_Ajax_Imple_TagActions
  • Ansel_Ajax_Imple_ToggleGalleryActions
  • Ansel_Ajax_Imple_ToggleOtherGalleries
  • Ansel_Ajax_Imple_UploadNotification
  • Ansel_Api
  • Ansel_Exception
  • Ansel_Faces
  • Ansel_Faces_Base
  • Ansel_Faces_Facedetect
  • Ansel_Faces_User
  • Ansel_Factory_Faces
  • Ansel_Factory_Storage
  • Ansel_Factory_Styles
  • Ansel_Form_Ecard
  • Ansel_Form_Image
  • Ansel_Form_ImageDate
  • Ansel_Form_Upload
  • Ansel_Gallery
  • Ansel_Gallery_Decorator_Date
  • Ansel_GalleryMode_Base
  • Ansel_GalleryMode_Date
  • Ansel_GalleryMode_Normal
  • Ansel_Image
  • Ansel_ImageGenerator
  • Ansel_ImageGenerator_Mini
  • Ansel_ImageGenerator_PolaroidThumb
  • Ansel_ImageGenerator_PolaroidThumbStack
  • Ansel_ImageGenerator_RoundedThumb
  • Ansel_ImageGenerator_RoundedThumbStack
  • Ansel_ImageGenerator_Screen
  • Ansel_ImageGenerator_ShadowThumb
  • Ansel_ImageGenerator_ShadowThumbStack
  • Ansel_ImageGenerator_SquareThumb
  • Ansel_ImageGenerator_Thumb
  • Ansel_LoginTasks_SystemTask_Upgrade
  • Ansel_Report
  • Ansel_Report_letter
  • Ansel_Report_mail
  • Ansel_Report_tickets
  • Ansel_Search
  • Ansel_Search_exif
  • Ansel_Search_Tag
  • Ansel_Storage
  • Ansel_Style
  • Ansel_Tagger
  • Ansel_Test
  • Ansel_Tile_DateGallery
  • Ansel_Tile_Gallery
  • Ansel_Tile_Image
  • Ansel_View_Ansel
  • Ansel_View_Base
  • Ansel_View_EmbeddedRenderer_GalleryLink
  • Ansel_View_EmbeddedRenderer_Mini
  • Ansel_View_EmbeddedRenderer_Slideshow
  • Ansel_View_Gallery
  • Ansel_View_GalleryProperties
  • Ansel_View_GalleryRenderer_Base
  • Ansel_View_GalleryRenderer_Gallery
  • Ansel_View_GalleryRenderer_GalleryLightbox
  • Ansel_View_Image
  • Ansel_View_List
  • Ansel_View_Results
  • Ansel_View_Slideshow
  • Ansel_View_Upload
  • Ansel_Widget
  • Ansel_Widget_Actions
  • Ansel_Widget_Base
  • Ansel_Widget_GalleryFaces
  • Ansel_Widget_Geotag
  • Ansel_Widget_ImageFaces
  • Ansel_Widget_Links
  • Ansel_Widget_OtherGalleries
  • Ansel_Widget_OwnerFaces
  • Ansel_Widget_SimilarPhotos
  • Ansel_Widget_Tags
  • Ansel_XPPublisher
  • Overview
  • Package
  • Class
  • Tree

Class Ansel_Gallery

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

Copyright 2001-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Ansel_Gallery implements Serializable
Package: Ansel
Author: Michael J. Rubinsky mrubinsk@horde.org
Located at Gallery.php
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

Ansel_Gallery
public mixed
# __get( string $property )

Helper for accessing the gallery id

Helper for accessing the gallery id

Parameters

$property
The property

Returns

mixed
public mixed
# get( string $property )

Get a gallery 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
# getParent( )

Returns

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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Exception
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

Ansel_Tile_Gallery
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

Ansel_Exception
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

Ansel_Style
The style definition array.
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
# isOldEnough( )

Check user age limtation

Check user age limtation

Returns

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

Ansel_Exception
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

Ansel_Exception
public
# setDate( mixed $date )
public
# getDate( )
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.

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
# toArray( )
Constants summary
integer VERSION

Serializable version constant

Serializable version constant

# 3
API documentation generated by ApiGen