Class Trean_Api
Trean external API interface.
This file defines Trean's external API interface. Other
applications can interact with Trean through this API.
$Horde: trean/lib/Api.php,v 1.2 2009-11-29 15:52:17 chuck Exp $
Copyright 2002-2012 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.
-
Horde_Registry_Api
-
Trean_Api
Methods summary
public
array
|
#
getFolders( integer $folderId )
Gets all of the folders that are a subfolder of the given folder
(or the root.)
Gets all of the folders that are a subfolder of the given folder
(or the root.)
Parameters
- $folderId
- the ID of the folder, or -1 for the root
Returns
array Array of associative arrays (XMLRPC structs) with
'id' as the folder's ID, and 'name' as its name.
|
public
|
#
addObjects( array $data )
Adds a bookmark folder
Parameters
|
public
|
#
updateObjects( array $data )
Updates a bookmark folder
Updates a bookmark folder
Parameters
|
public
array
|
#
listBookmarks( integer $folderId, string $sortby = 'title', integer $sortdir = 0, integer $from = 0, integer $count = 0 )
Returns all the bookmarks in a given folder, sorted and "paginated."
Returns all the bookmarks in a given folder, sorted and "paginated."
Parameters
- $folderId
- the ID of a folder, or -1 for root
- $sortby
- field to sort by
- $sortdir
- direction to sort by (non-0 for descending)
- $from
- bookmark to start from
- $count
- how many bookmarks to return
Returns
array An array of associative arrays (XMLRPC structs) representing
the bookmarks.
See
|
public
boolean
|
#
deleteFolder( integer $folderId, boolean $force )
Delete a given folder.
Parameters
- $folderId
- the ID of the folder
- $force
- Force-remove child objects? (currently ignored)
Returns
boolean True for success.
|
public
boolean
|
#
deleteFolders( array $Ids )
Delete multiple folders.
Parameters
- $Ids
- The IDs of the folders to delete
Returns
boolean True for success.
|
public
boolean
|
#
deleteBookmark( integer $bookmarkId )
Delete a given bookmark.
Parameters
- $bookmarkId
- the ID of the bookmark to delete
Returns
boolean True for success.
|
public
boolean
|
#
deleteBookmarks( array $Ids )
Delete multiple bookmarks.
Delete multiple bookmarks.
Parameters
- $Ids
- the IDs of the bookmarks to delete
Returns
boolean True for success.
|
public
array
|
#
syncBookmarks( integer $folderId, array $bookmarkIds )
Synchronize bookmarks in a folder. Send a list of IDs of bookmarks you
know about, get an array of new bookmarks and placeholders for bookmarks
you have that are now deleted.
Synchronize bookmarks in a folder. Send a list of IDs of bookmarks you
know about, get an array of new bookmarks and placeholders for bookmarks
you have that are now deleted.
Parameters
- $folderId
- the ID of the folder, or -1 for root
- $bookmarkIds
- integer array of the bookmark IDs to sync against
Returns
array An array of associative arrays (XMLRPC structs) of all the
newly created bookmarks' data, or for deleted bookmarks, a placeholder with
'id' as the ID of the bookmark and 'sync_deleted' as true.
See
|
public
array
|
#
syncFolders( integer $folderId, array $folderIds )
Synchronize folders in a folder. Send a list of IDs, get a list of new
folders and placeholders for deleted ones. See syncBookmarks()
for more details.
Synchronize folders in a folder. Send a list of IDs, get a list of new
folders and placeholders for deleted ones. See syncBookmarks()
for more details.
Parameters
- $folderId
- the ID of the folder, or -1 for root
- $folderIds
- integer array of folder IDs to sync against
Returns
array An array of associate arrays (XMLRPC structs) of all
the newly created folders' data, or placeholders for deleted folders.
See
|
public
string
|
#
getAddUrl( array $params = array() )
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.
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.
Parameters
- $params
- <p>A hash of 'url' and 'title' properties of the requested
bookmark.</p>
Returns
string The URL suitable for use in a tag.
|