Removing the <a name="2"></a> anchors from course sections (used with links,

e.g. /course/view.php?id=2#4). We already have elements with id="section-XXX",
so I made all links I could possibly grep for point to those.

All this for XHTML (won't Tidy ever be content?)
This commit is contained in:
defacer
2005-11-23 23:14:25 +00:00
parent 4d4e738f7c
commit 4baeb9b028
4 changed files with 31 additions and 38 deletions
+8 -10
View File
@@ -245,9 +245,7 @@ while ($section <= $course->numsections) {
echo '<tr id="section-'.$section.'" class="section main'.$sectionstyle.'">';
echo '<td class="left side">';
echo '<a name="'.$section.'">'.$section.'</a>';
echo '</td>';
echo '<td class="left side">&nbsp;</td>';
echo '<td class="content">';
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
@@ -273,7 +271,7 @@ while ($section <= $course->numsections) {
echo '<td class="right side">';
if ($displaysection == $section) { // Show the zoom boxes
echo '<a href="view.php?id='.$course->id.'&amp;topic=all#'.$section.'" title="'.$strshowalltopics.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;topic=all#section-'.$section.'" title="'.$strshowalltopics.'">'.
'<img src="'.$CFG->pixpath.'/i/all.gif" height="25" width="16" border="0" /></a><br />';
} else {
$strshowonlytopic = get_string('showonlytopic', '', $section);
@@ -283,28 +281,28 @@ while ($section <= $course->numsections) {
if (isediting($course->id)) {
if ($course->marker == $section) { // Show the "light globe" on/off
echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strmarkedthistopic.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkedthistopic.'">'.
'<img src="'.$CFG->pixpath.'/i/marked.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strmarkthistopic.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkthistopic.'">'.
'<img src="'.$CFG->pixpath.'/i/marker.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
}
if ($thissection->visible) { // Show the hide/show eye
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strtopichide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.
'<img src="'.$CFG->pixpath.'/i/hide.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strtopichide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.
'<img src="'.$CFG->pixpath.'/i/show.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
}
if ($section > 1) { // Add a arrow to move section up
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#'.($section-1).'" title="'.$strmoveup.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
'<img src="'.$CFG->pixpath.'/t/up.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#'.($section+1).'" title="'.$strmovedown.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
'<img src="'.$CFG->pixpath.'/t/down.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
+8 -11
View File
@@ -171,10 +171,7 @@
}
echo '<tr id="section-'.$section.'" class="section main'.$sectionstyle.'">';
echo '<td class="left side">';
echo '<a name="'.$section.'">'.$section.'</a>';
echo '</td>';
echo '<td class="left side">&nbsp;</td>';
echo '<td class="content">';
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
@@ -200,7 +197,7 @@
echo '<td class="right side">';
if ($displaysection == $section) { // Show the zoom boxes
echo '<a href="view.php?id='.$course->id.'&amp;topic=all#'.$section.'" title="'.$strshowalltopics.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;topic=all#section-'.$section.'" title="'.$strshowalltopics.'">'.
'<img src="'.$CFG->pixpath.'/i/all.gif" height="25" width="16" border="0" /></a><br />';
} else {
$strshowonlytopic = get_string('showonlytopic', '', $section);
@@ -210,28 +207,28 @@
if (isediting($course->id)) {
if ($course->marker == $section) { // Show the "light globe" on/off
echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strmarkedthistopic.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;marker=0&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkedthistopic.'">'.
'<img src="'.$CFG->pixpath.'/i/marked.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strmarkthistopic.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;marker='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strmarkthistopic.'">'.
'<img src="'.$CFG->pixpath.'/i/marker.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
}
if ($thissection->visible) { // Show the hide/show eye
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strtopichide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.
'<img src="'.$CFG->pixpath.'/i/hide.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strtopichide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strtopichide.'">'.
'<img src="'.$CFG->pixpath.'/i/show.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
}
if ($section > 1) { // Add a arrow to move section up
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#'.($section-1).'" title="'.$strmoveup.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
'<img src="'.$CFG->pixpath.'/t/up.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#'.($section+1).'" title="'.$strmovedown.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
'<img src="'.$CFG->pixpath.'/t/down.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
+6 -8
View File
@@ -168,9 +168,7 @@
}
echo '<tr id="section-'.$section.'" class="section main'.$sectionstyle.'">';
echo '<td class="left side">';
echo '<a name="'.$section.'">'.$section.'</a>';
echo '</td>';
echo '<td class="left side">&nbsp;</td>';
echo '<td class="content">';
if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students
@@ -200,7 +198,7 @@
echo '<td class="right side">';
if ($displaysection == $section) {
echo '<a href="view.php?id='.$course->id.'&amp;week=all#'.$section.'" title="'.$strshowallweeks.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;week=all#section-'.$section.'" title="'.$strshowallweeks.'">'.
'<img src="'.$CFG->pixpath.'/i/all.gif" height="25" width="16" border="0" /></a><br />';
} else {
$strshowonlyweek = get_string("showonlyweek", "", $section);
@@ -210,19 +208,19 @@
if (isediting($course->id)) {
if ($thissection->visible) { // Show the hide/show eye
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strweekhide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekhide.'">'.
'<img src="'.$CFG->pixpath.'/i/hide.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
} else {
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#'.$section.'" title="'.$strweekhide.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekhide.'">'.
'<img src="'.$CFG->pixpath.'/i/show.gif" vspace="3" height="16" width="16" border="0" alt="" /></a><br />';
}
if ($section > 1) { // Add a arrow to move section up
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#'.($section-1).'" title="'.$strmoveup.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
'<img src="'.$CFG->pixpath.'/t/up.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
if ($section < $course->numsections) { // Add a arrow to move section down
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#'.($section+1).'" title="'.$strmovedown.'">'.
echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
'<img src="'.$CFG->pixpath.'/t/down.gif" vspace="3" height="11" width="11" border="0" alt="" /></a><br />';
}
}
+9 -9
View File
@@ -35,7 +35,7 @@
unset($SESSION->returnpage);
redirect($return);
} else {
redirect("view.php?id=$mod->course#$sectionreturn");
redirect("view.php?id=$mod->course#section-$sectionreturn");
}
}
@@ -215,7 +215,7 @@
unset($SESSION->returnpage);
redirect($return);
} else {
redirect("view.php?id=$course->id#$sectionreturn");
redirect("view.php?id=$course->id#section-$sectionreturn");
}
exit;
}
@@ -260,7 +260,7 @@
if (SITEID == $section->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$section->course#$sectionreturn");
redirect("view.php?id=$section->course#section-$sectionreturn");
}
} else if (isset_param('indent') and confirm_sesskey()) {
@@ -288,7 +288,7 @@
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course#$sectionreturn");
redirect("view.php?id=$cm->course#section-$sectionreturn");
}
exit;
@@ -309,7 +309,7 @@
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course#$sectionreturn");
redirect("view.php?id=$cm->course#section-$sectionreturn");
}
exit;
@@ -339,7 +339,7 @@
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course#$sectionreturn");
redirect("view.php?id=$cm->course#section-$sectionreturn");
}
exit;
@@ -362,7 +362,7 @@
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course#$sectionreturn");
redirect("view.php?id=$cm->course#section-$sectionreturn");
}
exit;
@@ -392,7 +392,7 @@
$USER->activitycopycourse = $cm->course;
$USER->activitycopyname = $instance->name;
redirect("view.php?id=$cm->course#$sectionreturn");
redirect("view.php?id=$cm->course#section-$sectionreturn");
} else if (isset_param('cancelcopy') and confirm_sesskey()) { // value = course module
@@ -402,7 +402,7 @@
unset($USER->activitycopycourse);
unset($USER->activitycopyname);
redirect("view.php?id=$courseid#$sectionreturn");
redirect("view.php?id=$courseid#section-$sectionreturn");
} else if (isset_param('delete') and confirm_sesskey()) { // value = course module