/functions/mailbox_display.php

Description

mailbox_display.php

This contains functions that display mailbox information, such as the table row that has sender, date, subject, etc...

Functions
attachSelectedMessages (line 1407)

Attach messages to a compose session

  • return: unique compose_session_id where the attached messages belong to
  • author: Marc Groot Koerkamp
int attachSelectedMessages (resource $imapConnection, array $aMsgHeaders)
  • resource $imapConnection: imap connection
  • array $aMsgHeaders
calcFetchColumns (line 850)

This function is a utility function for setting which headers should be

fetched. It takes into account the highlight list which requires extra headers to be fetch in order to make those rules work. It's called before the headers are fetched which happens in showMessagesForMailbox and when the next and prev links in read_body.php are used.

  • since: 1.5.1
void calcFetchColumns ( &$aMailbox,  &$aProps, array $aMailbox, array $aProps)
  • array $aMailbox: associative array with mailbox related vars
  • array $aProps
  • &$aMailbox
  • &$aProps
fetchMessageHeaders (line 263)

Fetch the message headers for a mailbox. Settings are part of the aMailbox array. Dependent of the mailbox settings it deals with sort, thread and search If server sort is supported then SORT is also used for retrieving sorted search results

  • return: error number
  • author: Marc Groot Koerkamp
  • since: 1.5.1
error fetchMessageHeaders (resource $imapConnection,  &$aMailbox, array $aMailbox)
  • resource $imapConnection: imap socket handle
  • array $aMailbox: (reference) mailbox retrieved from sqm_api_mailbox_select
  • &$aMailbox
handleAsSent (line 1210)

This should go in imap_mailbox.php

void handleAsSent (string $mailbox)
  • string $mailbox
handleMessageListForm (line 1236)

Process messages list form and handle the cache gracefully. If $sButton and $aUid are provided as argument then you can fake a message list submit and use it i.e. in read_body.php for del move next and update the cache

  • return: error string in case of an error
  • author: Marc Groot Koerkamp
  • since: 1.5.1
string handleMessageListForm (resource $imapConnection,  &$aMailbox, [string $sButton = ''], [array $aUid = array()], array $aMailbox)
  • resource $imapConnection: imap connection
  • array $aMailbox: (reference) cached mailbox
  • string $sButton: fake a submit button
  • array $aUid: fake the $msg array
  • &$aMailbox
highlightMessage (line 686)

Sets the row color if the provided column value pair matches a hightlight rule

  • return: match found
  • author: Marc Groot Koerkamp
  • since: 1.5.1
bool highlightMessage (string $sCol, string $sVal, array $highlight_list,  &$aFormat, array $aFormat)
  • string $sCol: column name
  • string $sVal: column value
  • array $highlight_list: highlight rules
  • array $aFormat: (reference) array where row color info is stored
  • &$aFormat
prepareMessageList (line 425)

Prepares the message headers for display inside a template. The links are calculated, color for row highlighting is calculated and optionally the strings are truncated.

  • return: array with message headers and format info
  • author: Marc Groot Koerkamp
  • since: 1.5.1
array prepareMessageList ( &$aMailbox, array $aProps, array $aMailbox)
  • array $aMailbox: (reference) mailbox retrieved from sqm_api_mailbox_select
  • array $aProps: properties
  • &$aMailbox
setUserPref (line 726)
void setUserPref ( $username,  $pref,  $value)
  • $username
  • $pref
  • $value
showMessagesForMailbox (line 905)

This function loops through a group of messages in the mailbox and shows them to the user.

void showMessagesForMailbox (resource $imapConnection,  &$aMailbox, array $aProps,  &$iError, array $aMailbox, int $iError)
  • resource $imapConnection
  • array $aMailbox: associative array with mailbox related vars
  • array $aProps
  • int $iError: error code, 0 is no error
  • &$aMailbox
  • &$iError
sqm_api_mailbox_select (line 28)

Selects a mailbox for header retrieval.

Cache control for message headers is embedded.

  • return: mailbox array with all relevant information
  • author: Marc Groot Koerkamp
  • since: 1.5.1
array sqm_api_mailbox_select (resource $imapConnection,  $account, string $mailbox, array $aConfig, array $aProps)
  • resource $imapConnection: imap socket handle
  • string $mailbox: mailbox to select and retrieve message headers from
  • array $aConfig: array with system config settings and incoming vars
  • array $aProps: mailbox specific properties
  • $account
truncateWithEntities (line 1166)

Truncates a string and take care of html encoded characters

  • return: Trimmed string
string truncateWithEntities (string $s, int $iTrimAt)
  • string $s: string to truncate
  • int $iTrimAt: Trim at nn characters
_getSortField (line 795)

Does the $srt $_GET var to field mapping

  • return: Field to sort on
  • private:
  • since: 1.5.1
string _getSortField ( $sort, bool $bServerSort, int $srt)
  • int $srt: Field to sort on
  • bool $bServerSort: Server sorting is true
  • $sort
_get_sorted_msgs_list (line 741)

Execute the sorting for a mailbox

  • return: (reference) Error number
  • author: Marc Groot Koerkamp
  • since: 1.5.1
  • private:
int _get_sorted_msgs_list (resource $imapConnection,  &$aMailbox, array $aMailbox)
  • resource $imapConnection: Imap connection
  • array $aMailbox: (reference) Mailbox retrieved with sqm_api_mailbox_select
  • &$aMailbox

Documentation generated on Sat, 07 Oct 2006 16:12:13 +0300 by phpDocumentor 1.3.0RC6