Port columns_definitions/move_column to Twig

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2017-10-09 16:36:19 -03:00
parent 1cd0a8027d
commit 004701c1f6
3 changed files with 17 additions and 17 deletions

View File

@ -155,10 +155,10 @@ $ci_offset = -1;
<td class="center">
<?= PhpMyAdmin\Template::get('columns_definitions/move_column')
->render(array(
'columnNumber' => $columnNumber,
'column_number' => $columnNumber,
'ci' => $ci++,
'ci_offset' => $ci_offset,
'columnMeta' => $columnMeta,
'column_meta' => $columnMeta,
'move_columns' => $move_columns,
'current_index' => $current_index
)); ?>

View File

@ -1,15 +0,0 @@
<select id="field_<?= $columnNumber; ?>_<?= ($ci - $ci_offset); ?>"
name="field_move_to[<?= $columnNumber; ?>]"
size="1"
width="5em">
<option value="" selected="selected">&nbsp;</option>
<option value="-first" <?= ($current_index == 0 ? ' disabled="disabled"' : ''); ?>>
<?= __('first'); ?>
</option>
<?php for ($mi = 0, $cols = count($move_columns); $mi < $cols; $mi++): ?>
<option value="<?= htmlspecialchars($move_columns[$mi]->name); ?>"
<?= (($current_index == $mi || $current_index == $mi + 1) ? ' disabled="disabled"' : '');?>>
<?= sprintf(__('after %s'), PhpMyAdmin\Util::backquote(htmlspecialchars($move_columns[$mi]->name))); ?>
</option>
<?php endfor; ?>
</select>

View File

@ -0,0 +1,15 @@
<select id="field_{{ column_number }}_{{ ci - ci_offset }}"
name="field_move_to[{{ column_number }}]"
size="1"
width="5em">
<option value="" selected="selected">&nbsp;</option>
<option value="-first"{{ current_index == 0 ? ' disabled="disabled"' }}>
{% trans 'first' %}
</option>
{% for mi in 0..move_columns|length - 1 %}
<option value="{{ move_columns[mi].name }}"
{{- current_index == mi or current_index == mi + 1 ? ' disabled="disabled"' }}>
{{ 'after %s'|trans|format(Util_backquote(move_columns[mi].name|e)) }}
</option>
{% endfor %}
</select>