Store.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Block\System\Store;
  7. /**
  8. * Adminhtml store content block
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class Store extends \Magento\Backend\Block\Widget\Grid\Container
  16. {
  17. /**
  18. * @var string
  19. */
  20. protected $_blockGroup = 'Magento_Backend';
  21. /**
  22. * @return void
  23. */
  24. protected function _construct()
  25. {
  26. $this->_blockGroup = 'Magento_Backend';
  27. $this->_controller = 'system_store';
  28. $this->_headerText = __('Stores');
  29. parent::_construct();
  30. /* Update default add button to add website button */
  31. $this->buttonList->update('add', 'label', __('Create Website'));
  32. $this->buttonList->update('add', 'onclick', "setLocation('" . $this->getUrl('adminhtml/*/newWebsite') . "')");
  33. /* Add Store Group button */
  34. $this->buttonList->add(
  35. 'add_group',
  36. [
  37. 'label' => __('Create Store'),
  38. 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/newGroup') . '\')',
  39. 'class' => 'add add-store'
  40. ],
  41. 1
  42. );
  43. /* Add Store button */
  44. $this->buttonList->add(
  45. 'add_store',
  46. [
  47. 'label' => __('Create Store View'),
  48. 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/newStore') . '\')',
  49. 'class' => 'add add-store-view'
  50. ]
  51. );
  52. }
  53. }