PHP 클래스 Mnemo, horde

저자: Jon Parise ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 메소드들

메소드 설명
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