From 4caaddbd93446ec74bab545776e4cdd40606d992 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:43:08 +1200 Subject: [PATCH] API Replace extension with config (#254) --- _config/config.yml | 6 ++-- ...ShareDraftContentRequirementsExtension.php | 29 ------------------- 2 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 src/Extensions/ShareDraftContentRequirementsExtension.php diff --git a/_config/config.yml b/_config/config.yml index 8ebfeb1..6d8d162 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -6,8 +6,10 @@ SilverStripe\CMS\Model\SiteTree: extensions: - SilverStripe\ShareDraftContent\Extensions\ShareDraftContentSiteTreeExtension SilverStripe\CMS\Controllers\CMSMain: - extensions: - - SilverStripe\ShareDraftContent\Extensions\ShareDraftContentRequirementsExtension + extra_requirements_css: + - 'silverstripe/sharedraftcontent: client/dist/styles/bundle-cms.css' + extra_requirements_javascript: + - 'silverstripe/sharedraftcontent: client/dist/js/bundle.js' SilverStripe\Control\Controller: extensions: - SilverStripe\ShareDraftContent\Extensions\ShareDraftContentControllerExtension diff --git a/src/Extensions/ShareDraftContentRequirementsExtension.php b/src/Extensions/ShareDraftContentRequirementsExtension.php deleted file mode 100644 index 0030cc4..0000000 --- a/src/Extensions/ShareDraftContentRequirementsExtension.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @deprecated 5.3.0 Will be replaced with YAML configuration - */ -class ShareDraftContentRequirementsExtension extends DataExtension -{ - public function __construct() - { - Deprecation::withNoReplacement( - fn () => Deprecation::notice('5.3.0', 'Will be replaced with YAML configuration', Deprecation::SCOPE_CLASS) - ); - parent::__construct(); - } - - public function init() - { - Requirements::css('silverstripe/sharedraftcontent: client/dist/styles/bundle-cms.css'); - Requirements::javascript('silverstripe/sharedraftcontent: client/dist/js/bundle.js'); - } -}