Happy New Year
[squirrelmail.git] / functions / template / folder_list_util.php
index 1ce9c09ce21df621879ce857dd2c6112ce503919..d84150cddc47ef4d6549326a9898187f4cba0114 100644 (file)
@@ -6,7 +6,7 @@
  * Provides some functions for use in left_main.php and templates.  Do not echo
  * output from these functions!
  *
- * @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
  * @since 1.5.2
  */
 function getMessageCount ($boxes, $type='total') {
+
+    global $trash_folder;
+
     // The Trash folder isn't counted...
-    if ($boxes->mailboxname_full == $GLOBALS['trash_folder'])
+    if ($boxes->mailboxname_full == $trash_folder)
         return 0;
         
     $count = 0;
@@ -44,6 +47,7 @@ function getMessageCount ($boxes, $type='total') {
 /**
  * Recursively iterates a mailboxes object to build a data structure that is
  * easy for template authors to work with.
+FIXME: well.... why not document that data structure here?
  * 
  * @param object $boxes Object of the class mailboxes
  * @author Steve Brown
@@ -112,5 +116,16 @@ function getBoxStructure ($boxes) {
         $box['ChildBoxes'][] = getBoxStructure($boxes->mbxs[$i]);
     }
     
+    // if plugins want to add some text or link after the folder name in
+    // the folder list, they should add to the "ExtraOutput" array element
+    // in $box (remember, it's passed through the hook by reference) -- making
+    // sure to play nice with other plugins by *concatenating* to "ExtraOutput"
+    // and NOT by overwriting it
+    //
+    // known users of this hook:
+    // empty_folders
+    //
+    do_hook('left_main_after_each_folder', $box);
+
     return $box;
 }