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
Afficher le fichier Open project: horde/horde

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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
Résultat unknown

_loadSubGalleries() protected méthode

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

countGalleryChildren() public méthode

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.
Résultat 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 méthode

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.
Résultat integer number of images in this gallery

getDate() public méthode

Getter for date
public getDate ( ) : array
Résultat array A date parts array.

getGalleryChildren() public méthode

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.
Résultat array A mixed array of Ansel_Gallery_Decorator_Date and Ansel_Image objects.

getGalleryCrumbData() public méthode

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

getImages() public méthode

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 méthode

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

hasSubGalleries() public méthode

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

listImages() public méthode

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.
Résultat array An array of image_ids

moveImagesTo() public méthode

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.
Résultat boolean

removeImage() public méthode

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).
Résultat boolean

setDate() public méthode

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
Résultat array

$_features protected_oe property

Supported features
protected array $_features
Résultat array

$_subGalleries protected_oe property

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