edit.phtml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. /**
  10. * @methods
  11. * getTitle() - string
  12. * getSaveUrl() - string
  13. * getSections() - array
  14. * getForm() - html
  15. */
  16. ?>
  17. <div data-mage-init='{"floatingHeader": {}}' class="page-actions"><?= $block->getSaveButtonHtml() ?></div>
  18. <form action="<?= /* @escapeNotVerified */ $block->getSaveUrl() ?>" method="post" id="config-edit-form" enctype="multipart/form-data">
  19. <?= $block->getBlockHtml('formkey') ?>
  20. <script>
  21. window.setCacheAction = function(id, button) {
  22. document.getElementById(id).value = button.id;
  23. configForm.submit();
  24. }
  25. </script>
  26. <input type="hidden" id="catalog_action" name="catalog_action" value="" />
  27. <input type="hidden" id="jscss_action" name="jscss_action" value="" />
  28. <?= $block->getChildHtml('form') ?>
  29. <div class="entry-edit">
  30. <div class="entry-edit-head">
  31. <h4 class="icon-head head-edit-form fieldset-legend"><?= /* @escapeNotVerified */ __('Catalog') ?></h4>
  32. </div>
  33. <fieldset id="catalog">
  34. <table class="form-list">
  35. <tbody>
  36. <?php foreach ($block->getCatalogData() as $_item): ?>
  37. <?php /* disable reindex buttons. functionality moved to index management*/?>
  38. <?php if ($_item['buttons'][0]['name'] != 'clear_images_cache') {
  39. continue;
  40. }?>
  41. <tr>
  42. <td class="label"><label><?= /* @escapeNotVerified */ $_item['label'] ?></label></td>
  43. <td class="value">
  44. <?php foreach ($_item['buttons'] as $_button): ?>
  45. <?php $clickAction = "setCacheAction('catalog_action',this)"; ?>
  46. <?php if (isset($_button['warning']) && $_button['warning']): ?>
  47. <?php $clickAction = "if (confirm('" . addslashes($_button['warning']) . "')) {{$clickAction}}"; ?>
  48. <?php endif; ?>
  49. <button <?php if (!isset($_button['disabled']) || !$_button['disabled']):?>onclick="<?= /* @escapeNotVerified */ $clickAction ?>"<?php endif; ?> id="<?= /* @escapeNotVerified */ $_button['name'] ?>" type="button" class="scalable <?php if (isset($_button['disabled']) && $_button['disabled']):?>disabled<?php endif; ?>" style=""><span><span><span><?= /* @escapeNotVerified */ $_button['action'] ?></span></span></span></button>
  50. <?php if (isset($_button['comment'])): ?> <br /> <small><?= /* @escapeNotVerified */ $_button['comment'] ?></small> <?php endif; ?>
  51. <?php endforeach; ?>
  52. </td>
  53. <td><small>&nbsp;</small></td>
  54. </tr>
  55. <?php endforeach; ?>
  56. </tbody>
  57. </table>
  58. </fieldset>
  59. </div>
  60. <div class="entry-edit">
  61. <div class="entry-edit-head">
  62. <h4 class="icon-head head-edit-form fieldset-legend"><?= /* @escapeNotVerified */ __('JavaScript/CSS') ?></h4>
  63. </div>
  64. <fieldset id="jscss">
  65. <table class="form-list">
  66. <tbody>
  67. <tr>
  68. <td class="label"><label><?= /* @escapeNotVerified */ __('JavaScript/CSS Cache') ?></label></td>
  69. <td class="value">
  70. <button onclick="setCacheAction('jscss_action', this)" id='jscss_action' type="button" class="scalable"><span><span><span><?= /* @escapeNotVerified */ __('Clear') ?></span></span></span></button>
  71. </td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. </fieldset>
  76. </div>
  77. </form>
  78. <script>
  79. require(["jquery","mage/mage"],function($){
  80. $('#config-edit-form').mage('form').mage('validation');
  81. });
  82. </script>