summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-29 11:29:38 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-29 11:29:38 -0700
commit775987dff99b4459d6fef255d67da3bd6cdeb7c5 (patch)
tree622cc4576217b19611ddc2b186afa739fb16ae93 /modules
parent4408ed0684ad8b1a2e1623ef2103fdad8ae5d895 (diff)
Fix a bug where organize doesn't properly generate the tree at the root album.
Diffstat (limited to 'modules')
-rw-r--r--modules/organize/controllers/organize.php7
-rw-r--r--modules/organize/views/organize_tree.html.php4
2 files changed, 8 insertions, 3 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php
index de53c4ed..2b966657 100644
--- a/modules/organize/controllers/organize.php
+++ b/modules/organize/controllers/organize.php
@@ -136,6 +136,13 @@ class Organize_Controller extends Controller {
$v = new View("organize_tree.html");
$v->parents = $album->parents();
$v->album = $album;
+
+ if ($album->id == 1) {
+ $v->peers = array($album);
+ } else {
+ $v->peers = $album->parent()->children(null, 0, array("type" => "album"));
+ }
+
return $v;
}
}
diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php
index cf957fe6..36f900ac 100644
--- a/modules/organize/views/organize_tree.html.php
+++ b/modules/organize/views/organize_tree.html.php
@@ -10,8 +10,7 @@
<ul class="ui-icon-plus">
<? endforeach ?>
- <? if ($parent->id == $album->parent_id): ?>
- <? foreach ($parent->children(null, 0, array("type" => "album")) as $peer): ?>
+ <? foreach ($peers as $peer): ?>
<li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $peer) ? "" : "gViewOnly" ?>"
ref="<?= $peer->id ?>">
<span class="ui-icon <?= $peer->id == $album->id ? "ui-icon-minus" : "ui-icon-plus" ?>">
@@ -38,7 +37,6 @@
<? endif ?>
</li>
<? endforeach ?>
- <? endif ?>
<? foreach ($parents as $parent): ?>
</ul>