X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=templates%2Fdefault%2Fleft_main.tpl;h=2549e805990975595c6694fca1719c08a8c92f22;hp=4d79624b6c85cc3e1111626ef4d2ea73bc0a8714;hb=f197ec8835b64975ff47dc6cd86dae75605baebf;hpb=fddbf0d4cab42fd6502a304369845aecea343c86 diff --git a/templates/default/left_main.tpl b/templates/default/left_main.tpl index 4d79624b..2549e805 100644 --- a/templates/default/left_main.tpl +++ b/templates/default/left_main.tpl @@ -8,12 +8,8 @@ * $clock - formatted string containing last refresh * $settings - Array containing user perferences needed by this * template. Indexes are as follows: - * $settings['imapConnection'] - IMAP connection handle. Needed to - * allow plugins to read the mailbox. - * $settings['iconThemePath'] - Path to the desired icon theme. If - * the user has disabled icons, this will be NULL. - * $settings['templateDirectory'] - contains the path to the current - * template directory. This may be needed by third + * $settings['templateID'] - contains the ID of the current + * template set. This may be needed by third * party packages that don't integrate easily. * $settings['unreadNotificationEnabled'] - Boolean TRUE if the user * wants to see unread message count on mailboxes @@ -65,7 +61,7 @@ * in all folders in this mailbox, * excluding trash folders. * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright 1999-2016 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -73,15 +69,13 @@ * @author Steve Brown */ -// include required files -include_once(SM_PATH . 'templates/util_global.php'); /* * Recursively parse the mailbox structure to build the navigation tree. * * @since 1.5.2 */ -function buildMailboxTree ($box, $settings, $indent_factor=0) { +function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0) { // stop condition if (empty($box)) { return ''; @@ -103,7 +97,7 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { $box['CummulativeUnreadCount'] : $box['UnreadCount']; - if ($unseen > 0) { + if (!$box['IsNoSelect'] && ($unseen > 0 || $settings['unreadNotificationDisplayTotal'])) { $unseen_str = $unseen; // Add the total messages if desired @@ -143,37 +137,46 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { * image based on whatever logic they see fit here. */ $folder_icon = ''; - if (!is_null($settings['iconThemePath'])) { + if (!is_null($icon_theme_path)) { switch (true) { case $box['IsInbox']: - $folder_icon = getIcon($settings['iconThemePath'], 'inbox.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'inbox.png', '', $box['MailboxName']); break; case $box['IsSent']: - $folder_icon = getIcon($settings['iconThemePath'], 'senti.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'senti.png', '', $box['MailboxName']); break; case $box['IsTrash']: - $folder_icon = getIcon($settings['iconThemePath'], 'delitem.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'delitem.png', '', $box['MailboxName']); break; case $box['IsDraft']: - $folder_icon = getIcon($settings['iconThemePath'], 'draft.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'draft.png', '', $box['MailboxName']); break; case $box['IsNoInferiors']: - $folder_icon = getIcon($settings['iconThemePath'], 'folder_noinf.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'folder_noinf.png', '', $box['MailboxName']); break; default: - $folder_icon = getIcon($settings['iconThemePath'], 'folder.png', '', $box['MailboxName']); + $folder_icon = getIcon($icon_theme_path, 'folder.png', '', $box['MailboxName']); break; } $folder_icon .= ' '; } $pre .= $folder_icon; + // calculate if access key is needed + // + if ($box['IsInbox']) { + global $accesskey_folders_inbox; + $accesskey = $accesskey_folders_inbox; + } + else $accesskey = ''; + /* * The Trash folder should only be displayed if message recycling has * been enabled, i.e. when deleted is a message moved to the trash or * deleted forever? */ $view_link = ''; @@ -188,12 +191,12 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { $end .= ''; // Print unread info - if ($box['UnreadCount'] > 0) { + if ($box['MessageCount'] > 0 || count($box['ChildBoxes'])) { if (!empty($unseen_str)) { $end .= ' ('.$unseen_str.')'; } $end .= "\n" . - '  ['. _("Purge").']' . + '  ['. _("Purge").']' . ''; } } else { @@ -215,6 +218,11 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { } } + // Add any extra output that may have been added by plugins, etc + // + if (!empty($box['ExtraOutput'])) + $end .= $box['ExtraOutput']; + $span = ''; $spanend = ''; if ($settings['useSpecialFolderColor'] && $box['IsSpecial']) { @@ -225,11 +233,6 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { $spanend = ''; } - // let plugins fiddle with end of line - $end .= concat_hook_function('left_main_after_each_folder', - array(isset($numMessages) ? $numMessages : '', - $box['MailboxFullName'], $settings['imapConnection'])); - $end .= ''; $out = ''; @@ -245,7 +248,7 @@ function buildMailboxTree ($box, $settings, $indent_factor=0) { if (!$box['IsCollapsed'] || $box['IsRoot']) { for ($i = 0; $i
- +
@@ -267,14 +270,14 @@ extract($t);
- [] + [target="left">]

- + - +