]> git.mjollnir.org Git - moodle.git/commitdiff
xhtml validation fixes for MDL-8425
authortoyomoyo <toyomoyo>
Tue, 6 Feb 2007 08:24:37 +0000 (08:24 +0000)
committertoyomoyo <toyomoyo>
Tue, 6 Feb 2007 08:24:37 +0000 (08:24 +0000)
17 files changed:
admin/environment.php
admin/maintenance.php
admin/roles/assign.html
admin/roles/assign.php
backup/backup_check.html
backup/backup_form.html
blog/blogpage.php
blog/header.php
blog/lib.php
course/category.php
course/info.php
course/report/outline/index.php
course/user.php
lib/adminlib.php
lib/weblib.php
mod/chat/view.php
theme/standard/styles_layout.css

index 9e78d283dd7d123d7043da3e14bc144d1495d5ea..4d2670367a38cdcb3c94e9574c49dfbcecf6b1e7 100644 (file)
@@ -91,7 +91,7 @@
 /// Start of main box
     print_simple_box_start('center');
 
-    echo "<center>".$stradminhelpenvironment."</center><br />";
+    echo "<div style=\"text-align:center\">".$stradminhelpenvironment."</div><br />";
 
 /// Get current Moodle version
     $current_version = $CFG->release;
     }
 
 /// Print form and popup menu
-    echo '<div align="center">'.$strmoodleversion.' ';
+    echo '<div style="text-align:center">'.$strmoodleversion.' ';
     popup_form("$CFG->wwwroot/$CFG->admin/environment.php?version=",
         $versions, 'selectversion', $version, '');
     echo '</div>';
index 0eea6da7cf0fb207839977b426173860246691df..d7e20ce2dca85f07902f1f9fab9473fd20b4bc8f 100644 (file)
 /// Print the appropriate form
 
     if (file_exists($filename)) {   // We are in maintenance mode
-        echo '<center>';
+        echo '<div style="margin-left:auto;margin-right:auto">';
         echo '<form action="maintenance.php" method="post">';
         echo '<input type="hidden" name="action" value="disable" />';
         echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
         echo '<p><input type="submit" value="'.get_string('disable').'" /></p>';
         echo '</form>';
-        echo '</center>';
+        echo '</div>';
     } else {                        // We are not in maintenance mode
         $usehtmleditor = can_use_html_editor();
 
-        echo '<center>';
+        echo '<div style="text-align:center;margin-left:auto;margin-right:auto">';
         echo '<form action="maintenance.php" method="post">';
+        echo '<div>';
         echo '<input type="hidden" name="action" value="enable" />';
         echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
         echo '<p><input type="submit" value="'.get_string('enable').'" /></p>';
@@ -56,8 +57,9 @@
         echo '<table><tr><td>';
         print_textarea($usehtmleditor, 20, 50, 600, 400, "text");
         echo '</td></tr></table>';
+        echo '</div>';
         echo '</form>';
-        echo '</center>';
+        echo '</div>';
 
         if ($usehtmleditor) { 
             use_html_editor();
index d08f6ce2df04d21ac17e2b89d3452b1fef6fe230..3e1b47387f686ccf9492dd822bdcba3b38dc082d 100755 (executable)
@@ -1,11 +1,12 @@
 <form id="assignform" method="post" action="">
+<div>
 <input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
 <input type="hidden" name="userid" value="<?php p($userid) ?>" />
 <input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
 <input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
 <input type="hidden" name="contextid" value="<?php p($contextid) ?>" />
 <input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
-  <table summary="" align="center" border="0" cellpadding="5" cellspacing="0">
+  <table summary="" style="margin-left:auto;margin-right:auto" border="0" cellpadding="5" cellspacing="0">
     <tr>
       <td valign="top">
           <label for="removeselect"><?php print_string('existingusers', 'role', count($contextusers)); ?></label>
@@ -14,6 +15,7 @@
                   onfocus="getElementById('assignform').add.disabled=true;
                            getElementById('assignform').remove.disabled=false;
                            getElementById('assignform').addselect.selectedIndex=-1;">
+          
           <?php
               foreach ($contextusers as $contextuser) {
                   $fullname = fullname($contextuser, true);
@@ -25,7 +27,7 @@
                   echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email.$hidden."</option>\n";
               }
           ?>
-
+          <option/>
           </select></td>
       <td valign="top">
         <br />
@@ -95,6 +97,7 @@
        </td>
     </tr>
   </table>
+</div>
 </form>
 
 
index 4d2c103c757bb7e74a58c6adbc76ea29d9defcd8..6fb36db2e73a5d07dcdbe82453e019908eda8b9f 100755 (executable)
 
         /// In the .html file below we loop through these results and exclude any in $contextusers
 
-        echo '<div align="center">'.$strcurrentcontext.': '.print_context_name($context).'<br/>';
-        echo '<label for="jump">'.$strroletoassign.'</label>: ';
+        echo '<div style="text-align:center">'.$strcurrentcontext.': '.print_context_name($context).'<br/>';
+        echo '<label>'.$strroletoassign.'</label>: ';
         $assignableroles = array('0'=>get_string('listallroles', 'role').'...') + $assignableroles; 
         popup_form("$CFG->wwwroot/$CFG->admin/roles/assign.php?userid=$userid&amp;courseid=$courseid&amp;contextid=$contextid&amp;roleid=",
             $assignableroles, 'switchrole', $roleid, '');
index 225ff656eb73739a72e60f9d2b3285decebde390..c77496f66c61a1dbb870d1293f215075e425fe1f 100644 (file)
@@ -36,7 +36,7 @@
 ?>
 
 <form id="form" method="post" action="backup.php">
-<table cellpadding="5">
+<table cellpadding="5" style="text-align:center;margin-left:auto;margin-right:auto">
 <?php
 
     if (empty($to)) {
 
 ?>
 </table>
-<br />
-<center>
+<div style="text-align:center;margin-left:auto;margin-right:auto">
 <input type="hidden" name="to"     value="<?php p($to) ?>" />
 <input type="hidden" name="id"     value="<?php  p($id) ?>" />
 <input type="hidden" name="launch" value="execute" />
 <input type="submit" value="<?php  print_string("continue") ?>" />
 <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
-</center>
+</div>
 </form>
index 354c524c56b21a1b382479d2e25303b043c2732c..6a57c4ed6a58086eb998ad63d96bb0d920bb583a 100644 (file)
@@ -112,9 +112,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 }
 -->
 </script>
-
 <form id="form1" method="post" action="backup.php">
-<table cellpadding="5">
+<table cellpadding="5" style="margin-left:auto;margin-right:auto;">
 <?php
     //Now, check modules and info and show posibilities
     if ($allmods = get_records("modules") ) {
@@ -319,8 +318,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
     //the temp-directory name and records in backup temp tables
 ?>
 </table>
-<br />
-<center>
+
+<div style="text-align:center;margin-left:auto;margin-right:auto">
 <input type="hidden" name="id"     value="<?php  p($id) ?>" />
 <input type="hidden" name="to"     value="<?php p($to) ?>" />
 <input type="hidden" name="backup_unique_code" value="<?php p($backup_unique_code); ?>" />
@@ -328,5 +327,5 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 <input type="hidden" name="launch" value="check" />
 <input type="submit" value="<?php  print_string("continue") ?>" />
 <input type="submit" name="cancel" value="<?php  print_string("cancel") ?>" />
-</center>
-</form>
+</div>
+</form>
\ No newline at end of file
index c760e56ad8c5d3524423787eae37f99955d623e9..7caf1ef5ce6eaf43331bc9754c504f7ec417d183 100644 (file)
@@ -186,8 +186,8 @@ class page_blog extends page_base {
                 $paramstring .= '<input type="hidden" name="'.$key.'" value="'.s($val).'" />';
             }
 
-            $editformstring = '<form '.$CFG->frametarget.' method="get" action="'.$this->url_get_path().'">'
-                             .$paramstring.'<input type="submit" value="'.$editingString.'" /></form>';
+            $editformstring = '<form '.$CFG->frametarget.' method="get" action="'.$this->url_get_path().'"><fieldset class="invisiblefieldset">'
+                             .$paramstring.'<input type="submit" value="'.$editingString.'" /></fieldset></form>';
         }
 
         return $editformstring;
index 4a7dde7d69f5a46d92de48e1b83b117793b8cafa..71e4402c8bc26aea964dd812e1e9a40fd414c878 100755 (executable)
@@ -228,8 +228,8 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
 
 /// Start main column
 print '<!-- Begin page content -->' . "\n";
-print '<td width="*">';
+print '<td>';
 ?>
 <table width="100%">
 <tr>
-<td height="100%" valign="top">
+<td valign="top">
index 4473a82057f6786e35b3c53708184c9cfb7a3975..f524f08a512427fa50e7363787fc507060ebf78c 100755 (executable)
@@ -92,7 +92,7 @@
 
         if (has_capability('moodle/blog:create', $sitecontext)) {
             //the user's blog is enabled and they are viewing their own blog
-            $addlink = '<div align="center">';
+            $addlink = '<div class="addbloglink">';
             $addlink .= '<a href="'.$CFG->wwwroot .'/blog/edit.php?action=add'.'">'. get_string('addnewentry', 'blog').'</a>';
             $addlink .= '</div>';
             echo $addlink;
         global $USER, $CFG, $COURSE, $ME;
 
         $template['body'] = format_text($blogEntry->summary, $blogEntry->format);
-        $template['title'] = '<a name="'. $blogEntry->subject .'"></a>';
+        //$template['title'] = '<a name="'. $blogEntry->subject .'"></a>';
         //enclose the title in nolink tags so that moodle formatting doesn't autolink the text
-        $template['title'] .= '<span class="nolink">'.$blogEntry->subject.'</span>';
+        $template['title'] = '<span class="nolink">'.$blogEntry->subject.'</span>';
         $template['userid'] = $blogEntry->userid;
         $template['author'] = fullname(get_record('user','id',$blogEntry->userid));
         $template['lastmod'] = userdate($blogEntry->lastmodified);
index 751063662d2cd5b9434cc7f59e86b6428ab04e01..84cdd09634dff41550126e8200349daff23882b3 100644 (file)
                 if ($firstentry) {
                     echo '<table align="center" border="0" cellspacing="2" cellpadding="4" class="generalbox">';
                     echo '<tr><th scope="col">'.get_string('subcategories').'</th></tr>';
-                    echo '<tr><td nowrap="nowrap">';
+                    echo '<tr><td style="white-space: nowrap">';
                     $firstentry = false;
                 }
                 $catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" ";
index f0b02f4aa99f195d0d8288cc33d40517b03bc49d..11afb81166b0cf0c6abb2a0db857dbf56e2cd190 100644 (file)
@@ -44,7 +44,7 @@
 
 
     if ($teachers = get_course_teachers($course->id)) {
-        echo "<table align=\"center\"><tr><td nowrap=\"nowrap\">";
+        echo "<table align=\"center\"><tr><td style=\"white-space: nowrap\">";
         echo "<p><font size=\"1\">\n";
         foreach ($teachers as $teacher) {
             if ($teacher->authority > 0) {
index 40f883c9dc7e202b9fec55ca39eeb48654c6f413..01752e338516ed50a2e5d61cfcca8b3aea5f1938 100644 (file)
@@ -114,7 +114,7 @@ function print_outline_row($mod, $instance, $result) {
     echo "<td>&nbsp;&nbsp;&nbsp;</td>";
     if (isset($result->time)) {
         $timeago = format_time(time() - $result->time);
-        echo "<td valign=\"top\" nowrap=\"nowrap\">".userdate($result->time)." ($timeago)</td>";
+        echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time)." ($timeago)</td>";
     }
     echo "</tr>";
 }
index 394d4194fba97d3f838d99cb34f26b589ddedcf3..1c084ef66cf90bbfc1d4fe374e5eae07280f89ba 100644 (file)
@@ -265,7 +265,7 @@ function print_outline_row($mod, $instance, $result) {
 
     echo "<tr>";
     echo "<td valign=\"top\">$image</td>";
-    echo "<td valign=\"top\" width=\"300\">";
+    echo "<td valign=\"top\" style=\"width:300\">";
     echo "   <a title=\"$mod->modfullname\"";
     echo "   href=\"../mod/$mod->modname/view.php?id=$mod->id\">".format_string($instance->name,true)."</a></td>";
     echo "<td>&nbsp;&nbsp;&nbsp;</td>";
@@ -273,13 +273,13 @@ function print_outline_row($mod, $instance, $result) {
     if (isset($result->info)) {
         echo "$result->info";
     } else {
-        echo "<p align=\"center\">-</p>";
+        echo "<p style=\"text-align:center\">-</p>";
     }
     echo "</td>";
     echo "<td>&nbsp;&nbsp;&nbsp;</td>";
     if (!empty($result->time)) {
         $timeago = format_time(time() - $result->time);
-        echo "<td valign=\"top\" nowrap=\"nowrap\">".userdate($result->time)." ($timeago)</td>";
+        echo "<td valign=\"top\" style=\"white-space: nowrap\">".userdate($result->time)." ($timeago)</td>";
     }
     echo "</tr>";
 }
index c648a2bd851ca94be535282ddf3bec58c4a4584d..92a91ae817c90561b2d86f241e002bfafab04e3f 100644 (file)
@@ -1546,7 +1546,7 @@ class admin_setting_configtime extends admin_setting {
             $return .= '<option value="' . $key . '"' . ($key == $currentsetting['m'] ? ' selected="selected"' : '') . '>' . $value . '</option>';
         }
         $return .= '</select></div>';
-        return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+        return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
     }
 
 }
@@ -1712,7 +1712,7 @@ class admin_setting_courselist_frontpage extends admin_setting_configselect {
         }
         $return .= '</div>';
 
-        return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+        return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
     }
 }
 
@@ -1808,7 +1808,7 @@ class admin_setting_special_frontpagedesc extends admin_setting {
 
         $return = print_textarea($CFG->adminusehtmleditor, 15, 60, 0, 0, 's_' . $this->name, $currentsetting, 0, true);
 
-        return format_admin_setting($this->name, $this->visiblename, $return, $this->description);
+        return format_admin_setting($this->name, $this->visiblename, $return, $this->description, false);
     }
 
     function get_setting() {
@@ -2760,16 +2760,26 @@ function apply_default_exception_settings($defaults) {
 
 }
 
-function format_admin_setting($name, $title='', $form='', $description='') {
-    return "\n".
+function format_admin_setting($name, $title='', $form='', $description='', $label=true) {
+    
+    // sometimes the id is not id_s_name, but id_s_name_m or something, and this does not validate
+    if ($label) {
+        $labelfor = 'for = "id_s_'.$name.'"'; 
+    } else {
+        $labelfor = '';  
+    }
+    
+    $str = "\n".
            '<div class="form-item" id="admin-'.$name.'">'."\n".
-           '<label for="id_s_'.$name.'">'.$title."\n".
+           '<label '.$labelfor.'>'.$title."\n".
            '   <span class="form-shortname">'.$name.'</span>'."\n".
            '</label>'."\n".
            $form."\n".
            '<div class="description">'.$description.'</div>'."\n".
            '</div>'.
            "\n\n";
+  
+    return $str;
 }
 
 /* 
index 0b9f88b0fa54a0f31b80899db0c9718fef2cbb5f..927939593c7720564c7146ba409d0ae183819521 100644 (file)
@@ -809,7 +809,7 @@ function print_checkbox ($name, $value, $checked = true, $label = '', $alt = '',
 
     $htmlid = 'auto-cb'.sprintf('%04d', ++$idcounter);
     $output  = '<span class="checkbox '.$name."\">";
-    $output .= '<input name="'.$name.'" id="'.$htmlid.'" type="checkbox" value="'.$value.'" alt="'.$alt.'"'.$strchecked.' '.((!empty($script)) ? ' onClick="'.$script.'" ' : '').' />';
+    $output .= '<input name="'.$name.'" id="'.$htmlid.'" type="checkbox" value="'.$value.'" alt="'.$alt.'"'.$strchecked.' '.((!empty($script)) ? ' onclick="'.$script.'" ' : '').' />';
     if(!empty($label)) {
         $output .= ' <label for="'.$htmlid.'">'.$label.'</label>';
     }
@@ -4872,10 +4872,10 @@ function redirect($url, $message='', $delay=-1) {
         print_header('', '', '', '', '<meta http-equiv="refresh" content="'. $delay .'; url='. $encodedurl .'" />');
         $delay += 3; // double redirect prevention, it was sometimes breaking upgrades before 1.7
     }
-    echo '<center>';
+    echo '<div style="text-align:center">';
     echo '<p>'. $message .'</p>';
     echo '<p>( <a href="'. $encodedurl .'">'. get_string('continue') .'</a> )</p>';
-    echo '</center>';
+    echo '</div>';
 // it might be better not to set timeout the same for both types of redirect, so that we can be sure which one wins
 ?>
 <script type="text/javascript">
index 9935189cafda5853a5ec4ddf200dac9fa8f9e283..35e103e6f7200e70d5f48e95551cd10efe299487 100644 (file)
 
 
     if ($chat->chattime and $chat->schedule) {  // A chat is scheduled
-        echo "<p align=\"center\">$strnextsession: ".userdate($chat->chattime).' ('.usertimezone($USER->timezone).')</p>';
+        echo "<p class=\"nextchatsession\">$strnextsession: ".userdate($chat->chattime).' ('.usertimezone($USER->timezone).')</p>';
     } else {
         echo '<br />';
     }
             echo '<tr><td width="35">';
             echo "<a href=\"$CFG->wwwroot/user/view.php?id=$chatuser->id&amp;course=$chat->course\">";
             print_user_picture($chatuser->id, 0, $chatuser->picture, false, false, false);
-            echo '</a></td><td valign="center">';
+            echo '</a></td><td style="vertical-align: middle">';
             echo '<p><font size="1">';
             echo fullname($chatuser).'<br />';
             echo "<font color=\"#888888\">$stridle: ".format_time($lastping)."</font>";
index 3d39a63828fac1fbe9717086beb1c15da59f0294..7ebad34710b442d486b7ecd470cd47757e841ee7 100644 (file)
@@ -1061,6 +1061,9 @@ a.skip-block, .skip-block {
 /***
  *** Blogs
  ***/
+.addbloglink {
+  text-align: center;  
+}
 
 .blogpost .audience {
   text-align: right;
@@ -2333,6 +2336,10 @@ body#user-index .rolesform {
  *** Modules: Chat
  ***/
 
+.nextchatsession {
+  text-align:center;  
+}
+
 #mod-chat-gui_header_js-jsupdate {
   margin:10px
 }
@@ -2990,6 +2997,10 @@ body#question-preview .quemodname, body#question-preview .controls {
   width:50%;
   vertical-align:top;
 }
+
+.whitecell {
+  background-color:white;  
+}
 /***
  *** Modules: Wiki
  ***/