BUGFIX Fixed CMSMain.js search clearing logic, wasnt clearing the first field properly. Fixed LeftAndMain->getsubtree() filtering in AssetAdmin and SecurityAdmin.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92849 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:21:03 +00:00
parent 9c3ecea1e7
commit 990ae9f145
5 changed files with 19 additions and 3 deletions

View File

@ -260,6 +260,11 @@ HTML;
return $this->getSiteTreeFor($this->stat('tree_class'), null, 'ChildFolders');
}
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
if (!$childrenMethod) $childrenMethod = 'ChildFolders';
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $filterFunction, $minNodeCount);
}
public function getCMSTreeTitle() {
return Director::absoluteBaseURL() . "assets";
}

View File

@ -492,6 +492,7 @@ class LeftAndMain extends Controller {
. '".$child->class."\" >" . ($child->TreeTitle) .
"</a>"
';
$siteTree = $obj->getChildrenAsUL(
"",
$titleEval,
@ -525,7 +526,7 @@ class LeftAndMain extends Controller {
$this->stat('tree_class'),
$request->getVar('ID'),
null,
array($this->getMarkingFilter($request->requestVars()), 'mark'),
null,
$request->getVar('minNodeCount')
);

View File

@ -183,6 +183,11 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
return FormResponse::respond();
}
function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
if (!$childrenMethod) $childrenMethod = 'stageChildren';
return parent::getSiteTreeFor($className, $rootID, $childrenMethod, $filterFunction, $minNodeCount);
}
function getCMSTreeTitle() {
return _t('SecurityAdmin.SGROUPS', 'Security Groups');
}

View File

@ -44,12 +44,16 @@ var _HANDLER_FORMS = {
jQuery(this).attr('action'),
function() {
button.removeClass('loading');
// reload current
// reload current form and tree
var currNode = $('#sitetree')[0].firstSelected();
if(currNode) {
var url = $(currNode).find('a').attr('href');
$('#Form_EditForm').loadForm(url);
}
$('#sitetree')[0].setCustomURL('admin/assets/getsubtree');
$('#sitetree')[0].reload({onSuccess: function() {
// TODO Reset current tree node
}});
}
);

View File

@ -99,7 +99,8 @@
},
onreset: function(e) {
this.find('.field').clearFields().not(':first').hide();
this.find('.field :input').clearFields();
this.find('.field').not(':first').hide();
// Reset URL to default
$('#sitetree')[0].clearCustomURL();