/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 1493)

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 857)

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 265)

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
handleMessageListForm (line 1273)

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()], [string $targetMailbox = ''], [boolean $bypass_trash = NULL], array $aMailbox)
  • resource $imapConnection: imap connection
  • array $aMailbox: (reference) cached mailbox
  • string $sButton: fake a submit button
  • array $aUid: fake the $msg array
  • string $targetMailbox: fake the target mailbox for move operations
  • boolean $bypass_trash: fake the bypass trash checkbox for delete operations
  • &$aMailbox
highlightMessage (line 693)

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 427)

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 733)
void setUserPref ( $username,  $pref,  $value)
  • $username
  • $pref
  • $value
showMessagesForMailbox (line 912)

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 30)

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
_getSortField (line 802)

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 748)

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 Tue, 21 Oct 2014 04:18:35 +0200 by phpDocumentor 1.4.3