switcher.phtml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php /* @var $block \Magento\Backend\Block\Template */ ?>
  9. <div class="field field-store-switcher">
  10. <label class="label" for="store_switcher"><?= /* @escapeNotVerified */ __('Current Configuration Scope:') ?></label>
  11. <div class="control">
  12. <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')">
  13. <?php foreach ($block->getStoreSelectOptions() as $_value => $_option): ?>
  14. <?php if (isset($_option['is_group'])): ?>
  15. <?php if ($_option['is_close']): ?>
  16. </optgroup>
  17. <?php else: ?>
  18. <optgroup label="<?= $block->escapeHtml($_option['label']) ?>" style="<?= /* @escapeNotVerified */ $_option['style'] ?>">
  19. <?php endif; ?>
  20. <?php continue ?>
  21. <?php endif; ?>
  22. <option value="<?= $block->escapeHtml($_value) ?>" url="<?= /* @escapeNotVerified */ $_option['url'] ?>" <?= $_option['selected'] ? 'selected="selected"' : '' ?> style="<?= /* @escapeNotVerified */ $_option['style'] ?>">
  23. <?= $block->escapeHtml($_option['label']) ?>
  24. </option>
  25. <?php endforeach ?>
  26. </select>
  27. </div>
  28. <?= $block->getHintHtml() ?>
  29. <?php if ($block->getAuthorization()->isAllowed('Magento_Backend::store')): ?>
  30. <div class="actions">
  31. <a href="<?= /* @escapeNotVerified */ $block->getUrl('*/system_store') ?>"><?= /* @escapeNotVerified */ __('Stores') ?></a>
  32. </div>
  33. <?php endif; ?>
  34. </div>