Constants

SORT_DESC

SORT_DESC

Sort by memo description.

SORT_NOTEPAD

SORT_NOTEPAD

Sort by notepad.

SORT_MOD_DATE

SORT_MOD_DATE

Sort by moddate

SORT_ASCEND

SORT_ASCEND

Sort in ascending order.

SORT_DESCEND

SORT_DESCEND

Sort in descending order.

ERR_NO_PASSPHRASE

ERR_NO_PASSPHRASE

No passphrase provided.

ERR_DECRYPT

ERR_DECRYPT

Decrypting failed

Methods

listMemos()

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.

Parameters

\constant $sortby

The field by which to sort. (self::SORT_DESC, self::SORT_NOTEPAD, self::SORT_MOD_DATE)

\constant $sortdir

The direction by which to sort. (self::SORT_ASC, self::SORT_DESC)

Returns

array —

A list of the requested notes.

countMemos()

countMemos() : integer

Returns the number of notes in notepads that the current user owns.

Returns

integer —

The number of notes that the user owns.

getMemo()

getMemo(string  $notepad, string  $noteId, string  $passphrase = null) : array

Retrieves a specific note from storage.

Parameters

string $notepad

The notepad to retrieve the note from.

string $noteId

The Id of the note to retrieve.

string $passphrase

A passphrase with which this note was supposed to be encrypted.

Returns

array —

The note.

getNotePreview()

getNotePreview(array  $note) : string

Get preview text for a note (the first 20 lines or so).

Parameters

array $note

The note array

Returns

string —

A few lines of the note for previews or tooltips.

listNotepads()

listNotepads(boolean  $owneronly = false, integer  $permission = \Horde_Perms::SHOW) : array

Lists all notepads a user has access to.

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.

Parameters

boolean $owneronly

Only return memo lists that this user owns? Defaults to false.

integer $permission

The permission to filter notepads by.

Returns

array —

The memo lists.

getDefaultNotepad()

getDefaultNotepad(integer  $permission = \Horde_Perms::SHOW) : string

Returns the default notepad for the current user at the specified permissions level.

Parameters

integer $permission

Horde_Perms constant for permission level required.

Returns

string —

The notepad identifier, or null if none.

getLabel()

getLabel(  $notepad) : string

Returns the label to be used for a notepad.

Attaches the owner name of shared notepads if necessary.

Parameters

$notepad

Returns

string —

The notepad's label.

getUserName()

getUserName(  $uid) : string

Returns the real name, if available, of a user.

Parameters

$uid

Returns

string —

The real name

hasPermission()

hasPermission(string  $permission) : mixed

Returns the specified permission for the current user.

Parameters

string $permission

A permission, currently only 'max_notes'.

Returns

mixed —

The value of the specified permission.

getPassphrase()

getPassphrase(string  $id) : string

Returns a note's passphrase for symmetric encryption from the session cache.

Parameters

string $id

A note id.

Returns

string —

The passphrase, if set.

storePassphrase()

storePassphrase(string  $id, string  $passphrase) : boolean

Stores a note's passphrase for symmetric encryption in the session cache.

Parameters

string $id

A note id.

string $passphrase

The note's passphrase.

Returns

boolean —

True

initialize()

initialize() 

Initial app setup code.

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

getSyncNotepads()

getSyncNotepads(boolean  $prune = false) : array

Returns the notepads that should be used for syncing.

Parameters

boolean $prune

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.

Returns

array —

An array of notepad ids.

_sortByDesc()

_sortByDesc(array  $a, array  $b) : integer

Comparison function for sorting notes by description.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

1 if memo one is greater, -1 if memo two is greater; 0 if they are equal.

_rsortByDesc()

_rsortByDesc(array  $a, array  $b) : integer

Comparison function for reverse sorting notes by description.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

-1 if note one is greater, 1 if note two is greater; 0 if they are equal.

_sortByNotepad()

_sortByNotepad(array  $a, array  $b) : integer

Comparison function for sorting notes by notepad name.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

1 if note one is greater, -1 if note two is greater; 0 if they are equal.

_rsortByNotepad()

_rsortByNotepad(array  $a, array  $b) : integer

Comparison function for reverse sorting notes by notepad name.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

-1 if note one is greater, 1 if note two is greater; 0 if they are equal.

_sortByModDate()

_sortByModDate(array  $a, array  $b) : integer

Comparison function for sorting notes by modification date.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

1 if note one is greater, -1 if note two is greater; 0 if they are equal.

_rsortByModDate()

_rsortByModDate(array  $a, array  $b) : integer

Comparison function for reverse sorting notes by modification date.

Parameters

array $a

Note one.

array $b

Note two.

Returns

integer —

-1 if note one is greater, 1 if note two is greater, 0 if they are equal.