Happy New Year
[squirrelmail.git] / templates / default_advanced / left_main.tpl
index c8bad7aba28b3455425ae4d0fa5a529ba9a3e4f8..1097e9759c8f88ea468e25874840b77c435f53ab 100644 (file)
@@ -67,7 +67,7 @@
  *                                            in all folders in this mailbox,
  *                                            excluding trash folders.
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2018 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -195,6 +195,11 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) {
             }
         }
 
+        // 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']) {
@@ -205,11 +210,6 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) {
             $spanend = '</span>';
         }               
         
-        /**
-         * NOTE: Plugins would horribly break this advanced tree, so we are
-         *       going to skip that part altogether.
-         */     
-
         $name = str_replace(
                     array(' ','<','>'),
                     array('&nbsp;','&lt;','&gt;'),
@@ -226,11 +226,19 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) {
         }
         
         if ($display_folder) {
+
+            if ($box['IsInbox']) {
+                global $accesskey_folders_inbox;
+                $accesskey = $accesskey_folders_inbox;
+            }
+            else $accesskey = '';
+
             $out .= 'mailboxes.add('.$counter.', '.$parent_node.', ' .
                                        '"'.addslashes($name).'", "'.$url.'", "'.$title.'", ' .
                                        '"'.$target.'", ' .
                                        '"'.getIconPath($icon_theme_path, $img).'", ' .
-                                       '"'.getIconPath($icon_theme_path, $img_open).'"' .
+                                       '"'.getIconPath($icon_theme_path, $img_open).'", ' .
+                                       '"'.$accesskey.'"' .
                                        ');'."\n";
         }
     }
@@ -245,6 +253,7 @@ function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) {
     }
     
     return $out;
+//FIXME: somewhere above, need to insert the left_main_after_each_folder hook, or if no plugin hooks allowed in templates, at least the output from that hook (but I think it might be impossible not to have the hook here in this fxn
 }
 
 /* retrieve the template vars */
@@ -272,7 +281,7 @@ extract($t);
 //-->
 </script>
 <div class="sqm_leftMain">
-<?php /* FIXME: no hooks in templates! */ global $null; do_hook('left_main_before', $null); ?>
+<?php if (!empty($plugin_output['left_main_before'])) echo $plugin_output['left_main_before']; ?>
 <div class="dtree">
 <table class="sqm_wrapperTable" cellspacing="0">
  <tr>
@@ -282,7 +291,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>
@@ -290,13 +299,16 @@ extract($t);
  </tr>
 </table>
 <p>
-<a href="javascript:mailboxes.openAll()">Open All</a>
+<a href="javascript:mailboxes.openAll()"><?php echo _("Open All") ?></a>
 &nbsp;&nbsp;|&nbsp;&nbsp;
-<a href="javascript:mailboxes.closeAll()">Close All</a>
+<a href="javascript:mailboxes.closeAll()"><?php echo _("Close All") ?></a>
 <?php
 if ($settings['messageRecyclingEnabled']) {
     echo '<br />';
-    echo '<a href="empty_trash.php">Purge Trash</a>';
+    echo '<a href="empty_trash.php?smtoken=' . sm_generate_security_token() . '"';
+    if ($accesskey_folders_purge_trash != 'NONE')
+        echo ' accesskey="' . $accesskey_folders_purge_trash . '"';
+    echo '>' . _("Purge Trash") . '</a>';
 }
 ?>
 </p>