Created a batch action extension for LeftAndMain

+ Created an extension to add the `BatchActionParameters` fields from CMSMain to the `BatchActionsForm` in LeftAndMain
+ Applied the extension to LeftAndMain using YAML
This commit is contained in:
Benjamin Blake 2022-07-06 22:49:24 -06:00
parent 35d12228d0
commit fa1c6ae3db
2 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Name: cmsextensions
SilverStripe\Admin\LeftAndMain: SilverStripe\Admin\LeftAndMain:
extensions: extensions:
- SilverStripe\CMS\Controllers\LeftAndMainPageIconsExtension - SilverStripe\CMS\Controllers\LeftAndMainPageIconsExtension
- SilverStripe\CMS\Controllers\LeftAndMainBatchActionsExtension
--- ---
Name: cmsmodals Name: cmsmodals
--- ---

View File

@ -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;
}
}