split.phtml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. /** @var $block \Magento\Backend\Block\Widget\Button\SplitButton */
  10. ?>
  11. <div <?= $block->getAttributesHtml() ?>>
  12. <button <?= $block->getButtonAttributesHtml() ?>>
  13. <span><?= $block->escapeHtml($block->getLabel()) ?></span>
  14. </button>
  15. <?php if ($block->hasSplit()): ?>
  16. <button <?= $block->getToggleAttributesHtml() ?>>
  17. <span>Select</span>
  18. </button>
  19. <?php if (!$block->getDisabled()): ?>
  20. <ul class="dropdown-menu" <?= /* @escapeNotVerified */ $block->getUiId("dropdown-menu") ?>>
  21. <?php foreach ($block->getOptions() as $key => $option): ?>
  22. <li>
  23. <span <?= $block->getOptionAttributesHtml($key, $option) ?>>
  24. <?= $block->escapeHtml($option['label']) ?>
  25. </span>
  26. <?php if (isset($option['hint'])): ?>
  27. <div class="tooltip" <?= /* @escapeNotVerified */ $block->getUiId('item', $key, 'tooltip') ?>>
  28. <a href="<?= $block->escapeHtml($option['hint']['href']) ?>" class="help">
  29. <?= $block->escapeHtml($option['hint']['label']) ?>
  30. </a>
  31. </div>
  32. <?php endif; ?>
  33. </li>
  34. <?php endforeach; ?>
  35. </ul>
  36. <?php endif; ?>
  37. <?php endif; ?>
  38. </div>
  39. <script type="text/x-magento-init">
  40. {
  41. ".actions-split": {
  42. "Magento_Ui/js/grid/controls/button/split": {}
  43. }
  44. }
  45. </script>