Tabs.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\User\Block\User\Edit;
  7. /**
  8. * User page left menu
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @since 100.0.2
  13. */
  14. class Tabs extends \Magento\Backend\Block\Widget\Tabs
  15. {
  16. /**
  17. * Class constructor
  18. *
  19. * @return void
  20. */
  21. protected function _construct()
  22. {
  23. parent::_construct();
  24. $this->setId('page_tabs');
  25. $this->setDestElementId('edit_form');
  26. $this->setTitle(__('User Information'));
  27. }
  28. /**
  29. * @return $this
  30. */
  31. protected function _beforeToHtml()
  32. {
  33. $this->addTab(
  34. 'main_section',
  35. [
  36. 'label' => __('User Info'),
  37. 'title' => __('User Info'),
  38. 'content' => $this->getLayout()->createBlock(\Magento\User\Block\User\Edit\Tab\Main::class)->toHtml(),
  39. 'active' => true
  40. ]
  41. );
  42. $this->addTab(
  43. 'roles_section',
  44. [
  45. 'label' => __('User Role'),
  46. 'title' => __('User Role'),
  47. 'content' => $this->getLayout()->createBlock(
  48. \Magento\User\Block\User\Edit\Tab\Roles::class,
  49. 'user.roles.grid'
  50. )->toHtml()
  51. ]
  52. );
  53. return parent::_beforeToHtml();
  54. }
  55. }