From 21b548729351c8f2628937a03270ce6078a1d91a Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 15 Oct 2024 12:26:19 +1300 Subject: [PATCH 1/2] ENH Use config instead of runtime code to remove menu item --- _config.php | 8 -------- src/Controllers/CMSPageHistoryViewerController.php | 2 ++ src/Controllers/HistoryViewerController.php | 2 ++ 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 _config.php diff --git a/_config.php b/_config.php deleted file mode 100644 index 9ecd2c23..00000000 --- a/_config.php +++ /dev/null @@ -1,8 +0,0 @@ -getRecord($id ?: $this->currentPageID()); diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index 7f9fe1f1..3fff6064 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -42,6 +42,8 @@ class HistoryViewerController extends LeftAndMain private static $required_permission_codes = 'CMS_ACCESS_CMSMain'; + private static $ignore_menuitem = true; + private static array $url_handlers = [ 'GET api/read' => 'apiRead', 'POST api/revert' => 'apiRevert', From c13c1279f8601253d3c9df770d1e85db5f3ce033 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 15 Oct 2024 12:26:26 +1300 Subject: [PATCH 2/2] API Update method signature to match parent class --- src/Controllers/HistoryViewerController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controllers/HistoryViewerController.php b/src/Controllers/HistoryViewerController.php index 3fff6064..5ba9ffcf 100644 --- a/src/Controllers/HistoryViewerController.php +++ b/src/Controllers/HistoryViewerController.php @@ -67,7 +67,7 @@ class HistoryViewerController extends LeftAndMain /** * Returns configuration required by the client app */ - public function getClientConfig() + public function getClientConfig(): array { $clientConfig = parent::getClientConfig(); foreach ($this->formNames as $formName) {