WishlistTab.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Wishlist\Block\Adminhtml;
  7. use Magento\Framework\Registry;
  8. use Magento\Backend\Block\Template\Context;
  9. use Magento\Ui\Component\Layout\Tabs\TabWrapper;
  10. use Magento\Ui\Component\Layout\Tabs\TabInterface;
  11. use Magento\Customer\Controller\RegistryConstants;
  12. /**
  13. * Class WishlistTab
  14. */
  15. class WishlistTab extends TabWrapper implements TabInterface
  16. {
  17. /**
  18. * Core registry
  19. *
  20. * @var Registry
  21. */
  22. protected $coreRegistry = null;
  23. /**
  24. * @var bool
  25. */
  26. protected $isAjaxLoaded = true;
  27. /**
  28. * Constructor
  29. *
  30. * @param Context $context
  31. * @param Registry $registry
  32. * @param array $data
  33. */
  34. public function __construct(Context $context, Registry $registry, array $data = [])
  35. {
  36. $this->coreRegistry = $registry;
  37. parent::__construct($context, $data);
  38. }
  39. /**
  40. * @inheritdoc
  41. */
  42. public function canShowTab()
  43. {
  44. return $this->coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID);
  45. }
  46. /**
  47. * Return Tab label
  48. *
  49. * @return \Magento\Framework\Phrase
  50. */
  51. public function getTabLabel()
  52. {
  53. return __('Wish List');
  54. }
  55. /**
  56. * Return URL link to Tab content
  57. *
  58. * @return string
  59. */
  60. public function getTabUrl()
  61. {
  62. return $this->getUrl('customer/*/wishlist', ['_current' => true]);
  63. }
  64. }