\Ansel_View_List

The Ansel_View_List:: provides a view for handling lists of galleries.

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
addWidget()
renderWidgets()
countWidgets()
viewType()
getGalleryCrumbData()
getTitle()
html()
__construct()
__get()
__set()
__isset()
getParams()
json()
$resource
$gallery
No constants found
_renderWidgets()
_getGallery()
$_widgets
$_params
$_owner
$_special
$_page
$_view
N/A
No private methods found
No private properties found
N/A

Properties

$resource

$resource : mixed

The ansel resource this view is for.

Type

mixed — Either an Ansel_Gallery or Ansel_Image

$gallery

$gallery : \Ansel_Gallery

The gallery object (will be eq to $resource in a gallery view

Type

\Ansel_Gallery

$_widgets

$_widgets : array

Collection of Ansel_Widgets to display in this view.

Type

array

$_params

$_params : 

Type

$_owner

$_owner : string

The owner we are grouping by, if any.

Type

string

$_special

$_special : boolean

Type

boolean

$_page

$_page : integer

The current page number of the view.

Type

integer

$_view

$_view : \Horde_View

The Horde_View used to render this view.

Type

\Horde_View

Methods

addWidget()

addWidget(\Ansel_Widget  $widget) 

Add an Ansel_Widget to be displayed in this view.

Parameters

\Ansel_Widget $widget

The Ansel_Widget to display

renderWidgets()

renderWidgets() 

Output any widgets associated with this view.

countWidgets()

countWidgets() : integer

Count the number of widgets we have attached.

Returns

integer —

The number of widgets attached to this view.

viewType()

viewType() 

getGalleryCrumbData()

getGalleryCrumbData() 

noop

getTitle()

getTitle() : string

Get this view's title.

Returns

string —

The gallery's title.

html()

html() : string

Return the HTML representing this view.

Returns

string —

The HTML.

__construct()

__construct(array  $params = array()) 

Const'r

Parameters

array $params

Any parameters that the view might need.

 In addition to the params taken by Ansel_View_Gallery, this view
 can also take:

 groupby      -  Group the results (owner)

 owner        -  The owner to group by

 tags         -  Limit to galleries matching tags

 gallery_ids  -  No fitering, just show these galleries

 pager_url    -  The url for the pager to use see Ansel_Gallery for
                 more information on the url parameters.

__get()

__get(  $property) 

Parameters

$property

__set()

__set(  $property,   $value) 

Parameters

$property
$value

__isset()

__isset(  $property) 

Parameters

$property

getParams()

getParams() : \unknown_type

Getter for the view parameters.

Returns

\unknown_type

json()

json(\Ansel_Gallery  $gallery, array  $params = array()) : string

JSON representation of this gallery's images. We don't use Ansel_Gallery::toJson() on purpose since that is a general jsonification of the gallery data. This method is specific to the view, paging, links etc.

..

Parameters

\Ansel_Gallery $gallery

The gallery to represent in this view

array $params

An array of parameters for this method:

     full       - Should a full URL be generated? [false]
     from       - Starting image count [0]
     count      - The number of images to include (starting at from) [0]
     image_view - The type of ImageGenerator to obtain the src url for. [screen]
     view_links - Should the JSON include links to the Image and/or Gallery View? [false]
     perpage    - Number of images per page [from user prefs]
  

Returns

string —

A serialized JSON array.

_renderWidgets()

_renderWidgets() 

Default widget rendering, can be overridden by any subclass.

_getGallery()

_getGallery(integer  $galleryId = null, string  $slug = '') : \Ansel_Gallery

Todo

Parameters

integer $galleryId

The gallery id

string $slug

The gallery slug

Throws

\Horde_Exception
\InvalidArgumentException

Returns

\Ansel_Gallery

The requested Ansel_Gallery object