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

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

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

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

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

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

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

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

Selects a mailbox for header retrieval.

Cache control for message headers is embedded.

  • return: mailbox array with all relevant information (if $handle_errors is false and there was an error, the array will be empty)
  • author: Marc Groot Koerkamp
  • since: 1.5.1
array sqm_api_mailbox_select (resource $imapConnection,  $account, string $mailbox, array $aConfig, array $aProps, [boolean $handle_errors = true])
  • 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
  • boolean $handle_errors: When TRUE, IMAP errors are handled herein, causing an error to be displayed on screen and execution to stop and when FALSE, error status is returned to the caller (OPTIONAL; default is TRUE)
  • $account
_getSortField (line 815)

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

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 Mon, 13 Jan 2020 04:22:58 +0100 by phpDocumentor 1.4.3