diff --git a/3.1/modules/albumtree/helpers/albumtree_block.php b/3.1/modules/albumtree/helpers/albumtree_block.php
index 8d184f51..1d01e4fd 100644
--- a/3.1/modules/albumtree/helpers/albumtree_block.php
+++ b/3.1/modules/albumtree/helpers/albumtree_block.php
@@ -26,9 +26,10 @@ class albumtree_block_Core {
$block = new Block();
switch ($block_id) {
case "albumtree":
+ $style = module::get_var("albumtree", "style", "select");
$block->css_id = "g-albumtree";
$block->title = t("Album Tree");
- $block->content = new View("albumtree_block.html");
+ $block->content = new View("albumtree_block_{$style}.html");
$block->content->root = item::root();
break;
}
diff --git a/3.1/modules/albumtree/helpers/albumtree_installer.php b/3.1/modules/albumtree/helpers/albumtree_installer.php
new file mode 100644
index 00000000..30ceb884
--- /dev/null
+++ b/3.1/modules/albumtree/helpers/albumtree_installer.php
@@ -0,0 +1,33 @@
+
+
+
+
+ // We'll keep track of the list of items that we want to display in a stack ?>
+ $stack = array(array(0, $root)) ?>
+
+ // While there are still items to show, pick the next one and show it ?>
+ while ($stack): ?>
+ list($level, $album) = array_pop($stack) ?>
+
+
+ // Then take all of that album's children and put them next on the stack. ?>
+ $tmp = array(); ?>
+ foreach ($album->viewable()->children(null, null, array(array("type", "=", "album"))) as $child): ?>
+ $tmp[] = array($level + 1, $child) ?>
+ endforeach ?>
+
+ // Since we'll pull them off the stack in the opposite order that we put them on, ?>
+ // and the order that we put them on is the order in which we want to display them, ?>
+ // We need to reverse the order of the children on the stack ?>
+ if ($tmp): ?>
+ $stack = array_merge($stack, array_reverse($tmp)) ?>
+ endif ?>
+ endwhile ?>
+