- } else {
- // we aren't a child of this node at all
- return -1;
- }
- }
-
- function addChildNodeToTree($comparisonValue, $value, &$tree) {
- $parentNode = findParentForChild($comparisonValue, 0, $tree);
-
- // create a new subNode
- $newNodeIndex = count($tree);
- $tree[$newNodeIndex]['value'] = $value;
- $tree[$newNodeIndex]['doIHaveChildren'] = false;
-
- if ($tree[$parentNode]['doIHaveChildren'] == false) {
- // make sure the parent knows it has children
- $tree[$parentNode]['subNodes'][0] = $newNodeIndex;
- $tree[$parentNode]['doIHaveChildren'] = true;
- } else {
- $nextSubNode = count($tree[$parentNode]['subNodes']);
- // make sure the parent knows it has children
- $tree[$parentNode]['subNodes'][$nextSubNode] = $newNodeIndex;
- }
- }
-
- function walkTreeInPreOrderEmptyTrash($index, $imap_stream, $tree) {
- global $trash_folder;
- if ($tree[$index]['doIHaveChildren']) {
- for ($j = 0; $j < count($tree[$index]['subNodes']); $j++) {
+ } else {
+ // we aren't a child of this node at all
+ return -1;
+ }
+}
+
+function addChildNodeToTree($comparisonValue, $value, &$tree) {
+ $parentNode = findParentForChild($comparisonValue, 0, $tree);
+
+ // create a new subNode
+ $newNodeIndex = count($tree);
+ $tree[$newNodeIndex]['value'] = $value;
+ $tree[$newNodeIndex]['doIHaveChildren'] = false;
+
+ if ($tree[$parentNode]['doIHaveChildren'] == false) {
+ // make sure the parent knows it has children
+ $tree[$parentNode]['subNodes'][0] = $newNodeIndex;
+ $tree[$parentNode]['doIHaveChildren'] = true;
+ } else {
+ $nextSubNode = count($tree[$parentNode]['subNodes']);
+ // make sure the parent knows it has children
+ $tree[$parentNode]['subNodes'][$nextSubNode] = $newNodeIndex;
+ }
+}
+
+function walkTreeInPreOrderEmptyTrash($index, $imap_stream, $tree) {
+ global $trash_folder;
+ if ($tree[$index]['doIHaveChildren']) {
+ for ($j = 0; $j < count($tree[$index]['subNodes']); $j++) {