mirror of
https://github.com/moodle/moodle.git
synced 2025-07-22 14:51:45 +02:00
MDL-44907 admin: Better styling of admin settings validation errors
This commit is contained in:
@@ -6966,21 +6966,22 @@ function format_admin_setting($setting, $title='', $form='', $description='', $l
|
||||
}
|
||||
|
||||
|
||||
$adminroot = admin_get_root();
|
||||
$error = '';
|
||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||
$error = '<div><span class="error">' . $adminroot->errors[$fullname]->error . '</span></div>';
|
||||
}
|
||||
|
||||
$str = '
|
||||
<div class="form-item clearfix" id="admin-'.$setting->name.'">
|
||||
<div class="form-label">
|
||||
<label '.$labelfor.'>'.highlightfast($query, $title).$override.$warning.'</label>
|
||||
<span class="form-shortname">'.highlightfast($query, $name).'</span>
|
||||
</div>
|
||||
<div class="form-setting">'.$form.$defaultinfo.'</div>
|
||||
<div class="form-setting">'.$error.$form.$defaultinfo.'</div>
|
||||
<div class="form-description">'.highlight($query, markdown_to_html($description)).'</div>
|
||||
</div>';
|
||||
|
||||
$adminroot = admin_get_root();
|
||||
if (array_key_exists($fullname, $adminroot->errors)) {
|
||||
$str = '<fieldset class="error"><legend>'.$adminroot->errors[$fullname]->error.'</legend>'.$str.'</fieldset>';
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user