'; echo ''; // we do validation on page refresh when browser remembers field values, // add a field with known value which will be used for checks if (! $has_check_page_refresh) { $has_check_page_refresh = true; echo '' . "\n"; } echo PMA_URL_getHiddenInputs('', '', 0, 'server') . "\n"; echo PMA_getHiddenFields((array)$hidden_fields); } /** * Displays form tabs which are given by an array indexed by fieldset id * ({@link PMA_displayFieldsetTop}), with values being tab titles. * * @param array $tabs tab names * * @return void */ function PMA_displayTabsTop($tabs) { echo ''; echo '
'; echo '
'; } /** * Displays top part of a fieldset * * @param string $title title of fieldset * @param string $description description shown on top of fieldset * @param array $errors error messages to display * @param array $attributes optional extra attributes of fieldset * * @return void */ function PMA_displayFieldsetTop($title = '', $description = '', $errors = null, $attributes = array() ) { global $_FormDisplayGroup; $_FormDisplayGroup = 0; $attributes = array_merge(array('class' => 'optbox'), $attributes); foreach ($attributes as $k => &$attr) { $attr = $k . '="' . htmlspecialchars($attr) . '"'; } echo '
'; echo '' . $title . ''; if (!empty($description)) { echo '

' . $description . '

'; } // this must match with displayErrors() in scripts.js if (is_array($errors) && count($errors) > 0) { echo '
'; foreach ($errors as $error) { echo '
' . $error . '
'; } echo '
'; } echo ''; } /** * Displays input field * * $opts keys: * o doc - (string) documentation link * o errors - error array * o setvalue - (string) shows button allowing to set poredefined value * o show_restore_default - (boolean) whether show "restore default" button * o userprefs_allow - whether user preferences are enabled for this field * (null - no support, true/false - enabled/disabled) * o userprefs_comment - (string) field comment * o values - key - value paris for '; echo ''; if ($is_setup_script && isset($opts['userprefs_allow'])) { echo ''; } else if ($is_setup_script) { echo ''; } echo ''; } /** * Display group header * * @param string $header_text Text of header * * @return void */ function PMA_displayGroupHeader($header_text) { global $_FormDisplayGroup; $_FormDisplayGroup++; if (! $header_text) { return; } $colspan = defined('PMA_SETUP') ? 3 : 2; echo ''; echo ''; echo ''; } /** * Display group footer * * @return void */ function PMA_displayGroupFooter() { global $_FormDisplayGroup; $_FormDisplayGroup--; } /** * Displays bottom part of a fieldset * * @return void */ function PMA_displayFieldsetBottom() { $colspan = 2; if (defined('PMA_SETUP')) { $colspan++; } echo ''; echo ''; echo ''; echo '
'; echo ''; if (! empty($opts['doc'])) { echo ''; echo '' . $icons['help'] . ''; echo "\n"; echo ''; } if ($option_is_disabled) { echo '' . __('Disabled') . ""; } if (!empty($description)) { echo '' . $description . ''; } echo ''; switch ($type) { case 'text': echo ''; break; case 'password': echo ''; break; case 'short_text': echo ''; break; case 'number_text': echo ''; break; case 'checkbox': echo ''; break; case 'select': echo ''; break; case 'list': echo ''; break; } if (isset($opts['comment']) && $opts['comment']) { $class = 'field-comment-mark'; if (isset($opts['comment_warning']) && $opts['comment_warning']) { $class .= ' field-comment-warning'; } echo 'i'; } if ($is_setup_script && isset($opts['userprefs_comment']) && $opts['userprefs_comment'] ) { echo '' . $icons['tblops'] . ''; } if (isset($opts['setvalue']) && $opts['setvalue']) { echo ''; } if (isset($opts['show_restore_default']) && $opts['show_restore_default']) { echo ''; } // this must match with displayErrors() in scripts/config.js if ($has_errors) { echo "\n
"; foreach ($opts['errors'] as $error) { echo '
' . htmlspecialchars($error) . '
'; } echo '
'; } echo '
'; echo ''; echo ' 
'; echo $header_text; echo '
'; echo ''; echo ''; echo '
'; echo '
'; } /** * Displays simple bottom part of a fieldset (without submit buttons) * * @return void */ function PMA_displayFieldsetBottomSimple() { echo ''; echo ''; } /** * Closes form tabs * * @return void */ function PMA_displayTabsBottom() { echo "
\n"; } /** * Displays bottom part of the form * * @return void */ function PMA_displayFormBottom() { echo "\n"; } /** * 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 */ function PMA_addJsValidate($field_id, $validators, &$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[] = PMA_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 void */ function PMA_displayJavascript($js_array) { if (empty($js_array)) { return; } echo '' . "\n"; } /** * Displays error list * * @param string $name name of item with errors * @param array $error_list list of errors to show * * @return void */ function PMA_displayErrors($name, $error_list) { echo '
'; echo '
' . htmlspecialchars($name) . '
'; foreach ($error_list as $error) { echo '
' . htmlspecialchars($error) . '
'; } echo '
'; } ?>