From 6b85981df4fd3d468d1319f8eccfa8da42e0427f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:43:12 +1200 Subject: [PATCH] API Replace extension with config (#324) --- _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'); - } -}