-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mainline/develop' into BUGS
- Loading branch information
Showing
70 changed files
with
1,794 additions
and
1,846 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Cms/Block/Adminhtml/Block/Edit/BackButton.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Cms\Block\Adminhtml\Block\Edit; | ||
|
||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface; | ||
|
||
/** | ||
* Class BackButton | ||
*/ | ||
class BackButton extends GenericButton implements ButtonProviderInterface | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getButtonData() | ||
{ | ||
return [ | ||
'label' => __('Back'), | ||
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()), | ||
'class' => 'back', | ||
'sort_order' => 10 | ||
]; | ||
} | ||
|
||
/** | ||
* Get URL for back (reset) button | ||
* | ||
* @return string | ||
*/ | ||
public function getBackUrl() | ||
{ | ||
return $this->getUrl('*/*/'); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
app/code/Magento/Cms/Block/Adminhtml/Block/Edit/DeleteButton.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Cms\Block\Adminhtml\Block\Edit; | ||
|
||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface; | ||
|
||
/** | ||
* Class DeleteButton | ||
*/ | ||
class DeleteButton extends GenericButton implements ButtonProviderInterface | ||
{ | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getButtonData() | ||
{ | ||
$data = []; | ||
if ($this->getPageId()) { | ||
$data = [ | ||
'label' => __('Delete Block'), | ||
'class' => 'delete', | ||
'on_click' => 'deleteConfirm(\'' . __( | ||
'Are you sure you want to do this?' | ||
) . '\', \'' . $this->getDeleteUrl() . '\')', | ||
'sort_order' => 20, | ||
]; | ||
} | ||
return $data; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDeleteUrl() | ||
{ | ||
return $this->getUrl('*/*/delete', ['block_id' => $this->getPageId()]); | ||
} | ||
} |
159 changes: 0 additions & 159 deletions
159
app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
app/code/Magento/Cms/Block/Adminhtml/Block/Edit/GenericButton.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Cms\Block\Adminhtml\Block\Edit; | ||
|
||
use Magento\Cms\Controller\RegistryConstants; | ||
|
||
/** | ||
* Class GenericButton | ||
*/ | ||
class GenericButton | ||
{ | ||
/** | ||
* Url Builder | ||
* | ||
* @var \Magento\Framework\UrlInterface | ||
*/ | ||
protected $urlBuilder; | ||
|
||
/** | ||
* Registry | ||
* | ||
* @var \Magento\Framework\Registry | ||
*/ | ||
protected $registry; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param \Magento\Backend\Block\Widget\Context $context | ||
* @param \Magento\Framework\Registry $registry | ||
*/ | ||
public function __construct( | ||
\Magento\Backend\Block\Widget\Context $context, | ||
\Magento\Framework\Registry $registry | ||
) { | ||
$this->urlBuilder = $context->getUrlBuilder(); | ||
$this->registry = $registry; | ||
} | ||
|
||
/** | ||
* Return the cms page Id. | ||
* | ||
* @return int|null | ||
*/ | ||
public function getPageId() | ||
{ | ||
$cmsBlock = $this->registry->registry(RegistryConstants::CMS_BLOCK); | ||
return $cmsBlock ? $cmsBlock->getId() : null; | ||
} | ||
|
||
/** | ||
* Generate url by route and parameters | ||
* | ||
* @param string $route | ||
* @param array $params | ||
* @return string | ||
*/ | ||
public function getUrl($route = '', $params = []) | ||
{ | ||
return $this->urlBuilder->getUrl($route, $params); | ||
} | ||
} |
Oops, something went wrong.