mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
fixed virtual page creation. yay!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42848 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bdf7da1842
commit
5d425fa6ed
@ -573,15 +573,15 @@ JS;
|
||||
/**
|
||||
* Return JavaScript code to generate a tree node for the given page, if visible
|
||||
*/
|
||||
public function addTreeNodeJS($page, $selected = false) {
|
||||
public function addTreeNodeJS($page, $select = false) {
|
||||
$parentID = (int)$page->ParentID;
|
||||
$title = Convert::raw2js($page->TreeTitle());
|
||||
$response = <<<JS
|
||||
var newNode = $('sitetree').createTreeNode($page->ID, \"$title\", \"$page->class\");
|
||||
var parentNode = $('sitetree').getTreeNodeByIdx($parentID);
|
||||
if(parentNode) parentNode.appendTreeNode(newNode);\n"
|
||||
($selected ? "newNode.selectTreeNode();\n" : "") ;
|
||||
var newNode = $('sitetree').createTreeNode($page->ID, "$title", "$page->class");
|
||||
var parentNode = $('sitetree').getTreeNodeByIdx($parentID);
|
||||
if(parentNode) parentNode.appendTreeNode(newNode);
|
||||
JS;
|
||||
$response .= ($select ? "newNode.selectTreeNode();\n" : "") ;
|
||||
FormResponse::add($response);
|
||||
return FormResponse::respond();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user