Class Mnemo

Description

Mnemo Base Class.

Located in /lib/Mnemo.php (line 55)


	
			
Method Summary
 integer countMemos ()
 void getDefaultNotepad ([ $permission = PERMS_SHOW])
 array getMemo (string $notepad, string $noteId, [string $passphrase = null])
 void getMenu ([ $returnType = 'object'])
 string getNotePreview (array $note)
 string getPassphrase (string $id)
 void getUserName ( $uid)
 mixed hasPermission (string $permission)
 void initialize ()
 array listMemos ([constant $sortby = MNEMO_SORT_DESC], [constant $sortdir = MNEMO_SORT_ASCEND])
 array listNotepads ([boolean $owneronly = false], [integer $permission = PERMS_SHOW])
 boolean storePassphrase (string $id, string $passphrase)
 integer _rsortByCategory (array $a, array $b)
 integer _rsortByDesc (array $a, array $b)
 integer _rsortByNotepad (array $a, array $b)
 integer _sortByCategory (array $a, array $b)
 integer _sortByDesc (array $a, array $b)
 integer _sortByNotepad (array $a, array $b)
Methods
countMemos (line 108)

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

  • return: The number of notes that the user owns.
integer countMemos ()
getDefaultNotepad (line 194)

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

void getDefaultNotepad ([ $permission = PERMS_SHOW])
  • $permission
getMemo (line 140)

Retrieves a specific note from storage.

  • return: The note.
array getMemo (string $notepad, string $noteId, [string $passphrase = null])
  • 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.
getMenu (line 474)

Builds Mnemo's list of menu items.

void getMenu ([ $returnType = 'object'])
  • $returnType
getNotePreview (line 154)

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

  • return: A few lines of the note for previews or tooltips.
string getNotePreview (array $note)
  • array $note: The note array
getPassphrase (line 383)

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

  • return: The passphrase, if set.
string getPassphrase (string $id)
  • string $id: A note id.
getUserName (line 217)

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

  • since: Mnemo 2.2
void getUserName ( $uid)
  • $uid
hasPermission (line 355)

Returns the specified permission for the current user.

  • return: The value of the specified permission.
  • since: Mnemo 2.1
mixed hasPermission (string $permission)
  • string $permission: A permission, currently only 'max_notes'.
initialize (line 407)

Initial app setup code.

void initialize ()
listMemos (line 70)

Retrieves the current user's note list from storage. This function will also sort the resulting list, if requested.

array listMemos ([constant $sortby = MNEMO_SORT_DESC], [constant $sortdir = MNEMO_SORT_ASCEND])
  • constant $sortby: The field by which to sort. (MNEMO_SORT_DESC, MNEMO_SORT_CATEGORY, MNEMO_SORT_NOTEPAD)
  • constant $sortdir: The direction by which to sort. (MNEMO_SORT_ASC, MNEMO_SORT_DESC)
listNotepads (line 172)

Lists all notepads a user has access to.

  • return: The memo lists.
array listNotepads ([boolean $owneronly = false], [integer $permission = PERMS_SHOW])
  • boolean $owneronly: Only return memo lists that this user owns? Defaults to false.
  • integer $permission: The permission to filter notepads by.
storePassphrase (line 399)

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

  • return: True
boolean storePassphrase (string $id, string $passphrase)
  • string $id: A note id.
  • string $passphrase: The note's passphrase.
_rsortByCategory (line 286)

Comparison function for reverse sorting notes by category.

  • return: -1 if note one is greater, 1 if note two is greater; 0 if they are equal.
integer _rsortByCategory (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.
_rsortByDesc (line 257)

Comparison function for reverse sorting notes by description.

  • return: -1 if note one is greater, 1 if note two is greater; 0 if they are equal.
integer _rsortByDesc (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.
_rsortByNotepad (line 328)

Comparison function for reverse sorting notes by notepad name.

  • return: -1 if note one is greater, 1 if note two is greater;
    1. if they are equal.
integer _rsortByNotepad (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.
_sortByCategory (line 271)

Comparison function for sorting notes by category.

  • return: 1 if note one is greater, -1 if note two is greater; 0 if they are equal.
integer _sortByCategory (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.
_sortByDesc (line 243)

Comparison function for sorting notes by description.

  • return: 1 if memo one is greater, -1 if memo two is greater; 0 if they are equal.
integer _sortByDesc (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.
_sortByNotepad (line 301)

Comparison function for sorting notes by notepad name.

  • return: 1 if note one is greater, -1 if note two is greater;
    1. if they are equal.
integer _sortByNotepad (array $a, array $b)
  • array $a: Note one.
  • array $b: Note two.

Documentation generated on Sun, 30 Jan 2011 05:33:55 +0000 by phpDocumentor 1.4.3