Tabs.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
  4. * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
  5. *
  6. * Glory to Ukraine! Glory to the heroes!
  7. */
  8. namespace Magefan\Blog\Block\Adminhtml\Post\Edit;
  9. /**
  10. * Admin page left menu
  11. */
  12. class Tabs extends \Magento\Backend\Block\Widget\Tabs
  13. {
  14. /**
  15. * @return void
  16. */
  17. protected function _construct()
  18. {
  19. parent::_construct();
  20. $this->setId('post_tabs');
  21. $this->setDestElementId('edit_form');
  22. $this->setTitle(__('Post Information'));
  23. }
  24. protected function _beforeToHtml()
  25. {
  26. $this->addTab(
  27. 'related_posts_section',
  28. [
  29. 'label' => __('Related Posts'),
  30. 'url' => $this->getUrl('blog/post/relatedPosts', ['_current' => true]),
  31. 'class' => 'ajax',
  32. ]
  33. );
  34. $this->addTab(
  35. 'related_products_section',
  36. [
  37. 'label' => __('Related Products'),
  38. 'url' => $this->getUrl('blog/post/relatedProducts', ['_current' => true]),
  39. 'class' => 'ajax',
  40. ]
  41. );
  42. return parent::_beforeToHtml();
  43. }
  44. }