PHP Класс Mnemo, horde

Автор: Jon Parise ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
countMemos ( ) : integer Returns the number of notes in notepads that the current user owns.
getDefaultNotepad ( integer $permission = Horde_Perms::SHOW ) : string Returns the default notepad for the current user at the specified permissions level.
getLabel ( $notepad ) : string Returns the label to be used for a notepad.
getMemo ( string $notepad, string $noteId, string $passphrase = null ) : array Retrieves a specific note from storage.
getNotePreview ( array $note ) : string Get preview text for a note (the first 20 lines or so).
getPassphrase ( string $id ) : string Returns a note's passphrase for symmetric encryption from the session cache.
getSyncNotepads ( boolean $prune = false ) : array Returns the notepads that should be used for syncing.
getUserName ( $uid ) : string Returns the real name, if available, of a user.
hasPermission ( string $permission ) : mixed Returns the specified permission for the current user.
initialize ( ) Initial app setup code.
listMemos ( constant $sortby = self::SORT_DESC, constant $sortdir = self::SORT_ASCEND ) : array Retrieves the current user's note list from storage. This function will also sort the resulting list, if requested.
listNotepads ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW ) : array Lists all notepads a user has access to.
storePassphrase ( string $id, string $passphrase ) : boolean Stores a note's passphrase for symmetric encryption in the session cache.

Защищенные методы

Метод Описание
_rsortByDesc ( array $a, array $b ) : integer Comparison function for reverse sorting notes by description.
_rsortByModDate ( array $a, array $b ) : integer Comparison function for reverse sorting notes by modification date.
_rsortByNotepad ( array $a, array $b ) : integer Comparison function for reverse sorting notes by notepad name.
_sortByDesc ( array $a, array $b ) : integer Comparison function for sorting notes by description.
_sortByModDate ( array $a, array $b ) : integer Comparison function for sorting notes by modification date.
_sortByNotepad ( array $a, array $b ) : integer Comparison function for sorting notes by notepad name.

Описание методов

_rsortByDesc() защищенный статический Метод

Comparison function for reverse sorting notes by description.
protected static _rsortByDesc ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer -1 if note one is greater, 1 if note two is greater; 0 if they are equal.

_rsortByModDate() защищенный статический Метод

Comparison function for reverse sorting notes by modification date.
protected static _rsortByModDate ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer -1 if note one is greater, 1 if note two is greater, 0 if they are equal.

_rsortByNotepad() защищенный статический Метод

Comparison function for reverse sorting notes by notepad name.
protected static _rsortByNotepad ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer -1 if note one is greater, 1 if note two is greater; 0 if they are equal.

_sortByDesc() защищенный статический Метод

Comparison function for sorting notes by description.
protected static _sortByDesc ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer 1 if memo one is greater, -1 if memo two is greater; 0 if they are equal.

_sortByModDate() защищенный статический Метод

Comparison function for sorting notes by modification date.
protected static _sortByModDate ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer 1 if note one is greater, -1 if note two is greater; 0 if they are equal.

_sortByNotepad() защищенный статический Метод

Comparison function for sorting notes by notepad name.
protected static _sortByNotepad ( array $a, array $b ) : integer
$a array Note one.
$b array Note two.
Результат integer 1 if note one is greater, -1 if note two is greater; 0 if they are equal.

countMemos() публичный статический Метод

Returns the number of notes in notepads that the current user owns.
public static countMemos ( ) : integer
Результат integer The number of notes that the user owns.

getDefaultNotepad() публичный статический Метод

Returns the default notepad for the current user at the specified permissions level.
public static getDefaultNotepad ( integer $permission = Horde_Perms::SHOW ) : string
$permission integer Horde_Perms constant for permission level required.
Результат string The notepad identifier, or null if none.

getLabel() публичный статический Метод

Attaches the owner name of shared notepads if necessary.
public static getLabel ( $notepad ) : string
Результат string The notepad's label.

getMemo() публичный статический Метод

Retrieves a specific note from storage.
public static getMemo ( string $notepad, string $noteId, string $passphrase = null ) : array
$notepad string The notepad to retrieve the note from.
$noteId string The Id of the note to retrieve.
$passphrase string A passphrase with which this note was supposed to be encrypted.
Результат array The note.

getNotePreview() публичный статический Метод

Get preview text for a note (the first 20 lines or so).
public static getNotePreview ( array $note ) : string
$note array The note array
Результат string A few lines of the note for previews or tooltips.

getPassphrase() публичный статический Метод

Returns a note's passphrase for symmetric encryption from the session cache.
public static getPassphrase ( string $id ) : string
$id string A note id.
Результат string The passphrase, if set.

getSyncNotepads() публичный статический Метод

Returns the notepads that should be used for syncing.
public static getSyncNotepads ( boolean $prune = false ) : array
$prune boolean Remove notepads ids from the sync list that no longer exist. The values are pruned *after* the results are passed back to the client to give sync clients a chance to remove their entries.
Результат array An array of notepad ids.

getUserName() публичный статический Метод

Returns the real name, if available, of a user.
public static getUserName ( $uid ) : string
Результат string The real name

hasPermission() публичный статический Метод

Returns the specified permission for the current user.
public static hasPermission ( string $permission ) : mixed
$permission string A permission, currently only 'max_notes'.
Результат mixed The value of the specified permission.

initialize() публичный статический Метод

Defines the following $GLOBALS (@TODO these should use the injector) mnemo_shares display_notepads
public static initialize ( )

listMemos() публичный статический Метод

Retrieves the current user's note list from storage. This function will also sort the resulting list, if requested.
См. также: Mnemo_Driver::listMemos()
public static listMemos ( constant $sortby = self::SORT_DESC, constant $sortdir = self::SORT_ASCEND ) : array
$sortby constant The field by which to sort. (self::SORT_DESC, self::SORT_NOTEPAD, self::SORT_MOD_DATE)
$sortdir constant The direction by which to sort. (self::SORT_ASC, self::SORT_DESC)
Результат array A list of the requested notes.

listNotepads() публичный статический Метод

This method takes the $conf['share']['hidden'] setting into account. If this setting is enabled, even if requesting permissions different than SHOW, it will only return calendars that the user owns or has SHOW permissions for. For checking individual calendar's permissions, use hasPermission() instead.
public static listNotepads ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW ) : array
$owneronly boolean Only return memo lists that this user owns? Defaults to false.
$permission integer The permission to filter notepads by.
Результат array The memo lists.

storePassphrase() публичный статический Метод

Stores a note's passphrase for symmetric encryption in the session cache.
public static storePassphrase ( string $id, string $passphrase ) : boolean
$id string A note id.
$passphrase string The note's passphrase.
Результат boolean True