One Hat Cyber Team
  • Dir : ~/usr/share/phpmyadmin/libraries/classes/Config/
  • Edit File: FormDisplayTemplate.php
    '; break; } if (isset($opts['comment']) && $opts['comment']) { $class = 'field-comment-mark'; if (isset($opts['comment_warning']) && $opts['comment_warning']) { $class .= ' field-comment-warning'; } $htmlOutput .= 'i'; } if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment'] ) { $htmlOutput .= '' . $icons['tblops'] . ''; } if (isset($opts['setvalue']) && $opts['setvalue']) { $htmlOutput .= '' . $icons['edit'] . ''; } if (isset($opts['show_restore_default']) && $opts['show_restore_default']) { $htmlOutput .= '' . $icons['reload'] . ''; } // this must match with displayErrors() in scripts/config.js if ($has_errors) { $htmlOutput .= "\n
    "; foreach ($opts['errors'] as $error) { $htmlOutput .= '
    ' . htmlspecialchars($error) . '
    '; } $htmlOutput .= '
    '; } $htmlOutput .= ''; if ($is_setup_script && isset($opts['userprefs_allow'])) { $htmlOutput .= ''; $htmlOutput .= 'get('is_setup') ? 3 : 2; return Template::get('config/form_display/group_header')->render([ 'group' => $_FormDisplayGroup, 'colspan' => $colspan, 'header_text' => $headerText, ]); } /** * Display group footer * * @return void */ public static function displayGroupFooter() { global $_FormDisplayGroup; $_FormDisplayGroup--; } /** * Displays bottom part of a fieldset * * @param bool $showButtons Whether show submit and reset button * * @return string */ public static function displayFieldsetBottom($showButtons = true) { return Template::get('config/form_display/fieldset_bottom')->render([ 'show_buttons' => $showButtons, 'is_setup' => $GLOBALS['PMA_Config']->get('is_setup'), ]); } /** * Closes form tabs * * @return string */ public static function displayTabsBottom() { return Template::get('config/form_display/tabs_bottom')->render(); } /** * Displays bottom part of the form * * @return string */ public static function displayFormBottom() { return Template::get('config/form_display/form_bottom')->render(); } /** * Appends JS validation code to $js_array * * @param string $field_id ID of field to validate * @param string|array $validators validators callback * @param array &$js_array will be updated with javascript code * * @return void */ public static function addJsValidate($field_id, $validators, array &$js_array) { foreach ((array)$validators as $validator) { $validator = (array)$validator; $v_name = array_shift($validator); $v_name = "PMA_" . $v_name; $v_args = array(); foreach ($validator as $arg) { $v_args[] = Sanitize::escapeJsString($arg); } $v_args = $v_args ? ", ['" . implode("', '", $v_args) . "']" : ''; $js_array[] = "validateField('$field_id', '$v_name', true$v_args)"; } } /** * Displays JavaScript code * * @param array $js_array lines of javascript code * * @return string */ public static function displayJavascript(array $js_array) { if (empty($js_array)) { return null; } return Template::get('javascript/display')->render( array('js_array' => $js_array,) ); } /** * Displays error list * * @param string $name Name of item with errors * @param array $errorList List of errors to show * * @return string HTML for errors */ public static function displayErrors($name, array $errorList) { return Template::get('config/form_display/errors')->render([ 'name' => $name, 'error_list' => $errorList, ]); } }