src/Eccube/Resource/template/admin/Store/plugin_table.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. <script>
  9. $(function() {
  10.     $('#localPluginDeleteModal').on('show.bs.modal', function(e) {
  11.         var deleteUrl = $(e.relatedTarget).data('delete-url');
  12.         $('div.modal-footer a', this).attr('href', deleteUrl);
  13.     });
  14. });
  15. </script>
  16. {% if Plugins|length > 0 %}
  17.     <div class="card-body p-0">
  18.         <table class="table table-sm">
  19.             <thead>
  20.             <tr>
  21.                 <th class="border-top-0 ps-3 pt-2 pb-2">{{ 'admin.store.plugin_table.887'|trans }}</th>
  22.                 <th class="border-top-0 pt-2 pb-2">{{ 'admin.store.plugin_table.888'|trans }}</th>
  23.                 <th class="border-top-0 pt-2 pb-2">{{ 'admin.store.plugin_table.889'|trans }}</th>
  24.                 <th class="border-top-0 pt-2 pb-2">{{ 'admin.store.plugin_table.901'|trans }}</th>
  25.                 <th class="border-top-0 pt-2 pb-2">{{ 'admin.store.plugin_table.890'|trans }}</th>
  26.                 <th class="border-top-0 pt-2 pb-2">&nbsp;</th>
  27.             </tr>
  28.             </thead>
  29.             <tbody>
  30.             {% for Plugin in Plugins %}
  31.                 {% set form = plugin_forms[Plugin.id] %}
  32.                 {% form_theme form '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}
  33.                 <form id="{{ form.vars.name }}" name="{{ form.vars.name }}" method="post" action=""
  34.                       enctype="multipart/form-data">
  35.                     <tr class="{% if Plugin.enabled == false %}active{% endif %}">
  36.                         <td class="align-middle ps-3">
  37.                             {{ Plugin.name }}
  38.                         </td>
  39.                         <td class="align-middle">{{ Plugin.version }}</td>
  40.                         <td class="align-middle">{{ Plugin.code }}
  41.                             {#TODO: readme of plugin #}
  42.                             {#{% if attribute(app.config[Plugin.code].const, 'readme') is defined %}
  43.                                 <br>
  44.                                 <a href="#" class="view_readme" data-bs-toggle="modal" data-bs-target="#readmeModal"
  45.                                    data-name="{{ Plugin.name }}"
  46.                                    data-readme="{{ attribute(app.config[Plugin.code].const, 'readme') }}">{{ 'admin.store.plugin_table.897'|trans }}</a>
  47.                             {% endif %}#}
  48.                         </td>
  49.                         <td class="align-middle">
  50.                             {% if Plugin.enabled %}
  51.                                 <span class="text-success">{{ 'common.enabled'|trans }}</span>
  52.                             {% else %}
  53.                                 <span class="text-secondary">{{ 'common.disabled'|trans }}</span>
  54.                             {% endif %}
  55.                         </td>
  56.                         <td class="align-middle">
  57.                             {% if Plugin.source == 0 %}
  58.                                 {{ form_widget(form._token) }}
  59.                                 {{ form_widget(form.plugin_id) }}
  60.                                 {{ form_widget(form.plugin_archive, {'attr': {'accept': 'application/zip,application/x-tar,application/x-gzip'}}) }}
  61.                                 {{ form_errors(form.plugin_archive) }}
  62.                                 <button class="btn btn-primary btn-xs mt-2"
  63.                                         onclick="changeActionSubmit('{{ url('admin_store_plugin_update', { id : Plugin.id }) }}', '{{ form.vars.name }}');">
  64.                                     {{ 'admin.store.plugin_table.898'|trans }}
  65.                                 </button>
  66.                             {% endif %}
  67.                         </td>
  68.                         <td class="align-middle">
  69.                             <div class="col-12 col-xs-11 col-md-12 col-lg-12 float-end text-center">
  70.                                 <div class="row">
  71.                                         {% if Plugin.enabled == false %}
  72.                                         <div class="col-6 px-0">
  73.                                             <a href="#" class="btn btn-ec-actionIcon"
  74.                                                data-bs-toggle="modal"
  75.                                                data-bs-target="#localPluginDeleteModal"
  76.                                                data-delete-url="{{ url('admin_store_plugin_uninstall', { id : Plugin.id }) }}">
  77.                                                 <i class="fa fa-close fa-lg text-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="削除"></i>
  78.                                             </a>
  79.                                         </div>
  80.                                         {% endif %}
  81.                                         {% if Plugin.enabled %}
  82.                                         <div class="col-6 px-0">
  83.                                             <a href="{{ url('admin_store_plugin_disable', { id : Plugin.id }) }}" {{ csrf_token_for_anchor() }}
  84.                                                class="btn btn-ec-actionIcon"
  85.                                                data-method="post" data-confirm="false">
  86.                                                 <i class="fa fa-pause fa-lg text-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.store.plugin_table.903'|trans }}"></i>
  87.                                             </a>
  88.                                         </div>
  89.                                         {% else %}
  90.                                         <div class="col-6 px-0">
  91.                                             <a href="{{ url('admin_store_plugin_enable', { id : Plugin.id }) }}" {{ csrf_token_for_anchor() }}
  92.                                                class="btn btn-ec-actionIcon"
  93.                                                data-method="post" data-confirm="false">
  94.                                                 <i class="fa fa-play fa-lg text-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.store.plugin_table.902'|trans }}"></i>
  95.                                             </a>
  96.                                         </div>
  97.                                         {% endif %}
  98.                                         {% if configPages[Plugin.code] is defined %}
  99.                                         <div class="col-6 px-0">
  100.                                             <a href='{{ configPages[Plugin.code] }}'
  101.                                                class="btn btn-ec-actionIcon">
  102.                                                 <i class="fa fa-cog fa-lg text-secondary" data-bs-toggle="tooltip"
  103.                                                    data-bs-placement="top" title="{{ 'admin.store.plugin_table.891'|trans }}"></i></a>
  104.                                         </div>
  105.                                         {% endif %}
  106.                                 </div>
  107.                             </div>
  108.                         </td>
  109.                     </tr>
  110.                 </form>
  111.             {% endfor %}
  112.             </tbody>
  113.         </table>
  114.     </div>
  115. {% else %}
  116.     <div class="card-body">
  117.         <div class="text-danger">
  118.             {{ 'admin.store.plugin_table.900'|trans }}
  119.         </div>
  120.     </div>
  121. {% endif %}
  122. <div class="modal fade" id="localPluginDeleteModal" tabindex="-1"
  123.      role="dialog"
  124.      aria-labelledby="localPluginDeleteModal" aria-hidden="true">
  125.     <div class="modal-dialog" role="document">
  126.         <div class="modal-content">
  127.             <div class="modal-header">
  128.                 <h5 class="modal-title fw-bold">
  129.                     {{ 'admin.store.plugin.popup.delete.confirm.title'|trans }}</h5>
  130.                 <button class="close" type="button"
  131.                         data-bs-dismiss="modal"
  132.                         aria-label="Close">
  133.                 </button>
  134.             </div>
  135.             <div class="modal-body text-start">
  136.                 <p class="text-start">
  137.                     {{ 'admin.store.plugin.popup.delete.confirm.message'|trans }}</p>
  138.             </div>
  139.             <div class="modal-footer">
  140.                 <button class="btn btn-ec-sub" type="button"
  141.                         data-bs-dismiss="modal">{{ 'admin.common.cancel'|trans }}
  142.                 </button>
  143.                 <a href="#" {{ csrf_token_for_anchor() }}
  144.                    class="btn btn-ec-delete"
  145.                    data-confirm="false"
  146.                    data-method="delete">
  147.                     {{ 'admin.common.delete'|trans }}
  148.                 </a>
  149.             </div>
  150.         </div>
  151.     </div>
  152. </div>