\Ansel_GalleryMode_Date

Ansel_GalleryMode_Date:: Class for encapsulating gallery methods that depend on the current display mode of the gallery being Date.

Copyright 2008-2017 Horde LLC (http://www.horde.org/)

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

Summary

Methods
Properties
Constants
__construct()
hasFeature()
setDate()
getDate()
getGalleryChildren()
countGalleryChildren()
getGalleryCrumbData()
listImages()
getImages()
moveImagesTo()
removeImage()
hasSubGalleries()
countImages()
No public properties found
MODE_NORMAL
MODE_DATE
_getArraySlice()
_loadSubGalleries()
$_gallery
$_features
$_date
$_subGalleries
N/A
No private methods found
No private properties found
N/A

Constants

MODE_NORMAL

MODE_NORMAL

MODE_DATE

MODE_DATE

Properties

$_features

$_features : array

Supported features

Type

array

$_date

$_date : array

The date part array for the current grouping.

Type

array

$_subGalleries

$_subGalleries : array

The subgalleries whose images need to be included in this date grouping.

Type

array

Methods

hasFeature()

hasFeature(string  $feature) : boolean

See if a feature is supported.

Parameters

string $feature

The feature

Returns

boolean

setDate()

setDate(array  $date = array()) 

Setter for date

Parameters

array $date

Date parts array

getDate()

getDate() : array

Getter for date

Returns

array —

A date parts array.

getGalleryChildren()

getGalleryChildren(integer  $perm = \Horde_Perms::SHOW, integer  $from, integer  $to, boolean  $noauto = false) : array

Get the children of this gallery.

Parameters

integer $perm

The permissions to limit to.

integer $from

The child to start at.

integer $to

The child to end with.

boolean $noauto

Whether or not to automatically drill down to the first grouping with more then one group.

Returns

array —

A mixed array of Ansel_Gallery_Decorator_Date and Ansel_Image objects.

countGalleryChildren()

countGalleryChildren(integer  $perm = \Horde_Perms::SHOW, boolean  $galleries_only = false, boolean  $noauto = true) : integer

Return the count of this gallery's children

Parameters

integer $perm

The permissions to require.

boolean $galleries_only

Only include galleries, no images. (Ignored since this makes no sense for a gallery grouped by dates).

boolean $noauto

Auto navigate down to the first populated date grouping.

Returns

integer —

The count of this gallery's children. The count is either a count of of the number of date groupings (months, days, etc..) that need to be displayed, or a count of all the images in the current date grouping (for a specific day).

getGalleryCrumbData()

getGalleryCrumbData() : array

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

Returns

array —

An array of 'title' and 'navdata' hashes with the [0] element being the deepest part.

listImages()

listImages(integer  $from, integer  $count) : array

Lists a slice of the image ids in this gallery.

In Date mode, this only makes sense if we are currently viewing a specific day, otherwise we return 0.

Parameters

integer $from

The image to start listing.

integer $count

The numer of images to list.

Returns

array —

An array of image_ids

getImages()

getImages(integer  $from, integer  $count) 

Gets a slice of the images in this gallery.

Parameters

integer $from

The image to start fetching.

integer $count

The numer of images to return.

moveImagesTo()

moveImagesTo(array  $images, \Ansel_Gallery  $gallery) : boolean

Moves images from one gallery to another. Since we're viewing by date some images might belong to a subgallery so we need to take care to udate the appropriate gallery data.

Parameters

array $images

An array of image_ids to move.

\Ansel_Gallery $gallery

The Ansel_Gallery to move them to.

Returns

boolean

removeImage()

removeImage(mixed  $image, boolean  $isStack) : boolean

Remove an image from this gallery. Note that the image might actually belong to a subgallery of this gallery since we are viewing by date.

Need to take care of updating correct subgallery's image count etc...

Parameters

mixed $image

An image_id or Ansel_Image object to delete.

boolean $isStack

Image is a stack image (doesn't update count).

Throws

\Horde_Exception_NotFound,

Ansel_Exception

Returns

boolean

hasSubGalleries()

hasSubGalleries() : boolean

Checks if the gallery has any subgalleries. This will always be false for a gallery in date view.

Returns

boolean

countImages()

countImages(boolean  $subgalleries = false) : integer

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

Parameters

boolean $subgalleries

Determines whether subgalleries should be counted or not.

Returns

integer —

number of images in this gallery

_getArraySlice()

_getArraySlice(\unknown_type  $array, \unknown_type  $from, \unknown_type  $count,   $preserve = false) : \unknown

Helper function to get an array slice while preserving keys.

Parameters

\unknown_type $array
\unknown_type $from
\unknown_type $count
$preserve

Returns

\unknown

_loadSubGalleries()

_loadSubGalleries() 

Get this gallery's subgalleries. Populates the private member _subGalleries