diff --git a/libraries/controllers/ServerVariablesController.php b/libraries/controllers/ServerVariablesController.php index ddc2765530..29002b7568 100644 --- a/libraries/controllers/ServerVariablesController.php +++ b/libraries/controllers/ServerVariablesController.php @@ -270,9 +270,11 @@ class ServerVariablesController extends Controller . '' . ''; + $output .= ''; $output .= $this->_getHtmlForServerVariablesItems( $serverVars, $serverVarsSession ); + $output .= ''; $output .= ''; @@ -293,75 +295,49 @@ class ServerVariablesController extends Controller ) { // list of static system variables $static_variables = $this->_getStaticSystemVariables(); + // list of documentation links + $variable_doc_links = $this->_getArrayForDocumentLinks(); - $output = ''; + $output = ''; $odd_row = true; foreach ($serverVars as $name => $value) { $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value; $row_class = ($odd_row ? ' odd' : ' even') . ($has_session_value ? ' diffSession' : ''); + $docLink = isset($variable_doc_links[$name]) + ? $variable_doc_links[$name] : null; + $formattedValue = $this->_formatVariable( + $name, $value, $variable_doc_links + ); - $output .= ''; - - $output .= ''; - - // Edit Link active only for Dynamic System variables - if (! in_array(strtolower($name), $static_variables)) { - $output .= '' - . Util::getIcon('b_edit.png', __('Edit')) . ''; - } else { - $output .= '' - . Util::getIcon('bd_edit.png', __('Edit')) - . ''; - } - - $output .= ''; - - $output .= ''; - $variable_doc_links = $this->_getArrayForDocumentLinks(); - // To display variable documentation link - if (isset($variable_doc_links[$name])) { - $output .= ''; - $output .= Util::showMySQLDocu( - $variable_doc_links[$name][1], - false, - $variable_doc_links[$name][2] . '_' . $variable_doc_links[$name][0], - true + $output .= Template::get('server/variables/variable_row') + ->render( + array( + 'rowClass' => $row_class, + 'editable' => ! in_array(strtolower($name), $static_variables), + 'docLink' => $docLink, + 'name' => $name, + 'value' => $formattedValue, + 'isSuperuser' => $this->dbi->isSuperuser(), + ) ); - $output .= htmlspecialchars(str_replace('_', ' ', $name)); - $output .= ''; - $output .= ''; - } else { - $output .= htmlspecialchars(str_replace('_', ' ', $name)); - } - $output .= ''; - - $output .= ' ' - . $this->_formatVariable($name, $value, $variable_doc_links) - . '' - . ''; if ($has_session_value) { - $output .= '' - . '' - . '(' . __('Session value') . ')' - . ' ' - . $this->_formatVariable( - $name, - $serverVarsSession[$name], - $variable_doc_links - ) . '' - . ''; + $formattedValue = $this->_formatVariable( + $name, $serverVarsSession[$name], $variable_doc_links + ); + $output .= Template::get('server/variables/session_variable_row') + ->render( + array( + 'rowClass' => $row_class, + 'value' => $formattedValue, + ) + ); } $odd_row = ! $odd_row; } - $output .= ''; return $output; } diff --git a/templates/server/variables/session_variable_row.phtml b/templates/server/variables/session_variable_row.phtml new file mode 100644 index 0000000000..4422995d25 --- /dev/null +++ b/templates/server/variables/session_variable_row.phtml @@ -0,0 +1,5 @@ + + + ( ) +   + \ No newline at end of file diff --git a/templates/server/variables/variable_row.phtml b/templates/server/variables/variable_row.phtml new file mode 100644 index 0000000000..eee788f96c --- /dev/null +++ b/templates/server/variables/variable_row.phtml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + '; + ?> + + + + + +   + \ No newline at end of file