Skip to content

Commit

Permalink
Created a batch action extension for LeftAndMain
Browse files Browse the repository at this point in the history
+ Created an extension to add the `BatchActionParameters` fields from CMSMain to the `BatchActionsForm` in LeftAndMain
+ Applied the extension to LeftAndMain using YAML
  • Loading branch information
mooror committed Jul 7, 2022
1 parent 35d1222 commit fa1c6ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Name: cmsextensions
SilverStripe\Admin\LeftAndMain:
extensions:
- SilverStripe\CMS\Controllers\LeftAndMainPageIconsExtension
- SilverStripe\CMS\Controllers\LeftAndMainBatchActionsExtension
---
Name: cmsmodals
---
Expand Down
16 changes: 16 additions & 0 deletions code/Controllers/LeftAndMainBatchActionsExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace SilverStripe\CMS\Controllers;

use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\Core\Extension;

class LeftAndMainBatchActionsExtension extends Extension
{
public function updateBatchActionsForm(&$form)
{
$cmsMain = singleton(CMSMain::class);
$form->Fields()->insertAfter('Action', $cmsMain->BatchActionParameters());
return $form;
}
}

0 comments on commit fa1c6ae

Please sign in to comment.