/**
* 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
$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;
}
}
}
+ // 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']) {
$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 = '';
else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
str += node.name;
+//FIXME: if node.name contains a hyperlink, either the plugin that put it there should be responsible for adding the </a> for the main folder link or the line below should be changed to detect inner links and close the main one before any; for now, it seems to work anyway although I think the resultant HTML is invalid (hyperlink within a hyperlink and extra, out of place closing </a> at the end)
if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
str += '</div>';
if (node._hc) {
}
}
+ // 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']) {
$spanend = '</span>';
}
- /**
- * NOTE: Plugins would horribly break this advanced tree, so we are
- * going to skip that part altogether.
- */
-
$name = str_replace(
array(' ','<','>'),
array(' ','<','>'),