From: moodler Date: Sat, 13 Jan 2007 04:24:15 +0000 (+0000) Subject: Tidying up form appearance X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=49c7f3a850c50f773317be3c5fe42f05bc57c51f;p=moodle.git 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. --- diff --git a/lib/form/adv.gif b/lib/form/adv.gif deleted file mode 100644 index 8446c807c8..0000000000 Binary files a/lib/form/adv.gif and /dev/null differ diff --git a/lib/form/adv.png b/lib/form/adv.png deleted file mode 100644 index e0694e8452..0000000000 Binary files a/lib/form/adv.png and /dev/null differ diff --git a/lib/form/req.gif b/lib/form/req.gif deleted file mode 100644 index 42e5502cba..0000000000 Binary files a/lib/form/req.gif and /dev/null differ diff --git a/lib/form/req.png b/lib/form/req.png deleted file mode 100644 index 52f8135900..0000000000 Binary files a/lib/form/req.png and /dev/null differ diff --git a/lib/formslib.php b/lib/formslib.php index d159b08972..246f0333b6 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -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
  • error {type}\">{error}
    {element}
  • "); + // $this->_elementTemplates=array('default'=>"\n\t\t".'
  • {error}
    {element}
  • '); $this->_elementTemplates = array( - 'default'=>"\n\t\t
    required\">
    {help}
    error\">{error}
    {element}
    ", - 'fieldset'=>"\n\t\t
    required\">
    {label}{req}{advancedimg}
    {help}
    error\">{error}
    {element}
    ", - 'static'=>"\n\t\t
    required\">
    {label}{req}{advancedimg}
    {help}
    error\">{error}
    {element}
    "); + 'default'=>"\n\t\t".'
    {help}
    {error}
    {element}
    ', + + 'fieldset'=>"\n\t\t".'
    {label}{req} {advancedimg}
    {help}
    {error}
    {element}
    ', + + 'static'=>"\n\t\t".'
    {label}{req} {advancedimg}
    {help}
    {error}
    {element}
    '); 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'); -?> \ No newline at end of file +?> diff --git a/pix/adv.gif b/pix/adv.gif new file mode 100755 index 0000000000..73570d3400 Binary files /dev/null and b/pix/adv.gif differ diff --git a/pix/req.gif b/pix/req.gif new file mode 100644 index 0000000000..1deb8d25b0 Binary files /dev/null and b/pix/req.gif differ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 1561e37bc0..8b5f0bbf0a 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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