Compare commits

...

5 Commits

Author SHA1 Message Date
Steve Boyd
d3a0d194e9
Merge 5e3afd0640 into 84740116a9 2024-10-21 05:28:24 +00:00
Steve Boyd
5e3afd0640 MNT Fix unit test 2024-10-21 18:28:18 +13:00
Steve Boyd
84740116a9
Merge pull request #3015 from creative-commoners/pulls/6/new-admincontroller
API Update method signature to match parent class
2024-10-21 11:55:30 +13:00
Guy Sartorelli
b07789db44
API Update method signature to match parent class 2024-10-15 12:53:02 +13:00
Guy Sartorelli
2fa2aa356f
ENH Use config instead of runtime code to remove menu items 2024-10-15 12:51:55 +13:00
5 changed files with 8 additions and 12 deletions

View File

@ -1,10 +1,5 @@
<?php
use SilverStripe\Admin\CMSMenu;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Controllers\CMSPageAddController;
use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\CMS\Controllers\CMSPageSettingsController;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
@ -31,8 +26,3 @@ ShortcodeParser::get('default')->register(
'sitetree_link',
[SiteTree::class, 'link_shortcode_handler']
);
CMSMenu::remove_menu_class(CMSMain::class);
CMSMenu::remove_menu_class(CMSPageEditController::class);
CMSMenu::remove_menu_class(CMSPageSettingsController::class);
CMSMenu::remove_menu_class(CMSPageAddController::class);

View File

@ -32,6 +32,8 @@ class CMSPageAddController extends CMSPageEditController
private static $menu_title = 'Add page';
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
private static $ignore_menuitem = true;
private static $allowed_actions = [
'AddForm',
'doAdd',

View File

@ -28,11 +28,13 @@ class CMSPageEditController extends CMSMain
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
private static $ignore_menuitem = true;
private static $allowed_actions = [
'AddToCampaignForm',
];
public function getClientConfig()
public function getClientConfig(): array
{
return ArrayLib::array_merge_recursive(parent::getClientConfig(), [
'form' => [

View File

@ -15,6 +15,8 @@ class CMSPageSettingsController extends CMSMain
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
private static $ignore_menuitem = true;
public function getEditForm($id = null, $fields = null)
{
$record = $this->getRecord($id ?: $this->currentPageID());

View File

@ -154,7 +154,7 @@ class SiteTreePermissionsTest extends FunctionalTest
$page->publishSingle();
// Then make sure there's a new version on Stage
$page->Title = 1;
$page->Title = '1';
$page->write();
$editor = $this->objFromFixture(Member::class, 'editor');