';
return $htmlOutput;
}
/**
* 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 string
*/
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) . '"';
}
$htmlOutput = '
';
return $htmlOutput;
}
/**
* Displays simple bottom part of a fieldset (without submit buttons)
*
* @return string
*/
function PMA_displayFieldsetBottomSimple()
{
$htmlOutput = '';
$htmlOutput .= '';
return $htmlOutput;
}
/**
* Closes form tabs
*
* @return string
*/
function PMA_displayTabsBottom()
{
$htmlOutput = "
\n";
return $htmlOutput;
}
/**
* Displays bottom part of the form
*
* @return string
*/
function PMA_displayFormBottom()
{
$htmlOutput = "\n";
return $htmlOutput;
}
/**
* 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 string
*/
function PMA_displayJavascript($js_array)
{
if (empty($js_array)) {
return null;
}
include_once './libraries/Template.class.php';
return PMA\Template::get('javascript/display')->render(
array('js_array' => $js_array,)
);
}
/**
* Displays error list
*
* @param string $name name of item with errors
* @param array $error_list list of errors to show
*
* @return string HTML for errors
*/
function PMA_displayErrors($name, $error_list)
{
$htmlOutput = '