Page.php 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cms\Block\Adminhtml;
  7. /**
  8. * Adminhtml cms pages content block
  9. */
  10. class Page extends \Magento\Backend\Block\Widget\Grid\Container
  11. {
  12. /**
  13. * Block constructor
  14. *
  15. * @return void
  16. */
  17. protected function _construct()
  18. {
  19. $this->_controller = 'adminhtml_page';
  20. $this->_blockGroup = 'Magento_Cms';
  21. $this->_headerText = __('Manage Pages');
  22. parent::_construct();
  23. if ($this->_isAllowedAction('Magento_Cms::save')) {
  24. $this->buttonList->update('add', 'label', __('Add New Page'));
  25. } else {
  26. $this->buttonList->remove('add');
  27. }
  28. }
  29. /**
  30. * Check permission for passed action
  31. *
  32. * @param string $resourceId
  33. * @return bool
  34. */
  35. protected function _isAllowedAction($resourceId)
  36. {
  37. return $this->_authorization->isAllowed($resourceId);
  38. }
  39. }