Overview

Packages

  • None
  • Trean

Classes

  • DataTreeObject_Folder
  • SearchForm
  • Trean
  • Trean_Bookmark
  • Trean_Bookmarks
  • Overview
  • Package
  • Class
  • Tree

Class Trean_Bookmarks

Copyright 2004-2012 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (BSD). If you did not did not receive this file, see http://www.horde.org/licenses/bsdl.php.

Package: Trean
Author: Ben Chavet ben@horde.org
Located at Bookmarks.php
Methods summary
public
# Trean_Bookmarks( )

Constructor.

Constructor.

public
# searchBookmarks( mixed $search_criteria, mixed $search_operator = 'OR', mixed $sortby = 'title', mixed $sortdir = 0, mixed $from = 0, mixed $count = 0 )

Search all folders that the user has permissions to.

Search all folders that the user has permissions to.

public
# sortBookmarks( mixed $sortby = 'title', mixed $sortdir = 0, mixed $from = 0, mixed $count = 10 )

Sort bookmarks from all folders the user can access by a specific criteria.

Sort bookmarks from all folders the user can access by a specific criteria.

public integer
# countBookmarks( )

Returns the number of bookmarks in all folders.

Returns the number of bookmarks in all folders.

Returns

integer
The number of all bookmarks.
public
# groupBookmarks( mixed $groupby )

Return counts on grouping bookmarks by a specific property.

Return counts on grouping bookmarks by a specific property.

public array
# getShares( array $cids )

Returns an array of DataTreeObject_Folder objects corresponding to the given set of unique IDs, with the details retrieved appropriately.

Returns an array of DataTreeObject_Folder objects corresponding to the given set of unique IDs, with the details retrieved appropriately.

Parameters

$cids
The array of ids to retrieve.

Returns

array
The requested shares.
public boolean
# exists( string $share )

Checks if a share exists in the system.

Checks if a share exists in the system.

Parameters

$share
The share to check.

Returns

boolean
True if the share exists, false otherwise.
public array
# listFolders( string $userid, integer $perm = Horde_Perms::SHOW, string $parent = null, boolean $allLevels = true )

Returns the folder ids that $userid has access to.

Returns the folder ids that $userid has access to.

Parameters

$userid
The userid of the user to check access for.
$perm
The level of permissions required.
$parent
The parent share to start searching at.
$allLevels
<p>Return all levels, or just the direct children of $parent? Defaults to all levels.</p>

Returns

array
The folder ids $userid has access to.
public array
# getFolders( string $userid, integer $perm = Horde_Perms::SHOW, string $parent = null, boolean $allLevels = true )

Returns an array of all folders that $userid has access to.

Returns an array of all folders that $userid has access to.

Parameters

$userid
The userid of the user to check access for.
$perm
The level of permissions required.
$parent
The parent share to start searching at.
$allLevels
<p>Return all levels, or just the direct children of $parent? Defaults to all levels.</p>

Returns

array
The shares the user has access to.
public DataTreeObject_Folder
# newFolder( string $name, array $properties = null )

Returns a new folder object.

Returns a new folder object.

Parameters

$name
The folder's internal name.
$properties
<p>The folder's initial properties. If set, a 'name' value is expected.</p>

Returns

DataTreeObject_Folder
A new folder object.
public DataTreeObject_Folder
# getFolder( string $cid )

Returns a DataTreeObject_Folder object corresponding to the given unique ID, with the details retrieved appropriately.

Returns a DataTreeObject_Folder object corresponding to the given unique ID, with the details retrieved appropriately.

Parameters

$cid
The id of the folder to retrieve.

Returns

DataTreeObject_Folder
The requested folder.
public Trean_Bookmark
# getBookmark( integer $id )

Returns the bookmark corresponding to the given id.

Returns the bookmark corresponding to the given id.

Parameters

$id
The ID of the bookmark to retrieve.

Returns

Trean_Bookmark
The bookmark object corresponding to the given name.
public
# addFolder( DataTreeObject_Folder $folder )

Stores a new folder permanently.

Stores a new folder permanently.

Parameters

$folder
The folder to add.
public
# removeFolder( DataTreeObject_Folder $folder, boolean $force = false )

Removes a folder.

Removes a folder.

Parameters

$folder
<p>The folder to remove.</p>
$force
<p>Force the removal of every child?</p>
public
# removeBookmark( Trean_Bookmark $bookmark )

Removes a Trean_Bookmark from the backend.

Removes a Trean_Bookmark from the backend.

Parameters

$bookmark
The bookmark to remove.
public integer
# getId( string $name )

Returns the id of the folder $name.

Returns the id of the folder $name.

Parameters

$name
A folder name.

Returns

integer
A folder id.
public
# move( mixed $folder, mixed $new_parent )

Move $folder to be a child of $new_parent.

Move $folder to be a child of $new_parent.

public
# resultSet( mixed $bookmarks )

Create Trean_Bookmark objects for each row in a SQL result.

Create Trean_Bookmark objects for each row in a SQL result.

public
# _sortShares( mixed $a, mixed $b )

Utility function to be used with uasort() for sorting arrays of Trean_Bookmarks objects. Example:

uasort($list, array('Trean_Bookmarks', '_sortShares'));

Utility function to be used with uasort() for sorting arrays of Trean_Bookmarks objects. Example:

uasort($list, array('Trean_Bookmarks', '_sortShares'));
public array
# _getShareCriteria( string $userid, integer $perm = Horde_Perms::SHOW )

Returns an array of criteria for querying shares.

Returns an array of criteria for querying shares.

Parameters

$userid
The userid of the user to check access for.
$perm
The level of permissions required.

Returns

array
The criteria tree for fetching this user's shares.
Properties summary
public Horde_DataTree $_datatree

Pointer to a Horde_DataTree instance to manage/store shares

Pointer to a Horde_DataTree instance to manage/store shares

#
public array $_cache

A cache of all shares that have been retrieved, so we don't hit the backend again and again for them.

A cache of all shares that have been retrieved, so we don't hit the backend again and again for them.

# array()
public array $_shareMap

Id-name-map of already cached share objects.

Id-name-map of already cached share objects.

# array()
public array $_listcache

Cache used for listFolders/getFolders().

Cache used for listFolders/getFolders().

# array()
public array $_counts

Caches the number of share matching certain criteria.

Caches the number of share matching certain criteria.

See

countShares()
# array()
public array $_sortList

A list of objects that we're currently sorting, for reference during the sorting algorithm.

A list of objects that we're currently sorting, for reference during the sorting algorithm.

#
API documentation generated by ApiGen