mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +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
|
* 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;
|
$parentID = (int)$page->ParentID;
|
||||||
$title = Convert::raw2js($page->TreeTitle());
|
$title = Convert::raw2js($page->TreeTitle());
|
||||||
$response = <<<JS
|
$response = <<<JS
|
||||||
var newNode = $('sitetree').createTreeNode($page->ID, \"$title\", \"$page->class\");
|
var newNode = $('sitetree').createTreeNode($page->ID, "$title", "$page->class");
|
||||||
var parentNode = $('sitetree').getTreeNodeByIdx($parentID);
|
var parentNode = $('sitetree').getTreeNodeByIdx($parentID);
|
||||||
if(parentNode) parentNode.appendTreeNode(newNode);\n"
|
if(parentNode) parentNode.appendTreeNode(newNode);
|
||||||
($selected ? "newNode.selectTreeNode();\n" : "") ;
|
|
||||||
JS;
|
JS;
|
||||||
|
$response .= ($select ? "newNode.selectTreeNode();\n" : "") ;
|
||||||
FormResponse::add($response);
|
FormResponse::add($response);
|
||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user