Happy New Year
[squirrelmail.git] / templates / default / left_main.tpl
index 92e903034c950d89c853f09c85195b603a45bc81..a8201af37c161622fa3011a57187c4e87f75dbde 100644 (file)
@@ -61,7 +61,7 @@
  *                                            in all folders in this mailbox,
  *                                            excluding trash folders.
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2020 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -69,8 +69,6 @@
  * @author Steve Brown
  */
 
-/** include required files */
-include_once(SM_PATH . 'templates/util_global.php');
 
 /*
  * Recursively parse the mailbox structure to build the navigation tree.
@@ -139,7 +137,7 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $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($icon_theme_path, 'inbox.png', '', $box['MailboxName']);
@@ -164,13 +162,23 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0)
     }
     $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 = '<a href="'.$box['ViewLink']['URL'].'" ' .
+                 ($accesskey == '' ? '' : 'accesskey="' . $accesskey . '" ') .
                  'target="'.$box['ViewLink']['Target'].'" ' .
+                 'title="'.$box['MailboxName'].'" ' .
                  'style="text-decoration:none">';
 
     if ($settings['messageRecyclingEnabled'] && $box['IsTrash']) {
@@ -189,7 +197,7 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0)
                 $end .= '&nbsp;<small>('.$unseen_str.')</small>';
             }
             $end .= "\n<small>" .
-                    '&nbsp;&nbsp;[<a href="empty_trash.php">'. _("Purge").'</a>]' .
+                    '&nbsp;&nbsp;[<a href="empty_trash.php?smtoken=' . sm_generate_security_token() . '">'. _("Purge").'</a>]' .
                     '</small>';
         }
     } else {
@@ -211,6 +219,11 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $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']) {
@@ -221,18 +234,6 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0)
         $spanend = '</span>';
     }
 
-/********
- * Pulling imapConnection due to segfaults that cannot be tracked down.  Best
- * we can determine,its some combination of this var and >= 4 plugins enabled.
- * No further clue from anyone.
- ********
-    
-    // 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 .= '</span>';
 
     $out = '';
@@ -248,7 +249,7 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $indent_factor=0)
 
     if (!$box['IsCollapsed'] || $box['IsRoot']) {
         for ($i = 0; $i<sizeof($box['ChildBoxes']); $i++) {
-            $out .= buildMailboxTree($box['ChildBoxes'][$i], $settings, $indent_factor);
+            $out .= buildMailboxTree($box['ChildBoxes'][$i], $settings, $icon_theme_path, $indent_factor);
         }
     }
 
@@ -261,7 +262,7 @@ extract($t);
 ?>
 <body class="sqm_leftMain">
 <div class="sqm_leftMain">
-<?php do_hook('left_main_before'); ?>
+<?php if (!empty($plugin_output['left_main_before'])) echo $plugin_output['left_main_before']; ?>
 <table class="sqm_wrapperTable" cellspacing="0">
  <tr>
   <td>
@@ -270,7 +271,7 @@ extract($t);
      <td style="text-align:center">
       <span class="sqm_folderHeader"><?php echo _("Folders"); ?></span><br />
       <span class="sqm_clock"><?php echo $clock; ?></span>
-      <span class="sqm_refreshButton"><small>[<a href="../src/left_main.php" target="left"><?php echo _("Check mail"); ?></a>]</small></span>
+      <span class="sqm_refreshButton"><small>[<a href="../src/left_main.php" <?php if ($accesskey_folders_refresh != 'NONE') echo 'accesskey="' . $accesskey_folders_refresh . '" '; ?>target="left"><?php echo _("Check Mail"); ?></a>]</small></span>
      </td>
     </tr>
    </table>
@@ -279,5 +280,5 @@ extract($t);
   </td>
  </tr>
 </table>
-<?php do_hook('left_main_after'); ?>
+<?php if (!empty($plugin_output['left_main_after'])) echo $plugin_output['left_main_after']; ?>
 </div>