Merge branch '4.0' into 4.1

This commit is contained in:
github-actions 2024-09-30 20:31:26 +00:00
commit 50974abea9

View File

@ -24,7 +24,7 @@ class EditHandler extends Handler
/** /**
* URL segment used to call this handler * URL segment used to call this handler
* If none given, @BulkManager will fallback to the Unqualified class name * If none given, @BulkManager will fallback to the Unqualified class name
* *
* @var string * @var string
*/ */
private static $url_segment = 'edit'; private static $url_segment = 'edit';
@ -53,14 +53,14 @@ class EditHandler extends Handler
/** /**
* Front-end label for this handler's action * Front-end label for this handler's action
* *
* @var string * @var string
*/ */
protected $label = 'Edit'; protected $label = 'Edit';
/** /**
* Front-end icon path for this handler's action. * Front-end icon path for this handler's action.
* *
* @var string * @var string
*/ */
protected $icon = ''; protected $icon = '';
@ -68,22 +68,22 @@ class EditHandler extends Handler
/** /**
* Extra classes to add to the bulk action button for this 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 * Can also be used to set the button font-icon e.g. font-icon-trash
* *
* @var string * @var string
*/ */
protected $buttonClasses = 'font-icon-edit'; protected $buttonClasses = 'font-icon-edit';
/** /**
* Whether this handler should be called via an XHR from the front-end * Whether this handler should be called via an XHR from the front-end
* *
* @var boolean * @var boolean
*/ */
protected $xhr = false; protected $xhr = false;
/** /**
* Set to true is this handler will destroy any data. * Set to true is this handler will destroy any data.
* A warning and confirmation will be shown on the front-end. * A warning and confirmation will be shown on the front-end.
* *
* @var boolean * @var boolean
*/ */
protected $destructive = false; protected $destructive = false;
@ -107,7 +107,7 @@ class EditHandler extends Handler
*/ */
public function Link($action = null) public function Link($action = null)
{ {
return Controller::join_links(parent::Link(), $this->stat('url_segment'), $action); return Controller::join_links(parent::Link(), static::config()->get('url_segment'), $action);
} }
/** /**
@ -128,19 +128,17 @@ class EditHandler extends Handler
$actions->push( $actions->push(
FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all')) FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all'))
->setAttribute('id', 'bulkEditingSaveBtn') ->setAttribute('id', 'bulkEditingSaveBtn')
->addExtraClass('btn btn-success') ->addExtraClass('btn btn-success font-icon font-icon-save')
->setAttribute('data-icon', 'accept')
->setUseButtonTag(true) ->setUseButtonTag(true)
); );
$actions->push( $actions->push(
FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel')) FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel'))
->setAttribute('id', 'bulkEditingUpdateCancelBtn') ->setAttribute('id', 'bulkEditingUpdateCancelBtn')
->addExtraClass('btn btn-danger cms-panel-link') ->addExtraClass('btn btn-danger cms-panel-link font-icon font-icon-cancel')
->setAttribute('data-icon', 'decline')
->setAttribute('href', $one_level_up->Link) ->setAttribute('href', $one_level_up->Link)
->setUseButtonTag(true) ->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(); $recordList = $this->getRecordIDList();
@ -364,7 +362,7 @@ class EditHandler extends Handler
'type' => 'Includes', 'type' => 'Includes',
'SilverStripe\\Admin\\LeftAndMain_EditForm', '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'); $form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
Requirements::javascript('colymba/gridfield-bulk-editing-tools:client/dist/js/main.js'); Requirements::javascript('colymba/gridfield-bulk-editing-tools:client/dist/js/main.js');