Refactor server_variables templates

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
This commit is contained in:
Leonardo Strozzi 2018-06-29 16:29:16 -03:00
parent 15ae8d7fe5
commit 217a0db2f8
3 changed files with 16 additions and 17 deletions

View File

@ -344,6 +344,12 @@ class ServerVariablesController extends Controller
? $this->variable_doc_links[$name] : null;
list($formattedValue, $isHtmlFormatted) = $this->_formatVariable($name, $value);
if ($has_session_value) {
list($sessionFormattedValue, $sessionIsHtmlFormatted) = $this->_formatVariable(
$name,
$serverVarsSession[$name]
);
}
$output .= $this->template->render('server/variables/variable_row', [
'row_class' => $row_class,
@ -356,19 +362,10 @@ class ServerVariablesController extends Controller
'value' => $formattedValue,
'is_superuser' => $this->dbi->isSuperuser(),
'is_html_formatted' => $isHtmlFormatted,
'has_session_value' => $has_session_value,
'session_value' => isset($sessionFormattedValue)?$sessionFormattedValue:null,
'session_is_html_formated' => isset($sessionIsHtmlFormatted)?$sessionIsHtmlFormatted:null
]);
if ($has_session_value) {
list($formattedValue, $isHtmlFormatted) = $this->_formatVariable(
$name,
$serverVarsSession[$name]
);
$output .= $this->template->render('server/variables/session_variable_row', [
'row_class' => $row_class,
'value' => $formattedValue,
'is_html_formatted' => $isHtmlFormatted,
]);
}
}
return $output;

View File

@ -1,5 +0,0 @@
<tr class="var-row {{ row_class }}" data-filter-row="{{ name | upper }}">
<td class="var-action"></td>
<td class="var-name session">({% trans 'Session value' %})</td>
<td class="var-value value">&nbsp;{{ value }}</td>
</tr>

View File

@ -27,3 +27,10 @@
{% endif %}
</td>
</tr>
{% if has_session_value %}
<tr class="var-row {{ row_class }}" data-filter-row="{{ name|upper }}">
<td class="var-action"></td>
<td class="var-name session">({% trans 'Session value' %})</td>
<td class="var-value value">&nbsp;{{ session_value }}</td>
</tr>
{% endif %}