123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Cms\Block\Adminhtml\Page\Edit;
- use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
- use Magento\Ui\Component\Control\Container;
- /**
- * Class SaveButton
- * @package Magento\Customer\Block\Adminhtml\Edit
- */
- class SaveButton extends GenericButton implements ButtonProviderInterface
- {
- /**
- * @return array
- */
- public function getButtonData()
- {
- return [
- 'label' => __('Save'),
- 'class' => 'save primary',
- 'data_attribute' => [
- 'mage-init' => [
- 'buttonAdapter' => [
- 'actions' => [
- [
- 'targetName' => 'cms_page_form.cms_page_form',
- 'actionName' => 'save',
- 'params' => [
- false
- ]
- ]
- ]
- ]
- ]
- ],
- 'class_name' => Container::SPLIT_BUTTON,
- 'options' => $this->getOptions(),
- 'sort_order' => 90,
- ];
- }
- /**
- * Retrieve options
- *
- * @return array
- */
- private function getOptions()
- {
- $options = [
- [
- 'label' => __('Save & Duplicate'),
- 'id_hard' => 'save_and_duplicate',
- 'data_attribute' => [
- 'mage-init' => [
- 'buttonAdapter' => [
- 'actions' => [
- [
- 'targetName' => 'cms_page_form.cms_page_form',
- 'actionName' => 'save',
- 'params' => [
- true,
- [
- 'back' => 'duplicate'
- ]
- ]
- ]
- ]
- ]
- ]
- ],
- ],
- [
- 'id_hard' => 'save_and_close',
- 'label' => __('Save & Close'),
- 'data_attribute' => [
- 'mage-init' => [
- 'buttonAdapter' => [
- 'actions' => [
- [
- 'targetName' => 'cms_page_form.cms_page_form',
- 'actionName' => 'save',
- 'params' => [
- true
- ]
- ]
- ]
- ]
- ]
- ],
- ]
- ];
- return $options;
- }
- }
|