From 514d5affa62f5646ecc7843a39b36d4fad3abbd5 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 6 Jan 2011 09:49:37 -0800 Subject: When generating the tree, don't mark nodes with no children as a leaf because that confuses the TreeDropZone JS into thinking that it can't ever have children. --- modules/organize/controllers/organize.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/organize') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 82f74c9e..eb040778 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -169,7 +169,7 @@ class Organize_Controller extends Controller { "editable" => false, "expandable" => false, "id" => $child->id, - "leaf" => $child->children_count(array(array("type", "=", "album"))) == 0, + "leaf" => false, "text" => $child->title, "nodeType" => "async"); @@ -178,6 +178,11 @@ class Organize_Controller extends Controller { $node["children"] = $this->_get_tree($child, $selected); $node["expanded"] = true; } + + if ($child->children_count(array(array("type", "=", "album"))) == 0) { + $node["children"] = array(); + $node["expanded"] = true; + } $tree[] = $node; } return $tree; -- cgit v1.2.3