From 901c64f7a75e232127da909b7a0fefd61f433e39 Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Thu, 19 Sep 2024 16:45:50 +0200 Subject: [PATCH 1/3] fix multiple things in EditHandler --- src/BulkManager/BulkAction/EditHandler.php | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/BulkManager/BulkAction/EditHandler.php b/src/BulkManager/BulkAction/EditHandler.php index 90b3793..97d4d01 100644 --- a/src/BulkManager/BulkAction/EditHandler.php +++ b/src/BulkManager/BulkAction/EditHandler.php @@ -24,7 +24,7 @@ class EditHandler extends Handler /** * URL segment used to call this handler * If none given, @BulkManager will fallback to the Unqualified class name - * + * * @var string */ private static $url_segment = 'edit'; @@ -53,14 +53,14 @@ class EditHandler extends Handler /** * Front-end label for this handler's action - * + * * @var string */ protected $label = 'Edit'; /** * Front-end icon path for this handler's action. - * + * * @var string */ protected $icon = ''; @@ -68,22 +68,22 @@ class EditHandler extends Handler /** * Extra classes to add to the bulk action button for this handler * Can also be used to set the button font-icon e.g. font-icon-trash - * + * * @var string */ protected $buttonClasses = 'font-icon-edit'; - + /** * Whether this handler should be called via an XHR from the front-end - * + * * @var boolean */ protected $xhr = false; - + /** * Set to true is this handler will destroy any data. * A warning and confirmation will be shown on the front-end. - * + * * @var boolean */ protected $destructive = false; @@ -107,7 +107,7 @@ class EditHandler extends Handler */ public function Link($action = null) { - return Controller::join_links(parent::Link(), $this->stat('url_segment'), $action); + return Controller::join_links(parent::Link(), static::config()->url_segment, $action); } /** @@ -129,7 +129,7 @@ class EditHandler extends Handler FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all')) ->setAttribute('id', 'bulkEditingSaveBtn') ->addExtraClass('btn btn-success') - ->setAttribute('data-icon', 'accept') + // ->setAttribute('data-icon', 'accept') ->setUseButtonTag(true) ); @@ -137,7 +137,7 @@ class EditHandler extends Handler FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel')) ->setAttribute('id', 'bulkEditingUpdateCancelBtn') ->addExtraClass('btn btn-danger cms-panel-link') - ->setAttribute('data-icon', 'decline') + // ->setAttribute('data-icon', 'decline') ->setAttribute('href', $one_level_up->Link) ->setUseButtonTag(true) ->setAttribute('src', '')//changes type to image so isn't hooked by default actions handlers @@ -364,7 +364,7 @@ class EditHandler extends Handler 'type' => 'Includes', 'SilverStripe\\Admin\\LeftAndMain_EditForm', ]); - $form->addExtraClass('center cms-content'); + $form->addExtraClass('center cms-content flexbox-area-grow fill-height'); $form->setAttribute('data-pjax-fragment', 'CurrentForm Content'); Requirements::javascript('colymba/gridfield-bulk-editing-tools:client/dist/js/main.js'); From d2ae01ef24cb2a4f534417e53c77481710f40607 Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Mon, 30 Sep 2024 08:53:57 +0200 Subject: [PATCH 2/3] update syntax --- src/BulkManager/BulkAction/EditHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BulkManager/BulkAction/EditHandler.php b/src/BulkManager/BulkAction/EditHandler.php index 97d4d01..42ed135 100644 --- a/src/BulkManager/BulkAction/EditHandler.php +++ b/src/BulkManager/BulkAction/EditHandler.php @@ -107,7 +107,7 @@ class EditHandler extends Handler */ public function Link($action = null) { - return Controller::join_links(parent::Link(), static::config()->url_segment, $action); + return Controller::join_links(parent::Link(), static::config()->get('url_segment'), $action); } /** From 1cf36022b129c3d7cb958880317191e893e4171c Mon Sep 17 00:00:00 2001 From: Thomas Portelange Date: Mon, 30 Sep 2024 09:06:17 +0200 Subject: [PATCH 3/3] update icons --- src/BulkManager/BulkAction/EditHandler.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/BulkManager/BulkAction/EditHandler.php b/src/BulkManager/BulkAction/EditHandler.php index 42ed135..6a89a29 100644 --- a/src/BulkManager/BulkAction/EditHandler.php +++ b/src/BulkManager/BulkAction/EditHandler.php @@ -128,19 +128,17 @@ class EditHandler extends Handler $actions->push( FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all')) ->setAttribute('id', 'bulkEditingSaveBtn') - ->addExtraClass('btn btn-success') - // ->setAttribute('data-icon', 'accept') + ->addExtraClass('btn btn-success font-icon font-icon-save') ->setUseButtonTag(true) ); $actions->push( FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel')) ->setAttribute('id', 'bulkEditingUpdateCancelBtn') - ->addExtraClass('btn btn-danger cms-panel-link') - // ->setAttribute('data-icon', 'decline') + ->addExtraClass('btn btn-danger cms-panel-link font-icon font-icon-cancel') ->setAttribute('href', $one_level_up->Link) ->setUseButtonTag(true) - ->setAttribute('src', '')//changes type to image so isn't hooked by default actions handlers + ->setAttribute('src', '') //changes type to image so isn't hooked by default actions handlers ); $recordList = $this->getRecordIDList();