Tidying up form appearance
authormoodler <moodler>
Sat, 13 Jan 2007 04:24:15 +0000 (04:24 +0000)
committermoodler <moodler>
Sat, 13 Jan 2007 04:24:15 +0000 (04:24 +0000)
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.

lib/form/adv.gif [deleted file]
lib/form/adv.png [deleted file]
lib/form/req.gif [deleted file]
lib/form/req.png [deleted file]
lib/formslib.php
pix/adv.gif [new file with mode: 0755]
pix/req.gif [new file with mode: 0644]
theme/standard/styles_layout.css

diff --git a/lib/form/adv.gif b/lib/form/adv.gif
deleted file mode 100644 (file)
index 8446c80..0000000
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 (file)
index e0694e8..0000000
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 (file)
index 42e5502..0000000
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 (file)
index 52f8135..0000000
Binary files a/lib/form/req.png and /dev/null differ
index d159b08..246f033 100644 (file)
@@ -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');
-?>
\ No newline at end of file
+?>
diff --git a/pix/adv.gif b/pix/adv.gif
new file mode 100755 (executable)
index 0000000..73570d3
Binary files /dev/null and b/pix/adv.gif differ
diff --git a/pix/req.gif b/pix/req.gif
new file mode 100644 (file)
index 0000000..1deb8d2
Binary files /dev/null and b/pix/req.gif differ
index 1561e37..8b5f0bb 100644 (file)
@@ -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