Skip to content

Commit

Permalink
Merge pull request #3015 from creative-commoners/pulls/6/new-admincon…
Browse files Browse the repository at this point in the history
…troller

API Update method signature to match parent class
  • Loading branch information
emteknetnz authored Oct 20, 2024
2 parents bd48b04 + b07789d commit 8474011
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
10 changes: 0 additions & 10 deletions _config.php
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -31,8 +26,3 @@
'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);
2 changes: 2 additions & 0 deletions code/Controllers/CMSPageAddController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion code/Controllers/CMSPageEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
2 changes: 2 additions & 0 deletions code/Controllers/CMSPageSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 8474011

Please sign in to comment.