privileges_summary.twig 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <form class="submenu-item" action="server_privileges.php" id="{{ form_id }}" method="post">
  2. {{ Url_getHiddenInputs() }}
  3. <input type="hidden" name="username" value="{{ username }}" />
  4. <input type="hidden" name="hostname" value="{{ hostname }}" />
  5. <fieldset>
  6. <legend data-submenu-label="{{ sub_menu_label }}">
  7. {{ legend }}
  8. </legend>
  9. <table class="data">
  10. <thead>
  11. <tr>
  12. <th>{{ type_label }}</th>
  13. <th>{% trans 'Privileges' %}</th>
  14. <th>{% trans 'Grant' %}</th>
  15. {% if type == 'database' %}
  16. <th>{% trans 'Table-specific privileges' %}</th>
  17. {% elseif type == 'table' %}
  18. <th>{% trans 'Column-specific privileges' %}</th>
  19. {% endif %}
  20. <th colspan="2">{% trans 'Action' %}</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. {% if privileges|length == 0 %}
  25. {% set colspan = type == 'database' ? 7 : (type == 'table' ? 6 : 5) %}
  26. <tr>
  27. <td colspan="{{ colspan }}"><center><em>{% trans 'None' %}</em></center></td>
  28. </tr>
  29. {% else %}
  30. {% for privilege in privileges %}
  31. {% include 'privileges/privileges_summary_row.twig' with
  32. privilege|merge({'type': type})
  33. only %}
  34. {% endfor %}
  35. {% endif %}
  36. </tbody>
  37. </table>
  38. {% if type == 'database' %}
  39. {% include 'privileges/add_privileges_database.twig' with {
  40. 'databases': databases
  41. } only %}
  42. {% elseif type == 'table' %}
  43. {% include 'privileges/add_privileges_table.twig' with {
  44. 'database': database,
  45. 'tables': tables
  46. } only %}
  47. {% else %}
  48. {% include 'privileges/add_privileges_routine.twig' with {
  49. 'database': database,
  50. 'routines': routines
  51. } only %}
  52. {% endif %}
  53. </fieldset>
  54. <fieldset class="tblFooters">
  55. <input type="submit" value="{% trans 'Go' %}" />
  56. </fieldset>
  57. </form>