From 4e0e007cc2dca9707d1b4520f2f559da2289a625 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 21 Aug 2024 12:04:26 +1200 Subject: [PATCH] API Replace extension with config --- _config/config.yml | 8 ++++++-- src/CampaignAdminExtension.php | 30 ------------------------------ 2 files changed, 6 insertions(+), 32 deletions(-) delete mode 100644 src/CampaignAdminExtension.php diff --git a/_config/config.yml b/_config/config.yml index a3f5abef..06facb6e 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -2,8 +2,12 @@ Name: campaignadmin --- SilverStripe\Admin\LeftAndMain: - extensions: - - SilverStripe\CampaignAdmin\CampaignAdminExtension + extra_requirements_i18n: + - 'silverstripe/campaign-admin: client/lang' + extra_requirements_javascript: + - 'silverstripe/campaign-admin: client/dist/js/bundle.js' + extra_requirements_css: + - 'silverstripe/campaign-admin: client/dist/styles/bundle.css' SilverStripe\CMS\Model\SiteTree: extensions: diff --git a/src/CampaignAdminExtension.php b/src/CampaignAdminExtension.php deleted file mode 100644 index 4d2ea602..00000000 --- a/src/CampaignAdminExtension.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @deprecated 5.3.0 Will be replaced with YAML configuration - */ -class CampaignAdminExtension extends Extension -{ - 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::add_i18n_javascript('silverstripe/campaign-admin: client/lang', false); - Requirements::javascript('silverstripe/campaign-admin: client/dist/js/bundle.js'); - Requirements::css('silverstripe/campaign-admin: client/dist/styles/bundle.css'); - } -}