Bring the left_main_after_each_folder hook to life
[squirrelmail.git] / templates / default_advanced / left_main.tpl
index 5486e3287ce28d9de2eca22178ad2ecb2b49c7b8..47005eab964439477dbf4ab53bdbf4a2fd456201 100644 (file)
@@ -75,8 +75,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.
@@ -197,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']) {
@@ -207,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;'),
@@ -247,6 +245,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 */
@@ -274,7 +273,7 @@ extract($t);
 //-->
 </script>
 <div class="sqm_leftMain">
-<?php do_hook('left_main_before'); ?>
+<?php if (!empty($plugin_output['left_main_before'])) echo $plugin_output['left_main_before']; ?>
 <div class="dtree">
 <table class="sqm_wrapperTable" cellspacing="0">
  <tr>
@@ -292,13 +291,13 @@ 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">' . _("Purge trash") . '</a>';
 }
 ?>
 </p>