PHP Class Ansel_View_Base, 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: Chuck Hagenbuch ([email protected])
Author: Michael J. Rubinsky ([email protected])
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_params

Public Methods

Method Description
__construct ( array $params = [] ) Const'r
__get ( $property )
__isset ( $property )
__set ( $property, $value )
getParams ( ) : unknown_type Getter for the view parameters.
json ( Ansel_Gallery $gallery, array $params = [] ) : 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.

Protected Methods

Method Description
_getGallery ( integer $galleryId = null, string $slug = '' ) : Ansel_Gallery Todo

Method Details

__construct() public method

Any javascript files needed by the (non-api) view should be included within this method. Additionally, any redirects need to be done in the cont'r since when ::html() is called, headers will have already been sent.
public __construct ( array $params = [] )
$params array Any parameters that the view might need.
gallery_id              The gallery id this view is for. If omitted, it
                        looks for a query parameter called 'gallery'

gallery_slug            Same as above, but a slug

gallery_view_url        If set, this is used as the link to a gallery
                        view. %g is replaced by the gallery_id and %s is
                        replaced by the gallery_slug.

gallery_view            The specific Renderer to use, if needed.
                        (GalleryLightbox, Gallery etc...).

image_view_url          If this is set, the image tiles will use this url
                        for the image view link. %i and %g will be
                        replaced by image_id and gallery_id respectively.
                        %s will be replaced by the gallery_slug

image_view_src          If this is set to true, the image view link will go
                        directly to the actual image. This overrides any
                        setting of image_view_url.

image_view_attributes   An optional array of attribute => value pairs
                        that are used as attributes of the image view
                        link.

image_view_title        Specifies which property of the image object
                        to use as the image caption.

image_onclick           Specifies a onclick handler for the image tile
                        links.

style                   Force the use of this named style.

api                     If set, we are being called from the external api

page                    The gallery page number to display if not the
                        default value of the first page (page = 0)

day, month, year        Numeric date part values to describe the gallery
                        date grouping to view in date mode.

force_date_grouping     Do not auto navigate to the first date grouping
                        with more then one resource. Used from the api
                        when clicking on breadcrumb links, for example.

__get() public method

public __get ( $property )

__isset() public method

public __isset ( $property )

__set() public method

public __set ( $property, $value )

_getGallery() protected method

Todo
protected _getGallery ( integer $galleryId = null, string $slug = '' ) : Ansel_Gallery
$galleryId integer The gallery id
$slug string The gallery slug
return Ansel_Gallery The requested Ansel_Gallery object

getParams() public method

Getter for the view parameters.
public getParams ( ) : unknown_type
return unknown_type

json() public static method

..
public static json ( Ansel_Gallery $gallery, array $params = [] ) : string
$gallery Ansel_Gallery The gallery to represent in this view
$params array 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]
return string A serialized JSON array.

Property Details

$_params protected_oe property

protected $_params