BUGFIX Fixed expanded/unexpanded flags on new tree items - was showing expanded styling (plus icon) with newly created pages

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@70323 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-01-19 00:11:08 +00:00
parent 2591492023
commit 84f6f5d396

View File

@ -504,7 +504,7 @@ class LeftAndMain extends Controller {
$parentID = (int)$p->ParentID;
$id = $p->ID ? $p->ID : "new-$p->class-$p->ParentID";
$treeTitle = Convert::raw2js($p->TreeTitle());
$hasChildren = is_numeric( $id ) && $p->AllChildren() ? ' unexpanded' : '';
$hasChildren = (is_numeric($id) && $p->AllChildren() && $p->AllChildren()->Count()) ? ' unexpanded' : '';
// Ensure there is definitly a node avaliable. if not, append to the home tree.
$response = <<<JS