PHP Class Trean_Api, horde

This file defines Trean's external API interface. Other applications can interact with Trean through this API. Copyright 2002-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Author: Mike Cochrane ([email protected])
Inheritance: extends Horde_Registry_Api
Afficher le fichier Open project: horde/horde

Méthodes publiques

Méthode Description
deleteBookmark ( integer $bookmarkId ) Delete a given bookmark.
deleteBookmarks ( array $bookmarkIds ) Delete multiple bookmarks.
getAddUrl ( array $params = [] ) : string Returns a URL that can be used in other applications to add the currently displayed page as a bookmark. If javascript and DOM is available, an overlay is used, if javascript and no DOM, then a pop-up is used and if no javascript is available a URL to Trean's add.php page is returned.
listTagInfo ( array $tags = null, string $user = null ) : array Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array SearchTags API: Returns an application-agnostic array (useful for when doing a tag search across multiple applications)

Method Details

deleteBookmark() public méthode

Delete a given bookmark.
public deleteBookmark ( integer $bookmarkId )
$bookmarkId integer The ID of the bookmark to delete

deleteBookmarks() public méthode

Delete multiple bookmarks.
public deleteBookmarks ( array $bookmarkIds )
$bookmarkIds array The IDs of the bookmarks to delete

getAddUrl() public méthode

Returns a URL that can be used in other applications to add the currently displayed page as a bookmark. If javascript and DOM is available, an overlay is used, if javascript and no DOM, then a pop-up is used and if no javascript is available a URL to Trean's add.php page is returned.
public getAddUrl ( array $params = [] ) : string
$params array A hash of 'url' and 'title' properties of the requested bookmark.
Résultat string The URL suitable for use in a tag.

listTagInfo() public méthode

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
public listTagInfo ( array $tags = null, string $user = null ) : array
$tags array An optional array of tag_ids. If omitted, all tags will be included.
$user string Restrict result to those tagged by $user.
Résultat array An array containing tag_name, and total

searchTags() public méthode

The 'raw' results array can be returned instead by setting $raw = true.
public searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array
$names array An array of tag_names to search for.
$max integer The maximum number of resources to return.
$from integer The number of the resource to start with.
$resource_type string The resource type [bookmark, '']
$user string Restrict results to resources owned by $user.
$raw boolean Return the raw data?
Résultat array An array of results:
 'title'    - The title for this resource.
 'desc'     - A terse description of this resource.
 'view_url' - The URL to view this resource.
 'app'      - The Horde application this resource belongs to.