]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7957 Add proper form labels to elements in search and settings tabs
authorskodak <skodak>
Mon, 18 Dec 2006 17:10:35 +0000 (17:10 +0000)
committerskodak <skodak>
Mon, 18 Dec 2006 17:10:35 +0000 (17:10 +0000)
message/lib.php
message/messages.php
message/search.html
message/settings.html

index 91082316ec54a776d236761b50477e82694dd171..c6cfa2041cdf4c6b9651706464fca8853bbd1aa4 100644 (file)
@@ -344,7 +344,7 @@ function message_print_search_results($frm) {
     /// search for person
     if (!empty($frm->personsubmit) and !empty($frm->name)) {
     
-        if ($frm->mycourses) {
+        if (optional_param('mycourses', 0, PARAM_BOOL)) {
             $users = array();
             $mycourses = get_my_courses($USER->id);
             foreach ($mycourses as $mycourse) {
@@ -451,7 +451,7 @@ function message_print_search_results($frm) {
             foreach ($messages as $message) {
 
             /// ignore messages to and from blocked users unless $frm->includeblocked is set
-                if ((!$frm->includeblocked) and (
+                if (!optional_param('includeblocked', 0, PARAM_BOOL) and (
                       ( isset($contacts[$message->useridfrom]) and ($contacts[$message->useridfrom]->blocked == 1)) or
                       ( isset($contacts[$message->useridto]  ) and ($contacts[$message->useridto]->blocked   == 1))
                                                 )
index aa4ecdea1ab32cf3fc849bddb2a01ab2f9675015..9c824e86666c68d70adc66dcb14e21e9095cd6ad 100644 (file)
@@ -11,8 +11,8 @@
 /// Output the header
     @header('Content-Type: text/html; charset=utf-8');
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html <?php echo $direction ?>>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" <?php echo $direction ?>>
   <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   </head>
index a6b3d798fc5a12edaf6078bd39902393d62d08eb..e0a3118d53219040a798259fa84c41f5623f016a 100644 (file)
@@ -6,45 +6,43 @@
 
 
     <tr>
-        <td colspan="3" class="message_heading"><?php print_string('searchforperson', 'message') ?></td>
+        <td colspan="3" class="message_heading"><?php print_heading(get_string('searchforperson', 'message')) ?></td>
     </tr>
     <tr>
-        <td align="right"><?php print_string('name') ?>:</td>
-        <td><input type="text" name="name" size="16" alt="<?php print_string('name')?>" /></td>
+        <td align="right"><label for="name"><?php print_string('name') ?></label></td>
+        <td><input type="text" name="name" size="16" id="name" /></td>
         <td><input type="submit" name="personsubmit" value="<?php print_string('search') ?>" /></td>
     </tr>
     <tr>
         <td>&nbsp;</td>
         <td colspan="2">
-            <input type="hidden" name="mycourses" value="0" />
-            <input type="checkbox" name="mycourses" alt="<?php print_string('onlymycourses', 'message') ?>" /><?php print_string('onlymycourses', 'message') ?></td>
+            <input type="checkbox" name="mycourses" id="mycourses" /><label for="mycourses"><?php print_string('onlymycourses', 'message') ?></label></td>
     </tr>
     
-    <tr><td colspan="3"><hr /></td></tr>
+    <tr><td colspan="3"></td></tr>
 
 
     <tr>
-        <td colspan="3" class="message_heading"><?php print_string('searchmessages', 'message') ?></td>
+        <td colspan="3" class="message_heading"><?php print_heading(get_string('searchmessages', 'message')) ?></td>
     </tr>
     <tr>
-        <td align="right"><?php print_string('keywords', 'message') ?>:</td>
-        <td><input type="text" name="keywords" size="16" alt="<?php print_string('keywords', 'message')?>" /></td>
+        <td align="right"><label for="keywords"><?php print_string('keywords', 'message') ?></label></td>
+        <td><input type="text" name="keywords" id="keywords" size="16" /></td>
         <td><input type="submit" name="keywordssubmit" value="<?php print_string('search') ?>" /></td>
     </tr>
     
     <tr>
         <td>&nbsp;</td>
         <td colspan="2">
-            <input type="hidden" name="includeblocked" value="0" />
-            <input type="checkbox" name="includeblocked" alt="<?php print_string('includeblockedusers', 'message') ?>" /><?php print_string('includeblockedusers', 'message') ?></td>
+            <input type="checkbox" name="includeblocked" id="includeblocked" /><label for="includeblocked"><?php print_string('includeblockedusers', 'message') ?></label></td>
     </tr>
     
-    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlytome', 'message') ?>" value="tome" /><?php print_string('onlytome', 'message') ?></td></tr>
-    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('onlyfromme', 'message') ?>" value="fromme" /><?php print_string('onlyfromme', 'message') ?></td></tr>
-    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" alt="<?php print_string('allmine', 'message') ?>" value="allmine" /><?php print_string('allmine', 'message') ?></td></tr>
+    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption1" value="tome" /><label for="keywordsoption1"><?php print_string('onlytome', 'message') ?></label></td></tr>
+    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption2" value="fromme" /><label for="keywordsoption2"><?php print_string('onlyfromme', 'message') ?></label></td></tr>
+    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" id="keywordsoption3" value="allmine" /><label for="keywordsoption3"><?php print_string('allmine', 'message') ?></label></td></tr>
     
     <?php if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM, SITEID))) { ?>
-    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" alt="<?php print_string('allusers', 'message') ?>" value="allusers" /><?php print_string('allusers', 'message') ?></td></tr>
+    <tr><td>&nbsp;</td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption4" value="allusers" /><label for="keywordsoption4"><?php print_string('allusers', 'message') ?></label></td></tr>
     <?php } ?>
 
 <?php
index 90fe94b9ef69d787c0d39949cb62208a2ab61134..fa92084363279f78720bdc16763812674ec961f0 100644 (file)
@@ -5,41 +5,41 @@
 <table cellpadding="5" align="center" class="message_form">
 
     <tr valign="top">
-        <td align="right"><input type="checkbox" name="showmessagewindow" alt="<?php print_string('showmessagewindow', 'message') ?>" <?php echo $cbshowmessagewindow ?> /></td>
-        <td colspan="2"><?php print_string('showmessagewindow', 'message') ?></td>
+        <td align="right"><input type="checkbox" name="showmessagewindow" id="showmessagewindow" <?php echo $cbshowmessagewindow ?> /></td>
+        <td colspan="2"><label for="showmessagewindow"><?php print_string('showmessagewindow', 'message') ?></label></td>
     </tr>
     <tr valign="top">
-        <td align="right"><input type="checkbox" name="blocknoncontacts" alt="<?php print_string('blocknoncontacts', 'message') ?>" <?php echo $cbblocknoncontacts ?>  /></td>
-        <td colspan="2"><?php print_string('blocknoncontacts', 'message') ?></td>
+        <td align="right"><input type="checkbox" name="blocknoncontacts" id="blocknoncontacts" <?php echo $cbblocknoncontacts ?>  /></td>
+        <td colspan="2"><label for="blocknoncontacts"><?php print_string('blocknoncontacts', 'message') ?></label></td>
     </tr>
     <tr valign="top">
-        <td align="right"><input type="checkbox" name="beepnewmessage" alt="<?php print_string('beepnewmessage', 'message') ?>" <?php echo $cbbeepnewmessage ?>  /></td>
-        <td colspan="2"><?php print_string('beepnewmessage', 'message') ?></td>
+        <td align="right"><input type="checkbox" name="beepnewmessage" id="beepnewmessage" <?php echo $cbbeepnewmessage ?>  /></td>
+        <td colspan="2"><label for="beepnewmessage"><?php print_string('beepnewmessage', 'message') ?></label></td>
     </tr>
     <tr valign="top">
-        <td align="right"><input type="checkbox" name="usehtmleditor" alt="<?php print_string('htmleditor') ?>" <?php echo $cbusehtmleditor ?>  /></td>
-        <td colspan="2"><?php print_string('htmleditor') ?></td>
+        <td align="right"><input type="checkbox" name="usehtmleditor" id="usehtmleditor" <?php echo $cbusehtmleditor ?>  /></td>
+        <td colspan="2"><label for="usehtmleditor"><?php print_string('htmleditor') ?></label></td>
     </tr>
 
     
     <tr valign="top">
-        <td><input type="checkbox" name="emailmessages" alt="<?php print_string('emailmessages', 'message') ?>" <?php echo $cbemailmessages ?>  /></td>
-        <td colspan="2"><?php print_string('emailmessages', 'message') ?></td>
+        <td><input type="checkbox" name="emailmessages" id="emailmessages" <?php echo $cbemailmessages ?>  /></td>
+        <td colspan="2"><label for="emailmessages"><?php print_string('emailmessages', 'message') ?></label></td>
     </tr>
     <tr valign="top">
         <td>&nbsp;</td>
-        <td align="right"><?php print_string('formorethan', 'message') ?>:</td>
-        <td><input type="text" name="emailtimenosee" size="2" value="<?php echo $txemailtimenosee ?>" alt="<?php print_string('timenosee', 'message') ?>" /> <?php print_string('mins') ?></td>
+        <td align="right"><label for="emailtimenosee"><?php print_string('formorethan', 'message') ?></label></td>
+        <td><input type="text" name="emailtimenosee" id="emailtimenosee" size="2" value="<?php p($txemailtimenosee) ?>" /> <?php print_string('mins') ?></td>
     </tr>
 
     <tr valign="top">
         <td>&nbsp;</td>
-        <td align="right"><?php print_string('email') ?>:</td>
-        <td><input type="text" name="emailaddress" size="20" value="<?php echo $txemailaddress ?>" alt="<?php print_string('email') ?>" /></td>
+        <td align="right"><label for="emailaddress"><?php print_string('email') ?></label></td>
+        <td><input type="text" name="emailaddress" id="emailaddress" size="20" value="<?php p($txemailaddress) ?>" /></td>
     </tr>
     <tr valign="top">
         <td>&nbsp;</td>
-        <td align="right"><?php print_string('format') ?>:</td>
+        <td align="right"><label for="menuemailformat"><?php print_string('format') ?></label></td>
         <td><?php echo $format_select ?>
         </td>
     </tr>