\Ansel_View_Image

The Ansel_View_Image:: class wraps display of individual images.

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()
_prepare()
_getView()
_html()
_getCommentData()
_includeViewSpecificScripts()
$_widgets
$_params
$_slug
$_page
$_date
$_mode
$_style
$_geometry
$_imageList
$_revList
$_urls
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

$_slug

$_slug : string

The parent gallery's slug name, if available.

Type

string

$_page

$_page : integer

The page this image appears on in the current gallery view, if available.

Type

integer

$_date

$_date : array

The image's date for use in date browsing.

Type

array

$_mode

$_mode : string

The gallery mode for this images's current gallery view.

Type

string

$_style

$_style : \Ansel_Style

The parent gallery's current style.

Type

\Ansel_Style

$_geometry

$_geometry : array

The image geometry.

Type

array

$_imageList

$_imageList : array

List of image ids in the parent gallery. Used for next/prev fetching.

Type

array

$_revList

$_revList : array

Cache {@link self::_imageList} in reverse.

Type

array

$_urls

$_urls : array

An array of various URLs that are displayed in the view.

Type

array

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() : array

Return the gallery's breadcrumb data.

Returns

array

getTitle()

getTitle() : string

Get the title for this view.

Returns

string —

The title.

html()

html() : string

Get the HTML representing this view.

Returns

string —

The HTML.

__construct()

__construct(array  $params = array()) 

Const'r

Parameters

array $params

Throws

\Ansel_Exception

__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

_prepare()

_prepare() 

Build variables needed to output the html. Extracted to this method so child classes can use this as well.

_getView()

_getView() : \Horde_View

Generate the Horde_View and populate with basic/common properties.

Returns

\Horde_View

_html()

_html() 

Image view specific HTML - done so we can extend View_Image for things like the slideshow view etc.

..

_getCommentData()

_getCommentData() : boolean|array

Helper for comments

Returns

boolean|array —

Either an array of comment data or false on failure

_includeViewSpecificScripts()

_includeViewSpecificScripts()