From 586d2c9b7983d686551c31ac02c2a468bd05f9ee Mon Sep 17 00:00:00 2001 From: matt-in-a-hat Date: Wed, 11 Apr 2018 17:07:54 +1200 Subject: [PATCH] Fix module and resource loading for SS 4.1.0 --- _config.php | 3 --- composer.json | 10 ++++++++-- css/gridfield_betterbuttons.css | 12 +++++++++++- src/Actions/BetterButtonPrevNextAction.php | 4 ++-- src/Buttons/BetterButton_Delete.php | 2 +- src/Controllers/BetterButtonsNestedFormRequest.php | 2 +- src/Extensions/GridFieldBetterButtonsItemRequest.php | 4 ++-- src/FormFields/DropdownFormAction.php | 4 ++-- 8 files changed, 27 insertions(+), 14 deletions(-) delete mode 100755 _config.php diff --git a/_config.php b/_config.php deleted file mode 100755 index 807205a..0000000 --- a/_config.php +++ /dev/null @@ -1,3 +0,0 @@ -previous %s", + "%s", $cssClass, $prevLink, $linkTitle, @@ -53,7 +53,7 @@ public function getButtonHTML() $linkText = $nextRecordID ? _t('GridFieldBetterButtons.NEXT', 'Next') : ""; $html .= sprintf( - "%s next", + "%s", $cssClass, $nextLink, $linkTitle, diff --git a/src/Buttons/BetterButton_Delete.php b/src/Buttons/BetterButton_Delete.php index e256ccb..79a7575 100755 --- a/src/Buttons/BetterButton_Delete.php +++ b/src/Buttons/BetterButton_Delete.php @@ -28,7 +28,7 @@ public function __construct() public function baseTransform() { parent::baseTransform(); - Requirements::javascript(BETTER_BUTTONS_DIR.'/javascript/gridfield_betterbuttons_delete.js'); + Requirements::javascript('unclecheese/betterbuttons:javascript/gridfield_betterbuttons_delete.js'); return $this ->setUseButtonTag(true) diff --git a/src/Controllers/BetterButtonsNestedFormRequest.php b/src/Controllers/BetterButtonsNestedFormRequest.php index 28dd090..bf88840 100644 --- a/src/Controllers/BetterButtonsNestedFormRequest.php +++ b/src/Controllers/BetterButtonsNestedFormRequest.php @@ -75,7 +75,7 @@ public function Form() */ public function index(HTTPRequest $r) { - Requirements::css(BETTER_BUTTONS_DIR.'/css/betterbuttons_nested_form.css'); + Requirements::css('unclecheese/betterbuttons:css/betterbuttons_nested_form.css'); return $this->customise(array( 'Form' => $this->Form() diff --git a/src/Extensions/GridFieldBetterButtonsItemRequest.php b/src/Extensions/GridFieldBetterButtonsItemRequest.php index e7981d9..42e4e2a 100755 --- a/src/Extensions/GridFieldBetterButtonsItemRequest.php +++ b/src/Extensions/GridFieldBetterButtonsItemRequest.php @@ -111,8 +111,8 @@ public function updateItemEditForm($form) if ($this->owner->record->stat('better_buttons_enabled') !== true) { return false; } - Requirements::css(BETTER_BUTTONS_DIR.'/css/gridfield_betterbuttons.css'); - Requirements::javascript(BETTER_BUTTONS_DIR.'/javascript/gridfield_betterbuttons.js'); + Requirements::css('unclecheese/betterbuttons:css/gridfield_betterbuttons.css'); + Requirements::javascript('unclecheese/betterbuttons:javascript/gridfield_betterbuttons.js'); $actions = $this->owner->record->getBetterButtonsActions(); diff --git a/src/FormFields/DropdownFormAction.php b/src/FormFields/DropdownFormAction.php index bb1379d..2b59229 100755 --- a/src/FormFields/DropdownFormAction.php +++ b/src/FormFields/DropdownFormAction.php @@ -61,8 +61,8 @@ public function __construct($title = null, $children = array ()) */ public function Field($properties = array ()) { - Requirements::css(BETTER_BUTTONS_DIR . '/css/dropdown_form_action.css'); - Requirements::javascript(BETTER_BUTTONS_DIR . '/javascript/dropdown_form_action.js'); + Requirements::css('unclecheese/betterbuttons:css/dropdown_form_action.css'); + Requirements::javascript('unclecheese/betterbuttons:javascript/dropdown_form_action.js'); $this->setAttribute('data-form-action-dropdown', '#' . $this->DropdownID()); return parent::Field();