Ansel_Storage
Ansel_Storage
([ $scope = null])
void
countCategories
([ $perms = PERMS_SHOW])
Return the count of galleries that the user has specified permissions to and that match any of the requested attributes.
void
countGalleries
(string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null], [string $parent = null], [boolean $allLevels = true])
-
string
$userid: The user to check access for.
-
integer
$perm: The level of permissions to require for a gallery to return it.
-
mixed
$attributes: Restrict the galleries counted to those matching $attributes. An array of attribute/values pairs or a gallery owner username.
-
string
$parent: The parent share to start counting at.
-
boolean
$allLevels: Return all levels, or just the direct children of $parent? Defaults to all levels.
Create and initialise a new gallery object.
Ansel_Gallery
createGallery
([
array $attributes =
array()], [
object Perms $perm =
null], [
mixed $parent =
null])
-
array
$attributes: The gallery attributes
-
object Perms
$perm: The permissions for the gallery if the defaults are not desirable.
-
mixed
$parent: The gallery id of the parent (if any)
Empties a gallery of all images.
Check if a gallery exists. Need to do this here instead of Horde_Share since Horde_Share::exists() takes a share_name, not a share_id plus we might also be checking by gallery_slug and this is more efficient than a listShares() call for one gallery.
mixed
galleryExists
(integer $gallery_id, [string $slug = null])
-
integer
$gallery_id: The gallery id
-
string
$slug: The gallery slug
Retrieve an array of Ansel_Gallery objects for the requested ids
void
getGalleries
( $ids)
Retrieve an array of Ansel_Gallery objects for the given slugs.
mixed
getGalleriesBySlugs
(array $slugs)
-
array
$slugs: The gallery slugs
Retrieve an Ansel_Gallery given the share id
mixed
&getGallery
(integer $gallery_id, [array $overrides = array()])
-
integer
$gallery_id: The share_id to fetch
-
array
$overrides: An array of attributes that should be overridden when the gallery is returned.
Retrieve an Ansel_Gallery given the gallery's slug
mixed
&getGalleryBySlug
(string $slug, [array $overrides = array()])
-
string
$slug: The gallery slug
-
array
$overrides: An array of attributes that should be overridden when the gallery is returned.
Returns the image corresponding to the given id.
-
integer
$id: The ID of the image to retrieve.
Retrieve json data for an arbitrary list of image ids, not necessarily from the same gallery.
string
getImageJson
(array $images, [string $style = null], [boolean $full = false], [string $image_view = 'mini'], [boolean $view_links = false])
-
array
$images: An array of image ids
-
string
$style: A named gallery style to force if requesting pretty thumbs.
-
boolean
$full: Generate full urls
-
string
$image_view: Which image view to use? screen, thumb etc..
-
boolean
$view_links: Include links to the image view
Returns the images corresponding to the given ids.
array
getImages
(array $ids, [ $preserve_order = false])
-
array
$ids: An array of image ids.
-
$preserve_order
Return images' geolocation data.
mixed
getImagesGeodata
([array $image_ids = array()], [integer $gallery = null])
-
array
$image_ids: An array of image_ids to look up.
-
integer
$gallery: A gallery id. If this is provided, will return all images in the gallery that have geolocation data ($image_ids would be ignored).
Returns a random Ansel_Gallery from a list fitting the search criteria.
void
getRandomGallery
([ $perm = PERMS_SHOW], [ $attributes = null], [ $parent = null], [ $allLevels = true])
-
$perm
-
$attributes
-
$parent
-
$allLevels
Return a list of image ids of the most recently added images.
array
getRecentImages
([array $galleries = array()], [integer $limit = 10], [string $slugs = array()], string $where)
-
array
$galleries: An array of gallery ids to search in. If left empty, will search all galleries with PERMS_SHOW.
-
integer
$limit: The maximum number of images to return
-
string
$slugs: An array of gallery slugs.
-
string
$where: Additional where clause
Like getRecentImages, but returns geotag data for the most recently added images from the current user. Useful for providing images to help locate images at the same place.
void
getRecentImagesGeodata
([ $user = null], [ $start = 0], [ $count = 8])
Return a list of categories containing galleries with the given permissions for the current user.
mixed
listCategories
([integer $perm = PERMS_SHOW], [integer $from = 0], [integer $count = 0])
-
integer
$perm: The level of permissions required.
-
integer
$from: The gallery to start listing at.
-
integer
$count: The number of galleries to return.
Retrieves the current user's gallery list from storage.
mixed
listGalleries
([integer $perm = PERMS_SHOW], [mixed $attributes = null], [mixed $parent = null], [boolean $allLevels = true], [integer $from = 0], [integer $count = 0], [string $sort_by = null], [integer $direction = 0])
-
integer
$perm: The level of permissions to require for a gallery to return it.
-
mixed
$attributes: Restrict the galleries counted to those matching $attributes. An array of attribute/values pairs or a gallery owner username.
-
mixed
$parent: The parent gallery to start listing at. (Ansel_Gallery, gallery id or null)
-
boolean
$allLevels: Return all levels, or just the direct children of $parent?
-
integer
$from: The gallery to start listing at.
-
integer
$count: The number of galleries to return.
-
string
$sort_by: The field to order the results by.
-
integer
$direction: Sort direction:
- - ascending
- - descending
Lists a slice of the image ids in the given gallery.
mixed
listImages
(integer $gallery_id, [integer $from = 0], [integer $count = 0], [mixed $fields = 'image_id'], [string $where = ''], [mixed $sort = 'image_sort'])
-
integer
$gallery_id: The gallery to list from.
-
integer
$from: The image to start listing.
-
integer
$count: The numer of images to list.
-
mixed
$fields: The fields to return (either an array of fileds or a single string).
-
string
$where: A SQL where clause ($gallery_id will be ignored if this is non-empty).
-
mixed
$sort: The field(s) to sort by.
Removes an Ansel_Gallery.
void
searchLocations
([ $search = ''])
Check that a slug exists.
integer
slugExists
(string $slug)
-
string
$slug: The slug name
void
_getImageCommentCounts
( $ids)
Helper function to get a string of field names
string
_getImageFields
([ $alias = ''])