mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 22:25:04 +02:00
Tidying up form appearance
1) Changed required/advanced images to something language neutral (asterisks) 2) Moved them to pixpath so people can override them easily 3) Hide the images completely using CSS (keep them only for accessibility) so that all the labels have a consistent alignment. 4) Use CSS to color the labels instead.
This commit is contained in:
parent
3efc06683a
commit
49c7f3a850
BIN
lib/form/adv.gif
BIN
lib/form/adv.gif
Binary file not shown.
Before Width: | Height: | Size: 234 B |
BIN
lib/form/adv.png
BIN
lib/form/adv.png
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
BIN
lib/form/req.gif
BIN
lib/form/req.gif
Binary file not shown.
Before Width: | Height: | Size: 243 B |
BIN
lib/form/req.png
BIN
lib/form/req.png
Binary file not shown.
Before Width: | Height: | Size: 31 KiB |
@ -31,8 +31,8 @@ require_once 'HTML/QuickForm/Renderer/Tableless.php';
|
||||
|
||||
require_once $CFG->libdir.'/uploadlib.php';
|
||||
|
||||
define('FORM_ADVANCEDIMAGEURL', $CFG->wwwroot.'/lib/form/adv.gif');
|
||||
define('FORM_REQIMAGEURL', $CFG->wwwroot.'/lib/form/req.gif');
|
||||
define('FORM_ADVANCEDIMAGEURL', $CFG->pixpath.'/adv.gif');
|
||||
define('FORM_REQIMAGEURL', $CFG->pixpath.'/req.gif');
|
||||
|
||||
/**
|
||||
* Callback called when PEAR throws an error
|
||||
@ -1366,11 +1366,13 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
|
||||
|
||||
function MoodleQuickForm_Renderer(){
|
||||
// switch next two lines for ol li containers for form items.
|
||||
// $this->_elementTemplates=array('default'=>"\n\t\t<li class=\"fitem\"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class=\"qfelement<!-- BEGIN error --> error<!-- END error --> {type}\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></li>");
|
||||
// $this->_elementTemplates=array('default'=>"\n\t\t".'<li class="fitem"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class="qfelement<!-- BEGIN error --> error<!-- END error --> {type}"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></li>');
|
||||
$this->_elementTemplates = array(
|
||||
'default'=>"\n\t\t<div class=\"fitem {advanced}<!-- BEGIN required --> required<!-- END required -->\"><div class=\"fitemtitle\"><label>{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg}</label>{help}</div><div class=\"felement {type}<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div>",
|
||||
'fieldset'=>"\n\t\t<div class=\"fitem {advanced}<!-- BEGIN required --> required<!-- END required -->\"><div class=\"fitemtitle\"><div class=\"fgrouplabel\">{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg}</div>{help}</div><fieldset class=\"felement {type}<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</fieldset></div>",
|
||||
'static'=>"\n\t\t<div class=\"fitem {advanced}<!-- BEGIN required --> required<!-- END required -->\"><div class=\"fitemtitle\"><div class=\"fstaticlabel\">{label}<!-- BEGIN required -->{req}<!-- END required -->{advancedimg}</div>{help}</div><div class=\"felement {type}<!-- BEGIN error --> error<!-- END error -->\"><!-- BEGIN error --><span class=\"error\">{error}</span><br /><!-- END error -->{element}</div></div>");
|
||||
'default'=>"\n\t\t".'<div class="fitem {advanced}<!-- BEGIN required --> required<!-- END required -->"><div class="fitemtitle"><label>{label}<!-- BEGIN required -->{req} <!-- END required -->{advancedimg}</label>{help}</div><div class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></div>',
|
||||
|
||||
'fieldset'=>"\n\t\t".'<div class="fitem {advanced}<!-- BEGIN required --> required<!-- END required -->"><div class="fitemtitle"><div class="fgrouplabel">{label}<!-- BEGIN required -->{req} <!-- END required -->{advancedimg}</div>{help}</div><fieldset class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</fieldset></div>',
|
||||
|
||||
'static'=>"\n\t\t".'<div class="fitem {advanced}<!-- BEGIN required --> required<!-- END required -->"><div class="fitemtitle"><div class="fstaticlabel">{label}<!-- BEGIN required -->{req} <!-- END required -->{advancedimg}</div>{help}</div><div class="felement {type}<!-- BEGIN error --> error<!-- END error -->"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></div>');
|
||||
|
||||
parent::HTML_QuickForm_Renderer_Tableless();
|
||||
}
|
||||
@ -1583,4 +1585,4 @@ MoodleQuickForm::registerElementType('header', "$CFG->libdir/form/header.php", '
|
||||
MoodleQuickForm::registerElementType('submit', "$CFG->libdir/form/submit.php", 'MoodleQuickForm_submit');
|
||||
MoodleQuickForm::registerElementType('questioncategory', "$CFG->libdir/form/questioncategory.php", 'MoodleQuickForm_questioncategory');
|
||||
MoodleQuickForm::registerElementType('advcheckbox', "$CFG->libdir/form/advcheckbox.php", 'MoodleQuickForm_advcheckbox');
|
||||
?>
|
||||
?>
|
||||
|
BIN
pix/adv.gif
Executable file
BIN
pix/adv.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 118 B |
BIN
pix/req.gif
Normal file
BIN
pix/req.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 B |
@ -156,6 +156,13 @@ img.grouppicture {
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#notice .buttons .singlebutton {
|
||||
display:inline;
|
||||
}
|
||||
#notice .buttons form {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.errorbox {
|
||||
border-width:1px;
|
||||
border-style:solid;
|
||||
@ -439,6 +446,14 @@ form#adminsettings div.htmlarea {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
form.mform .required img {
|
||||
display:none;
|
||||
}
|
||||
|
||||
form.mform .required label {
|
||||
color:#a00;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** Header
|
||||
|
Loading…
x
Reference in New Issue
Block a user