Source for file folder_list_util.php
Documentation is available at folder_list_util.php
* Provides some functions for use in left_main.php and templates. Do not echo
* output from these functions!
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: folder_list_util.php 14845 2020-01-07 08:09:34Z pdontthink $
* Recursively iterates a mailboxes object to get the cummulative count of
* messages for all folderes below the current mailbox.
* @param object $boxes Object of the class mailboxes
* @param string $type Whether to fetch unseen only or all messages
// The Trash folder isn't counted...
if ($boxes->mailboxname_full ==
$trash_folder)
$count +=
!empty($boxes->{$field}) ?
$boxes->{$field} :
0;
for ($j =
0; $j <
count($boxes->mbxs); $j++
) {
* Recursively iterates a mailboxes object to build a data structure that is
* easy for template authors to work with.
FIXME: well.... why not document that data structure here?
* @param object $boxes Object of the class mailboxes
global $data_dir, $username, $icon_theme_path;
$mailbox =
$boxes->mailboxname_full;
$box['MailboxFullName'] =
$mailbox;
$box['MailboxName'] =
$boxes->mailboxname_sub;
$box['MessageCount'] =
!empty($boxes->total) ?
$boxes->total :
0;
$box['UnreadCount'] =
!empty($boxes->unseen) ?
$boxes->unseen :
0;
// Needed in case user enables cummulative message counts
$box['ViewLink'] =
array( 'Target' =>
'right',
'URL' =>
'right_main.php?PG_SHOWALL=0&startMessage=1&mailbox='.
$mailboxURL
$box['IsRecent'] = isset
($boxes->recent) &&
$boxes->recent;
$box['IsSpecial'] = isset
($boxes->is_special) &&
$boxes->is_special;
$box['IsRoot'] = isset
($boxes->is_root) &&
$boxes->is_root;
$box['IsNoSelect'] = isset
($boxes->is_noselect) &&
$boxes->is_noselect;
$box['IsInbox'] = isset
($boxes->is_inbox) &&
$boxes->is_inbox;
$box['IsSent'] = isset
($boxes->is_sent) &&
$boxes->is_sent;
$box['IsTrash'] = isset
($boxes->is_trash) &&
$boxes->is_trash;
$box['IsDraft'] = isset
($boxes->is_draft) &&
$boxes->is_draft;
$box['IsNoInferiors'] = isset
($boxes->is_noinferiors) &&
$boxes->is_noinferiors;
$collapse =
getPref($data_dir, $username, 'collapse_folder_' .
$mailbox);
$box['IsCollapsed'] =
$collapse;
* Check for an image needed here. If the file exists in $icon_theme_path
* assume the template provides all icons. If not, we will use the
* SQM default images. If icons have been disabled, $icon_theme_path
$text_icon =
$box['IsCollapsed'] ?
'+' :
'-';
$icon_file =
$box['IsCollapsed'] ?
'plus.png' :
'minus.png';
$icon_alt =
$box['IsCollapsed'] ?
'Expand Box' :
'Collapse Box';
$icon =
getIcon($icon_theme_path, $icon_file, $text_icon, $icon_alt);
$box['CollapseLink'] =
array ( 'Target' =>
'left',
'URL' =>
'left_main.php?'.
($box['IsCollapsed'] ?
'unfold' :
'fold') .
'='.
$mailboxURL,
'Icon' =>
$icon .
' '
$box['ChildBoxes'] =
array();
for ($i =
0; $i <
count($boxes->mbxs); $i++
) {
// if plugins want to add some text or link after the folder name in
// the folder list, they should add to the "ExtraOutput" array element
// in $box (remember, it's passed through the hook by reference) -- making
// sure to play nice with other plugins by *concatenating* to "ExtraOutput"
// and NOT by overwriting it
// known users of this hook:
do_hook('left_main_after_each_folder', $box);
Documentation generated on Mon, 13 Jan 2020 04:22:31 +0100 by phpDocumentor 1.4.3