column_definitions_form.twig 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <form method="post" action="{{ action }}" class="
  2. {{- action == 'tbl_create.php' ? 'create_table' : 'append_fields' -}}
  3. _form ajax lock-page">
  4. {{ Url_getHiddenInputs(form_params) }}
  5. {# happens when an index has been set on a column #}
  6. {# and a column is added to the table creation dialog #}
  7. {# This contains a JSON-encoded string #}
  8. <input type="hidden" name="primary_indexes" value="
  9. {{- primary_indexes is not empty ? primary_indexes : '[]' }}">
  10. <input type="hidden" name="unique_indexes" value="
  11. {{- unique_indexes is not empty ? unique_indexes : '[]' }}">
  12. <input type="hidden" name="indexes" value="
  13. {{- indexes is not empty ? indexes : '[]' }}">
  14. <input type="hidden" name="fulltext_indexes" value="
  15. {{- fulltext_indexes is not empty ? fulltext_indexes : '[]' }}">
  16. <input type="hidden" name="spatial_indexes" value="
  17. {{- spatial_indexes is not empty ? spatial_indexes : '[]' }}">
  18. {% if action == 'tbl_create.php' %}
  19. <div id="table_name_col_no_outer">
  20. <table id="table_name_col_no" class="tdblock">
  21. <tr class="vmiddle floatleft">
  22. <td>{% trans 'Table name' %}:
  23. <input type="text"
  24. name="table"
  25. size="40"
  26. maxlength="64"
  27. value="{{ table is defined ? table }}"
  28. class="textfield" autofocus required />
  29. </td>
  30. <td>
  31. {% trans 'Add' %}
  32. <input type="number"
  33. id="added_fields"
  34. name="added_fields"
  35. size="2"
  36. value="1"
  37. min="1"
  38. onfocus="this.select()" />
  39. {% trans 'column(s)' %}
  40. <input type="button"
  41. name="submit_num_fields"
  42. value="{% trans 'Go' %}" />
  43. </td>
  44. </tr>
  45. </table>
  46. </div>
  47. {% endif %}
  48. {% if content_cells is iterable %}
  49. {% include 'columns_definitions/table_fields_definitions.twig' with {
  50. 'is_backup': is_backup,
  51. 'fields_meta': fields_meta,
  52. 'mimework': mimework,
  53. 'content_cells': content_cells,
  54. 'change_column': change_column,
  55. 'is_virtual_columns_supported': is_virtual_columns_supported,
  56. 'browse_mime': browse_mime,
  57. 'server_type': server_type,
  58. 'max_rows': max_rows,
  59. 'char_editing': char_editing,
  60. 'attribute_types': attribute_types,
  61. 'privs_available': privs_available,
  62. 'max_length': max_length,
  63. 'dbi': dbi,
  64. 'disable_is': disable_is
  65. } only %}
  66. {% endif %}
  67. {% if action == 'tbl_create.php' %}
  68. <div class="responsivetable">
  69. <table>
  70. <tr class="vtop">
  71. <th>{% trans 'Table comments:' %}</th>
  72. <td width="25">&nbsp;</td>
  73. <th>{% trans 'Collation:' %}</th>
  74. <td width="25">&nbsp;</td>
  75. <th>
  76. {% trans 'Storage Engine:' %}
  77. {{ Util_showMySQLDocu('Storage_engines') }}
  78. </th>
  79. <td width="25">&nbsp;</td>
  80. <th>
  81. {% trans 'Connection:' %}
  82. {{ Util_showMySQLDocu('federated-create-connection') }}
  83. </th>
  84. </tr>
  85. <tr>
  86. <td>
  87. <input type="text"
  88. name="comment"
  89. size="40"
  90. maxlength="60"
  91. value="{{ comment is defined ? comment }}"
  92. class="textfield" />
  93. </td>
  94. <td width="25">&nbsp;</td>
  95. <td>
  96. {{ Charsets_getCollationDropdownBox(
  97. dbi,
  98. disable_is,
  99. 'tbl_collation',
  100. null,
  101. tbl_collation,
  102. false
  103. ) }}
  104. </td>
  105. <td width="25">&nbsp;</td>
  106. <td>
  107. {{ StorageEngine_getHtmlSelect(
  108. 'tbl_storage_engine',
  109. null,
  110. tbl_storage_engine
  111. ) }}
  112. </td>
  113. <td width="25">&nbsp;</td>
  114. <td>
  115. <input type="text"
  116. name="connection"
  117. size="40"
  118. value="{{ connection is defined ? connection }}"
  119. placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"
  120. class="textfield"
  121. required="required" />
  122. </td>
  123. </tr>
  124. {% if have_partitioning %}
  125. <tr class="vtop">
  126. <th colspan="5">
  127. {% trans 'PARTITION definition:' %}
  128. {{ Util_showMySQLDocu('Partitioning') }}
  129. </th>
  130. </tr>
  131. <tr>
  132. <td colspan="5">
  133. {% include 'columns_definitions/partitions.twig' with {
  134. 'partition_details': partition_details
  135. } only %}
  136. </td>
  137. </tr>
  138. {% endif %}
  139. </table>
  140. </div>
  141. {% endif %}
  142. <fieldset class="tblFooters">
  143. <input type="button"
  144. class="preview_sql"
  145. value="{% trans 'Preview SQL' %}" />
  146. <input type="submit"
  147. name="do_save_data"
  148. value="{% trans 'Save' %}" />
  149. </fieldset>
  150. <div id="properties_message"></div>
  151. </form>