diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index 32d84fe7..da97e319 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -77,9 +77,6 @@ class AssetAdmin extends LeftAndMain { // needed for MemberTableField (Requirements not determined before Ajax-Call) Requirements::css(SAPPHIRE_DIR . "/css/ComplexTableField.css"); - Requirements::javascript(CMS_DIR . '/javascript/LeftAndMain.BatchActions.js'); - - Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.DragDrop.js"); Requirements::javascript(CMS_DIR . "/javascript/AssetAdmin.js"); Requirements::javascript(CMS_DIR . "/javascript/CMSMain_upload.js"); @@ -434,52 +431,6 @@ HTML; } } - - /** - * Batch Actions Handler - */ - function batchactions() { - return new CMSBatchActionHandler($this, 'batchactions', 'Folder'); - } - - /** - * @return Form - */ - function BatchActionsForm() { - $actions = $this->batchactions()->batchActionList(); - $actionsMap = array(); - foreach($actions as $action) $actionsMap[$action->Link] = $action->Title; - - $form = new Form( - $this, - 'BatchActionsForm', - new FieldSet( - new LiteralField( - 'Intro', - sprintf('
%s
', - _t( - 'CMSMain_left.ss.SELECTPAGESACTIONS', - 'Select the pages that you want to change & then click an action:' - ) - ) - ), - new HiddenField('csvIDs'), - new DropdownField( - 'Action', - false, - $actionsMap - ) - ), - new FieldSet( - // TODO i18n - new FormAction('submit', "Go") - ) - ); - $form->addExtraClass('actionparams'); - $form->unsetValidator(); - - return $form; - } /** * @return Form diff --git a/code/CMSMain.php b/code/CMSMain.php index 1ca3250e..5c605ab3 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -50,7 +50,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'SiteTreeAsUL', 'getshowdeletedsubtree', 'getfilteredsubtree', - 'batchactions', 'SearchTreeForm', 'ReportForm', 'LangForm', @@ -979,13 +978,6 @@ JS; } } } - - /** - * Batch Actions Handler - */ - function batchactions() { - return new CMSBatchActionHandler($this, 'batchactions'); - } function buildbrokenlinks() { if($this->urlParams['ID']) { @@ -1111,45 +1103,6 @@ JS; return $form; } - - /** - * @return Form - */ - function BatchActionsForm() { - $actions = $this->batchactions()->batchActionList(); - $actionsMap = array(); - foreach($actions as $action) $actionsMap[$action->Link] = $action->Title; - - $form = new Form( - $this, - 'BatchActionsForm', - new FieldSet( - new LiteralField( - 'Intro', - sprintf('%s
', - _t( - 'CMSMain_left.ss.SELECTPAGESACTIONS', - 'Select the pages that you want to change & then click an action:' - ) - ) - ), - new HiddenField('csvIDs'), - new DropdownField( - 'Action', - false, - $actionsMap - ) - ), - new FieldSet( - // TODO i18n - new FormAction('submit', "Go") - ) - ); - $form->addExtraClass('actionparams'); - $form->unsetValidator(); - - return $form; - } function publishall() { ini_set("memory_limit", -1); diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index e294ebec..c90bce82 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -45,6 +45,8 @@ class LeftAndMain extends Controller { 'Member_ProfileForm', 'EditorToolbar', 'EditForm', + 'BatchActionsForm', + 'batchactions', ); /** @@ -823,6 +825,52 @@ JS; return $form; } + /** + * Batch Actions Handler + */ + function batchactions() { + return new CMSBatchActionHandler($this, 'batchactions', $this->stat('tree_class')); + } + + /** + * @return Form + */ + function BatchActionsForm() { + $actions = $this->batchactions()->batchActionList(); + $actionsMap = array(); + foreach($actions as $action) $actionsMap[$action->Link] = $action->Title; + + $form = new Form( + $this, + 'BatchActionsForm', + new FieldSet( + new LiteralField( + 'Intro', + sprintf('%s
', + _t( + 'CMSMain_left.ss.SELECTPAGESACTIONS', + 'Select the pages that you want to change & then click an action:' + ) + ) + ), + new HiddenField('csvIDs'), + new DropdownField( + 'Action', + false, + $actionsMap + ) + ), + new FieldSet( + // TODO i18n + new FormAction('submit', "Go") + ) + ); + $form->addExtraClass('actionparams'); + $form->unsetValidator(); + + return $form; + } + public function myprofile() { $form = $this->Member_ProfileForm(); return $this->customise(array( diff --git a/javascript/LeftAndMain.BatchActions.js b/javascript/LeftAndMain.BatchActions.js index 8294f8c4..b1afda8a 100644 --- a/javascript/LeftAndMain.BatchActions.js +++ b/javascript/LeftAndMain.BatchActions.js @@ -157,15 +157,15 @@ // only if the current page was modified selectedNode.selectTreeNode(); } else if(data.deleted[selectedNode.getIdx()]) { - $('#Form_EditForm').concrete('ss').removeForm(); + jQuery('#Form_EditForm').concrete('ss').removeForm(); } } else { - $('#Form_EditForm').concrete('ss').removeForm(); + jQuery('#Form_EditForm').concrete('ss').removeForm(); } // close panel // TODO Coupling with tabs - $('#TreeActions').tabs('select', -1); + jQuery('#TreeActions').tabs('select', -1); }, dataType: 'json' });