Don't use regular expressions when you don't need to
[squirrelmail.git] / templates / default / left_main.tpl
index 27fada32e99638b8a2c02ae5363c503a25cf0d49..162883711c540bb339e20a0fbbab69b9c19ea55a 100644 (file)
@@ -61,7 +61,7 @@
  *                                            in all folders in this mailbox,
  *                                            excluding trash folders.
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2011 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -162,12 +162,21 @@ 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'].'" ' .
                  'style="text-decoration:none">';
 
@@ -209,6 +218,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']) {
@@ -219,22 +233,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, it's some combination of this var and >= 4 plugins enabled.
- * No further clue from anyone.
- ********
- * Update: syntax of this hook call changed a bit, so if the error is so anomalous,
- * it might be worth trying this again to see if it is still segfaulting
- ********
-    
-    // let plugins fiddle with end of line
-// FIXME: no hooks in templates! Although note that I'm not sure we can avoid it here because the context of which folder we are displaying is important to the hook, unless we preemptively iterate through all folders and collect the output from the hook call for that and give that to the template.... seems like overkill; I say this hook remains
-    $end .= concat_hook_function('left_main_after_each_folder',
-            $temp=array(isset($numMessages) ? &$numMessages : '',
-            &$box['MailboxFullName'], &$settings['imapConnection']));
-*/
-
     $end .= '</span>';
 
     $out = '';
@@ -272,7 +270,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>