Refactor server_variables templates
Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
This commit is contained in:
parent
15ae8d7fe5
commit
217a0db2f8
@ -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;
|
||||
|
||||
@ -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"> {{ value }}</td>
|
||||
</tr>
|
||||
@ -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"> {{ session_value }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user