diff options
-rw-r--r-- | modules/organize/controllers/organize.php | 4 | ||||
-rw-r--r-- | modules/organize/views/organize_tree.html.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 24e5bf97..22f106e9 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -136,7 +136,7 @@ class Organize_Controller extends Controller { $album = ORM::factory("item", $album_id); access::required("view", $album); - print self::_expanded_tree($album, $album); + print self::_expanded_tree($album); } /** @@ -144,7 +144,7 @@ class Organize_Controller extends Controller { * include albums along the descendant hierarchy that includes the selected album, and the * immediate child albums. */ - private static function _expanded_tree($root, $selected_album) { + private static function _expanded_tree($root, $selected_album=null) { $v = new View("organize_tree.html"); $v->album = $root; $v->selected = $selected_album; diff --git a/modules/organize/views/organize_tree.html.php b/modules/organize/views/organize_tree.html.php index a99d2337..59f683ef 100644 --- a/modules/organize/views/organize_tree.html.php +++ b/modules/organize/views/organize_tree.html.php @@ -4,14 +4,14 @@ <span class="ui-icon ui-icon-minus"> </span> <span class="gAlbumText - <?= $album->id == $selected->id ? "selected" : "" ?> + <?= $selected && $album->id == $selected->id ? "selected" : "" ?> " ref="<?= $album->id ?>"> <?= p::clean($album->title) ?> </span> <ul> <? foreach ($album->children(null, 0, array("type" => "album")) as $child): ?> - <? if ($child->is_descendant($selected)): ?> + <? if ($selected && $child->is_descendant($selected)): ?> <?= View::factory("organize_tree.html", array("selected" => $selected, "album" => $child)); ?> <? else: ?> <li class="gOrganizeAlbum ui-icon-left <?= access::can("edit", $child) ? "" : "gViewOnly" ?>" |