Ansel Base Class.
Copyright 2001-2012 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.
Methods summary
public static
string
#
selectGalleries ( array $params = array () )
Return a string containing an listing of the given
gallery array.
Return a string containing an listing of the given
gallery array.
Parameters
$params
An array of options:
<pre>(integer)selected The gallery_id of the gallery that is selected
(integer)perm The permissions filter to <span class="php-keyword1">use</span> [Horde_Perms::SHOW]
(mixed)attributes Restrict the galleries returned to those matching
the filters. Can be an <span class="php-keyword1">array</span> of attribute/values
pairs <span class="php-keyword1">or</span> a gallery owner username.
(boolean)all_levels
(integer)from The gallery to start listing at.
(integer)<span class="php-keyword2">count</span> The number of galleries to <span class="php-keyword1">return</span>.
(integer)ignore An Ansel_Gallery id to ignore when building the tree.</pre>
Returns
string
The HTML to display the option list.
public static
string
#
getErrorImage ( string $view = 'screen' )
This photo should be used as a placeholder if the correct photo can't
be retrieved
This photo should be used as a placeholder if the correct photo can't
be retrieved
Parameters
$view
<p>The view ('screen', 'thumb', or 'full') to show.
Defaults to 'screen'.</p>
Returns
string
The image path.
public static
Horde_Url
#
getUrlFor ( string $controller , array $data , boolean $full = false , integer $append_session = 0 )
Return a properly formatted link depending on the global pretty url
configuration
Return a properly formatted link depending on the global pretty url
configuration
Parameters
$controller
The controller to generate a URL for.
$data
The data needed to generate the URL.
$full
Generate a full URL.
$append_session
0 = only if needed, 1 = always, -1 = never.
Returns
Horde_Url
The generated URL
public static
Horde_Url
#
getImageUrl ( string $imageId , string $view = 'screen' , boolean $full = false , Ansel_Style
$style = null )
Return a link to an image, suitable for use in an tag
Takes into account $conf['vfs']['direct'] and other
factors.
Return a link to an image, suitable for use in an tag
Takes into account $conf['vfs']['direct'] and other
factors.
Parameters
$imageId
The id of the image.
$view
<p>The view ('screen', 'thumb', 'full', 'mini')
to show.</p>
$full
Return a path that includes the server name?
$style
Use this gallery style
Returns
Horde_Url
The image path.
public static
Horde_Image
#
getImageObject ( array $params = array () )
Obtain a Horde_Image object
Obtain a Horde_Image object
Parameters
$params
Any additional parameters
Returns
Horde_Image
object
public static
array
#
getImageFromFile ( string $file , array $override = array () )
Read an image from the filesystem.
Read an image from the filesystem.
Parameters
$file
The filename of the image.
$override
Overwrite the file array with these values.
Returns
array
The image data of the file as an array
Throws
Horde_Exception_NotFound
public static
boolean
#
isAvailable ( string $feature )
Check to see if a particular image manipulation function is
available.
Check to see if a particular image manipulation function is
available.
Parameters
$feature
The name of the function.
Returns
boolean
True if the function is available.
public static
string
#
getBreadCrumbs ( Ansel_Gallery
$gallery = null , stirng $separator = ' » ' )
Generate a list of breadcrumbs showing where we are in the gallery
tree.
Generate a list of breadcrumbs showing where we are in the gallery
tree.
Parameters
$gallery
The gallery the bread crumbs are for.
$separator
The separator text to use between crumbs.
Returns
string
public static
string
#
getStyleSelect ( string $element_name , string $selected = '' )
Build a HTML element containing all the available
gallery styles.
Build a HTML element containing all the available
gallery styles.
Parameters
$element_name
The element's id/name attribute.
$selected
Mark this element as currently selected.
Returns
string
The HTML for the element.
public static
Ansel_Style
#
getStyleDefinition ( string $style )
Get a pre-defined style definition for the requested named style
Get a pre-defined style definition for the requested named style
Parameters
$style
The name of the style to fetch
Returns
Ansel_Style
The definition of the requested style if it's
available, otherwise, the ansel_default style is
returned.
public static
array
#
getDateParameter ( array $date = array () )
Get a date parts array containing only enough date parts for the depth
we are at. If an empty array is passed, attempt to get the parts from
url parametrs. Any missing date parts must be set to 0.
Get a date parts array containing only enough date parts for the depth
we are at. If an empty array is passed, attempt to get the parts from
url parametrs. Any missing date parts must be set to 0.
Parameters
$date
A full date parts array or an empty array.
Returns
array
A trimmed down (if necessary) date parts array.
public static
#
downloadImagesAsZip ( Ansel_Gallery
$gallery = null , array $images = array () )
Downloads all requested images as a zip file. Assumes all permissions
have been checked on the requested resource. Can request either a
single gallery of images, OR an array of individual image ids.
Downloads all requested images as a zip file. Assumes all permissions
have been checked on the requested resource. Can request either a
single gallery of images, OR an array of individual image ids.
Parameters
$gallery
The galleries to download
$images
The images to download
public static
string
#
embedCode ( array $options )
Generate the JS necessary to embed a gallery / images into another
external site.
Generate the JS necessary to embed a gallery / images into another
external site.
Parameters
$options
The options to build the view.
Returns
string
The javascript code
public static
string
#
getTagLinks ( array $tags , string $action = 'add' , string $owner = null )
Get the URL for a tag search link
Get the URL for a tag search link
Parameters
$tags
The tag ids to link to
$action
The action we want to perform with this tag.
$owner
The owner we want to filter the results by
Returns
string
The URL for this tag and action
Todo:
Move this to Tagger
public static
#
initJSVariables ( )
Simple helper to output initial Ansel JS.
Simple helper to output initial Ansel JS.
public static
#
initHordeMap ( array $params = array () )
Initialize the map.
Parameters
$params
Parameters to pass the the map
Todo:
Horde 5 - move this to a method in either Core or a new Horde_Map
framework pacakge.