Overview

Packages

  • Ansel
  • None

Classes

  • Ansel
  • Ansel_Ajax_Application
  • Ansel_Ajax_Imple_EditCaption
  • Ansel_Ajax_Imple_EditFaces
  • Ansel_Ajax_Imple_EditGalleryFaces
  • Ansel_Ajax_Imple_Embed
  • Ansel_Ajax_Imple_GallerySlugCheck
  • Ansel_Ajax_Imple_ImageSaveGeotag
  • Ansel_Ajax_Imple_LocationAutoCompleter
  • Ansel_Ajax_Imple_MapLayerSelect
  • Ansel_Ajax_Imple_TagActions
  • Ansel_Ajax_Imple_ToggleGalleryActions
  • Ansel_Ajax_Imple_ToggleOtherGalleries
  • Ansel_Ajax_Imple_UploadNotification
  • Ansel_Api
  • Ansel_Exception
  • Ansel_Faces
  • Ansel_Faces_Base
  • Ansel_Faces_Facedetect
  • Ansel_Faces_User
  • Ansel_Factory_Faces
  • Ansel_Factory_Storage
  • Ansel_Factory_Styles
  • Ansel_Form_Ecard
  • Ansel_Form_Image
  • Ansel_Form_ImageDate
  • Ansel_Form_Upload
  • Ansel_Gallery
  • Ansel_Gallery_Decorator_Date
  • Ansel_GalleryMode_Base
  • Ansel_GalleryMode_Date
  • Ansel_GalleryMode_Normal
  • Ansel_Image
  • Ansel_ImageGenerator
  • Ansel_ImageGenerator_Mini
  • Ansel_ImageGenerator_PolaroidThumb
  • Ansel_ImageGenerator_PolaroidThumbStack
  • Ansel_ImageGenerator_RoundedThumb
  • Ansel_ImageGenerator_RoundedThumbStack
  • Ansel_ImageGenerator_Screen
  • Ansel_ImageGenerator_ShadowThumb
  • Ansel_ImageGenerator_ShadowThumbStack
  • Ansel_ImageGenerator_SquareThumb
  • Ansel_ImageGenerator_Thumb
  • Ansel_LoginTasks_SystemTask_Upgrade
  • Ansel_Report
  • Ansel_Report_letter
  • Ansel_Report_mail
  • Ansel_Report_tickets
  • Ansel_Search
  • Ansel_Search_exif
  • Ansel_Search_Tag
  • Ansel_Storage
  • Ansel_Style
  • Ansel_Tagger
  • Ansel_Test
  • Ansel_Tile_DateGallery
  • Ansel_Tile_Gallery
  • Ansel_Tile_Image
  • Ansel_View_Ansel
  • Ansel_View_Base
  • Ansel_View_EmbeddedRenderer_GalleryLink
  • Ansel_View_EmbeddedRenderer_Mini
  • Ansel_View_EmbeddedRenderer_Slideshow
  • Ansel_View_Gallery
  • Ansel_View_GalleryProperties
  • Ansel_View_GalleryRenderer_Base
  • Ansel_View_GalleryRenderer_Gallery
  • Ansel_View_GalleryRenderer_GalleryLightbox
  • Ansel_View_Image
  • Ansel_View_List
  • Ansel_View_Results
  • Ansel_View_Slideshow
  • Ansel_View_Upload
  • Ansel_Widget
  • Ansel_Widget_Actions
  • Ansel_Widget_Base
  • Ansel_Widget_GalleryFaces
  • Ansel_Widget_Geotag
  • Ansel_Widget_ImageFaces
  • Ansel_Widget_Links
  • Ansel_Widget_OtherGalleries
  • Ansel_Widget_OwnerFaces
  • Ansel_Widget_SimilarPhotos
  • Ansel_Widget_Tags
  • Ansel_XPPublisher
  • Overview
  • Package
  • Class
  • Tree

Class Ansel_Tagger

The Ansel_Tagger:: class wraps Ansel's interaction with the Content/Tagger system.

Copyright 2010-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.

Package: Ansel
Category: Horde
License: GPL
Author: Michael J Rubinsky mrubinsk@horde.org
Located at Tagger.php
Methods summary
public Ansel_Tagger
# __construct( Content_Tagger $tagger )

Constructor.

Constructor.

Returns

Ansel_Tagger
public
# tag( string $localId, string|array $tags, string $owner, string $content_type = 'image' )

Tags an ansel object with any number of tags.

Tags an ansel object with any number of tags.

Parameters

$localId
The identifier of the ansel object.
$tags
<p>Either a single tag string or an array of tags.</p>
$owner
<p>The tag owner (should normally be the owner of the resource).</p>
$content_type
<p>The type of object we are tagging (gallery/image).</p>

Throws

Ansel_Exception
public array
# getTags( mixed $localId, string $type = 'image' )

Retrieves the tags on given object(s).

Retrieves the tags on given object(s).

Parameters

$localId
<p>Either the identifier of the ansel object or an array of identifiers.</p>
$type
The type of object $localId represents.

Returns

array
A tag_id => tag_name hash, possibly wrapped in a localid hash.

Throws

Ansel_Exception
public array
# browseTags( array $tags, string $user )

Retrieve a set of tags that are related to the specifed set. A tag is related if resources tagged with the specified set are also tagged with the tag being considered. Used to "browse" tagged resources.

Retrieve a set of tags that are related to the specifed set. A tag is related if resources tagged with the specified set are also tagged with the tag being considered. Used to "browse" tagged resources.

Parameters

$tags
<p>An array of tags to check. This would represent the current "directory" of tags while browsing.</p>
$user
The resource must be owned by this user.

Returns

array
An tag_id => tag_name hash
public array
# getTagIds( string|array $tags )

Get tag ids for the specified tag names.

Get tag ids for the specified tag names.

Parameters

$tags
Either a tag_name or array of tag_names.

Returns

array
A tag_id => tag_name hash.

Throws

Ansel_Exception
public
# untag( string $localId, mixed $tags, string $content_type = 'image' )

Untag a resource.

Untag a resource.

Removes the tag regardless of the user that added the tag.

Parameters

$localId
The ansel object identifier.
$tags
Either a tag_id, tag_name or an array.
$content_type
The type of object that $localId represents.
public
# replaceTags( string $localId, mixed $tags, string $owner, mixed $content_type = 'image' )

Tags the given resource with only the tags provided, removing any tags that are already present but not in the list.

Tags the given resource with only the tags provided, removing any tags that are already present but not in the list.

Parameters

$localId
The identifier for the ansel object.
$tags
Either a tag_id, tag_name, or array of tag_ids.
$owner
<p>The tag owner - should normally be the resource owner.</p>
$content_type
type of object that $localId represents.
public array
# listTags( string $token )

Returns tags belonging to the current user beginning with $token.

Returns tags belonging to the current user beginning with $token.

Used for autocomplete code.

Parameters

$token
The token to match the start of the tag with.

Returns

array
A tag_id => tag_name hash

Throws

Ansel_Exception
public Array
# getCloud( string $user, integer $limit = 5 )

Returns the data needed to build a tag cloud based on the specified user's tag dataset.

Returns the data needed to build a tag cloud based on the specified user's tag dataset.

Parameters

$user
<p>The user whose tags should be included. If null, all users' tags are returned.</p>
$limit
The maximum number of tags to include.

Returns

Array
An array of hashes, each containing tag_id, tag_name, and count.

Throws

Ansel_Exception
public array
# getTagInfo( array $tags = null, integer $limit = 500, mixed $type = null, mixed $user = null )

Returns cloud-like information, but only for a specified set of tags. Useful for displaying the counts of other images tagged with the same tag as the currently displayed image.

Returns cloud-like information, but only for a specified set of tags. Useful for displaying the counts of other images tagged with the same tag as the currently displayed image.

Parameters

$tags
An array of either tag names or ids.
$limit
Limit results to this many.
$type
$user

Returns

array
An array of hashes, tag_id, tag_name, and count.

Throws

Ansel_Exception
public A
# search( array $tags, array $filter = array() )

Searches for resources that are tagged with all of the requested tags.

Searches for resources that are tagged with all of the requested tags.

Parameters

$tags
Either a tag_id, tag_name or an array.
$filter
<p>Array of filter parameters. - type (string) - 'gallery' or 'image' - user (array) - only include objects owned by these users.</p>

Returns

A
hash of 'gallery' and 'image' ids.

Throws

Ansel_Exception
public array
# listRelatedImages( Ansel_Image $image, bolean $ownerOnly = true )

List image ids of images related (via similar tags) to the specified image

List image ids of images related (via similar tags) to the specified image

Parameters

$image
The image to get related images for.
$ownerOnly
<p>Only return images owned by the specified image's owner.</p>

Returns

array
An array of 'image' and 'rank' keys..
API documentation generated by ApiGen