summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-30 14:40:55 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-30 14:40:55 -0700
commitc615918829fae1496a09886ef929869fce9b9f6a (patch)
tree98727ea88312652d4f0ea6a4181b0d5b7da2f0e2
parentd1ade6620e814ecf536dfde17c95593a311d1c2c (diff)
Manage the selection so we don't automatically select an album
whenever we expand a tree.
-rw-r--r--modules/organize/controllers/organize.php4
-rw-r--r--modules/organize/views/organize_tree.html.php4
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" ?>"