From: toyomoyo Date: Tue, 6 Feb 2007 08:24:37 +0000 (+0000) Subject: xhtml validation fixes for MDL-8425 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fbe31d22d1c95c889fbf11554d210b5ad06549f6;p=moodle.git xhtml validation fixes for MDL-8425 --- diff --git a/admin/environment.php b/admin/environment.php index 9e78d283dd..4d2670367a 100644 --- a/admin/environment.php +++ b/admin/environment.php @@ -91,7 +91,7 @@ /// Start of main box print_simple_box_start('center'); - echo "
".$stradminhelpenvironment."

"; + echo "
".$stradminhelpenvironment."

"; /// Get current Moodle version $current_version = $CFG->release; @@ -121,7 +121,7 @@ } /// Print form and popup menu - echo '
'.$strmoodleversion.' '; + echo '
'.$strmoodleversion.' '; popup_form("$CFG->wwwroot/$CFG->admin/environment.php?version=", $versions, 'selectversion', $version, ''); echo '
'; diff --git a/admin/maintenance.php b/admin/maintenance.php index 0eea6da7cf..d7e20ce2dc 100644 --- a/admin/maintenance.php +++ b/admin/maintenance.php @@ -37,18 +37,19 @@ /// Print the appropriate form if (file_exists($filename)) { // We are in maintenance mode - echo '
'; + echo '
'; echo '
'; echo ''; echo ''; echo '

'; echo '
'; - echo '
'; + echo '
'; } else { // We are not in maintenance mode $usehtmleditor = can_use_html_editor(); - echo '
'; + echo '
'; echo '
'; + echo '
'; echo ''; echo ''; echo '

'; @@ -56,8 +57,9 @@ echo '
'; print_textarea($usehtmleditor, 20, 50, 600, 400, "text"); echo '
'; + echo '
'; echo '
'; - echo '
'; + echo ''; if ($usehtmleditor) { use_html_editor(); diff --git a/admin/roles/assign.html b/admin/roles/assign.html index d08f6ce2df..3e1b47387f 100755 --- a/admin/roles/assign.html +++ b/admin/roles/assign.html @@ -1,11 +1,12 @@
+
- +
@@ -14,6 +15,7 @@ onfocus="getElementById('assignform').add.disabled=true; getElementById('assignform').remove.disabled=false; getElementById('assignform').addselect.selectedIndex=-1;"> + id\">".$fullname.", ".$contextuser->email.$hidden."\n"; } ?> - +
@@ -95,6 +97,7 @@
+
diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 4d2c103c75..6fb36db2e7 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -234,8 +234,8 @@ /// In the .html file below we loop through these results and exclude any in $contextusers - echo '
'.$strcurrentcontext.': '.print_context_name($context).'
'; - echo ': '; + echo '
'.$strcurrentcontext.': '.print_context_name($context).'
'; + echo ': '; $assignableroles = array('0'=>get_string('listallroles', 'role').'...') + $assignableroles; popup_form("$CFG->wwwroot/$CFG->admin/roles/assign.php?userid=$userid&courseid=$courseid&contextid=$contextid&roleid=", $assignableroles, 'switchrole', $roleid, ''); diff --git a/backup/backup_check.html b/backup/backup_check.html index 225ff656eb..c77496f66c 100644 --- a/backup/backup_check.html +++ b/backup/backup_check.html @@ -36,7 +36,7 @@ ?>
- +
-
-
+
" /> " /> -
+
diff --git a/backup/backup_form.html b/backup/backup_form.html index 354c524c56..6a57c4ed6a 100644 --- a/backup/backup_form.html +++ b/backup/backup_form.html @@ -112,9 +112,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { } --> -
- +
-
-
+ +
@@ -328,5 +327,5 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { " /> " /> -
-
+
+ \ No newline at end of file diff --git a/blog/blogpage.php b/blog/blogpage.php index c760e56ad8..7caf1ef5ce 100644 --- a/blog/blogpage.php +++ b/blog/blogpage.php @@ -186,8 +186,8 @@ class page_blog extends page_base { $paramstring .= ''; } - $editformstring = '
frametarget.' method="get" action="'.$this->url_get_path().'">' - .$paramstring.'
'; + $editformstring = '
frametarget.' method="get" action="'.$this->url_get_path().'">
' + .$paramstring.'
'; } return $editformstring; diff --git a/blog/header.php b/blog/header.php index 4a7dde7d69..71e4402c8b 100755 --- a/blog/header.php +++ b/blog/header.php @@ -228,8 +228,8 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { /// Start main column print '' . "\n"; -print ''; +print ''; ?> -
+ diff --git a/blog/lib.php b/blog/lib.php index 4473a82057..f524f08a51 100755 --- a/blog/lib.php +++ b/blog/lib.php @@ -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 = '
'; + $addlink = ''; echo $addlink; @@ -144,9 +144,9 @@ global $USER, $CFG, $COURSE, $ME; $template['body'] = format_text($blogEntry->summary, $blogEntry->format); - $template['title'] = ''; + //$template['title'] = ''; //enclose the title in nolink tags so that moodle formatting doesn't autolink the text - $template['title'] .= ''.$blogEntry->subject.''; + $template['title'] = ''.$blogEntry->subject.''; $template['userid'] = $blogEntry->userid; $template['author'] = fullname(get_record('user','id',$blogEntry->userid)); $template['lastmod'] = userdate($blogEntry->lastmodified); diff --git a/course/category.php b/course/category.php index 751063662d..84cdd09634 100644 --- a/course/category.php +++ b/course/category.php @@ -220,7 +220,7 @@ if ($firstentry) { echo ''; echo ''; - echo '
'.get_string('subcategories').'
'; + echo '
'; $firstentry = false; } $catlinkcss = $subcategory->visible ? "" : " class=\"dimmed\" "; diff --git a/course/info.php b/course/info.php index f0b02f4aa9..11afb81166 100644 --- a/course/info.php +++ b/course/info.php @@ -44,7 +44,7 @@ if ($teachers = get_course_teachers($course->id)) { - echo "
"; + echo ""; if (isset($result->time)) { $timeago = format_time(time() - $result->time); - echo ""; + echo ""; } echo ""; } diff --git a/course/user.php b/course/user.php index 394d4194fb..1c084ef66c 100644 --- a/course/user.php +++ b/course/user.php @@ -265,7 +265,7 @@ function print_outline_row($mod, $instance, $result) { echo ""; echo ""; - echo ""; echo ""; @@ -273,13 +273,13 @@ function print_outline_row($mod, $instance, $result) { if (isset($result->info)) { echo "$result->info"; } else { - echo "

-

"; + echo "

-

"; } echo ""; echo ""; if (!empty($result->time)) { $timeago = format_time(time() - $result->time); - echo ""; + echo ""; } echo ""; } diff --git a/lib/adminlib.php b/lib/adminlib.php index c648a2bd85..92a91ae817 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -1546,7 +1546,7 @@ class admin_setting_configtime extends admin_setting { $return .= ''; } $return .= ''; - 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 .= ''; - 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". '
'."\n". - '
'. "\n\n"; + + return $str; } /* diff --git a/lib/weblib.php b/lib/weblib.php index 0b9f88b0fa..927939593c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -809,7 +809,7 @@ function print_checkbox ($name, $value, $checked = true, $label = '', $alt = '', $htmlid = 'auto-cb'.sprintf('%04d', ++$idcounter); $output = '"; - $output .= ''; + $output .= ''; if(!empty($label)) { $output .= ' '; } @@ -4872,10 +4872,10 @@ function redirect($url, $message='', $delay=-1) { print_header('', '', '', '', ''); $delay += 3; // double redirect prevention, it was sometimes breaking upgrades before 1.7 } - echo '
'; + echo '
'; echo '

'. $message .'

'; echo '

( '. get_string('continue') .' )

'; - echo '
'; + echo ''; // it might be better not to set timeout the same for both types of redirect, so that we can be sure which one wins ?>
"; echo "

\n"; foreach ($teachers as $teacher) { if ($teacher->authority > 0) { diff --git a/course/report/outline/index.php b/course/report/outline/index.php index 40f883c9dc..01752e3385 100644 --- a/course/report/outline/index.php +++ b/course/report/outline/index.php @@ -114,7 +114,7 @@ function print_outline_row($mod, $instance, $result) { echo "

   ".userdate($result->time)." ($timeago)".userdate($result->time)." ($timeago)
$image"; + echo ""; echo " modfullname\""; echo " href=\"../mod/$mod->modname/view.php?id=$mod->id\">".format_string($instance->name,true)."      ".userdate($result->time)." ($timeago)".userdate($result->time)." ($timeago)