Port server/variables/variable_row to Twig

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2017-09-21 17:55:05 -03:00
parent 52a6bc0b06
commit 921e7852c8
2 changed files with 29 additions and 30 deletions

View File

@ -1,30 +0,0 @@
<tr class="var-row <?= $rowClass; ?>">
<td class="var-action">
<?php if ($editable): ?>
<a href="#" data-variable="<?= htmlspecialchars($name) ?>" class="editLink"><?= \PhpMyAdmin\Util::getIcon('b_edit.png', __('Edit')) ?></a>
<?php else: ?>
<span title="<?= __('This is a read-only variable and can not be edited') ?>" class="read_only_var">
<?= \PhpMyAdmin\Util::getIcon('bd_edit.png', __('Edit')) ?>
</span>
<?php endif; ?>
</td>
<td class="var-name">
<?php if ($docLink != null): ?>
<span title="<?= htmlspecialchars(str_replace('_', ' ', $name)); ?>">
<?= \PhpMyAdmin\Util::showMySQLDocu($docLink[1], false, $docLink[2] . '_' . $docLink[0], true)
, str_replace('_', '&nbsp;', htmlspecialchars($name))
, '</a>'
?>
</span>
<?php else: ?>
<?= htmlspecialchars(str_replace('_', ' ', $name)); ?>
<?php endif; ?>
</td>
<td class="var-value value <?= ($isSuperuser ? ' editable' : '') ?>">
<?php if ($isHtmlFormatted == false): ?>
<?= str_replace(',', ',&#8203;', htmlspecialchars($value)); ?>
<?php else: ?>
<?= $value; ?>
<?php endif; ?>
</td>
</tr>

View File

@ -0,0 +1,29 @@
<tr class="var-row {{ row_class }}">
<td class="var-action">
{% if editable %}
<a href="#" data-variable="{{ name }}" class="editLink">{{ Util_getIcon('b_edit.png', 'Edit'|trans) }}</a>
{% else %}
<span title="{% trans 'This is a read-only variable and can not be edited' %}" class="read_only_var">
{{ Util_getIcon('bd_edit.png', 'Edit'|trans) }}
</span>
{% endif %}
</td>
<td class="var-name">
{% if doc_link != null %}
<span title="{{ name|replace({'_': ' '}) }}">
{{ Util_showMySQLDocu(doc_link[1], false, doc_link[2] ~ '_' ~ doc_link[0], true) }}
{{ name|e|replace({'_': '&nbsp;'})|raw }}
</a>
</span>
{% else %}
{{ name|replace({'_': ' '}) }}
{% endif %}
</td>
<td class="var-value value{{ is_superuser ? ' editable' }}">
{% if is_html_formatted == false %}
{{ value|e|replace({',': ',&#8203;'})|raw }}
{% else %}
{{ value }}
{% endif %}
</td>
</tr>