PHP Class Ansel_GalleryMode_Date, horde

Copyright 2008-2016 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.
Author: Michael J. Rubinsky ([email protected])
Inheritance: extends Ansel_GalleryMode_Base
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_date array The date part array for the current grouping.
$_features array Supported features
$_subGalleries array The subgalleries whose images need to be included in this date grouping.

Public Methods

Method Description
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.
getDate ( ) : array Getter for date
getGalleryChildren ( integer $perm = Horde_Perms::SHOW, integer $from, integer $to, boolean $noauto = false ) : array Get the children of this gallery.
getGalleryCrumbData ( ) : array Get an array describing where this gallery is in a breadcrumb trail.
getImages ( integer $from, integer $count ) Gets a slice of the images in this gallery.
hasFeature ( string $feature ) : boolean See if a feature is supported.
hasSubGalleries ( ) : boolean Checks if the gallery has any subgalleries. This will always be false for a gallery in date view.
listImages ( integer $from, integer $count ) : array Lists a slice of the image ids in this gallery.
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.
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.
setDate ( array $date = [] ) Setter for date

Protected Methods

Method Description
_getArraySlice ( unknown_type $array, unknown_type $from, unknown_type $count, $preserve = false ) : unknown Helper function to get an array slice while preserving keys.
_loadSubGalleries ( ) Get this gallery's subgalleries. Populates the private member _subGalleries

Method Details

_getArraySlice() protected method

Helper function to get an array slice while preserving keys.
protected _getArraySlice ( unknown_type $array, unknown_type $from, unknown_type $count, $preserve = false ) : unknown
$array unknown_type
$from unknown_type
$count unknown_type
return unknown

_loadSubGalleries() protected method

Get this gallery's subgalleries. Populates the private member _subGalleries
protected _loadSubGalleries ( )

countGalleryChildren() public method

Return the count of this gallery's children
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. (Ignored since this makes no sense for a gallery grouped by dates).
$noauto boolean Auto navigate down to the first populated date grouping.
return 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).

countImages() public method

Returns the number of images in this gallery and, optionally, all sub-galleries.
public countImages ( boolean $subgalleries = false ) : integer
$subgalleries boolean Determines whether subgalleries should be counted or not.
return integer number of images in this gallery

getDate() public method

Getter for date
public getDate ( ) : array
return array A date parts array.

getGalleryChildren() public method

Get the children of this gallery.
public getGalleryChildren ( integer $perm = Horde_Perms::SHOW, integer $from, integer $to, boolean $noauto = false ) : array
$perm integer The permissions to limit to.
$from integer The child to start at.
$to integer The child to end with.
$noauto boolean Whether or not to automatically drill down to the first grouping with more then one group.
return array A mixed array of Ansel_Gallery_Decorator_Date and Ansel_Image objects.

getGalleryCrumbData() public method

Get an array describing where this gallery is in a breadcrumb trail.
public getGalleryCrumbData ( ) : array
return array An array of 'title' and 'navdata' hashes with the [0] element being the deepest part.

getImages() public method

Gets a slice of the images in this gallery.
public getImages ( integer $from, integer $count )
$from integer The image to start fetching.
$count integer The numer of images to return.

hasFeature() public method

See if a feature is supported.
public hasFeature ( string $feature ) : boolean
$feature string The feature
return boolean

hasSubGalleries() public method

Checks if the gallery has any subgalleries. This will always be false for a gallery in date view.
public hasSubGalleries ( ) : boolean
return boolean

listImages() public method

In Date mode, this only makes sense if we are currently viewing a specific day, otherwise we return 0.
public listImages ( integer $from, integer $count ) : array
$from integer The image to start listing.
$count integer The numer of images to list.
return array An array of image_ids

moveImagesTo() public method

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.
public moveImagesTo ( array $images, Ansel_Gallery $gallery ) : boolean
$images array An array of image_ids to move.
$gallery Ansel_Gallery The Ansel_Gallery to move them to.
return boolean

removeImage() public method

Need to take care of updating correct subgallery's image count etc...
public removeImage ( mixed $image, boolean $isStack ) : boolean
$image mixed An image_id or Ansel_Image object to delete.
$isStack boolean Image is a stack image (doesn't update count).
return boolean

setDate() public method

Setter for date
public setDate ( array $date = [] )
$date array

Property Details

$_date protected_oe property

The date part array for the current grouping.
protected array $_date
return array

$_features protected_oe property

Supported features
protected array $_features
return array

$_subGalleries protected_oe property

The subgalleries whose images need to be included in this date grouping.
protected array $_subGalleries
return array