Now lesson_pages->title supports filterall

This commit is contained in:
stronk7
2005-04-26 22:30:40 +00:00
parent 630bd96bd9
commit 68dfc4deb6
9 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -32,7 +32,7 @@
while (true) {
if ($apageid) {
$title = get_field("lesson_pages", "title", "id", $apageid);
$jump[$apageid] = $title;
$jump[$apageid] = strip_tags(format_string($title,true));
$apageid = get_field("lesson_pages", "nextpageid", "id", $apageid);
} else {
// last page reached
@@ -238,4 +238,4 @@
<input type="submit" value="<?php print_string("addaquestionpage", "lesson") ?>">
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>">
</center>
</form>
</form>
+1 -1
View File
@@ -12,7 +12,7 @@
if (!$thispage = get_record("lesson_pages", "id", $pageid)) {
error("Confirm delete: the page record not found");
}
print_heading(get_string("deletingpage", "lesson", $thispage->title));
print_heading(get_string("deletingpage", "lesson", format_string($thispage->title)));
// print the jumps to this page
if ($answers = get_records_select("lesson_answers", "lessonid = $lesson->id AND jumpto = $pageid + 1")) {
print_heading(get_string("thefollowingpagesjumptothispage", "lesson"));
+1 -1
View File
@@ -44,7 +44,7 @@
}
/// CDC-FLAG /// 6/15/04 removed != LESSON_ENDOFBRANCH...
if (trim($page->title)) { // ...nor nuffin pages
$jump[$apageid] = $apage->title;
$jump[$apageid] = strip_tags(format_string($apage->title,true));
}
$apageid = $apage->nextpageid;
} else {
+4 -4
View File
@@ -40,7 +40,7 @@
$newpage->display = 0;
}
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEAN);
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
@@ -83,7 +83,7 @@
$newpage->display = 0;
}
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEAN);
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
@@ -113,7 +113,7 @@
$newpage->display = 0;
}
/// CDC-FLAG ///
$newpage->title = clean_param($form->title, PARAM_CLEAN);
$newpage->title = clean_param($form->title, PARAM_CLEANHTML);
$newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML);
$newpageid = insert_record("lesson_pages", $newpage);
if (!$newpageid) {
@@ -188,4 +188,4 @@
}
/// CDC-FLAG ///
redirect("view.php?id=$cm->id", get_string('insertedpage', 'lesson'));
?>
?>
+3 -3
View File
@@ -8,7 +8,7 @@
$pageid = required_param('pageid', PARAM_INT);
$title = get_field("lesson_pages", "title", "id", $pageid);
print_heading(get_string("moving", "lesson", $title));
print_heading(get_string("moving", "lesson", format_string($title)));
if (!$page = get_record_select("lesson_pages", "lessonid = $lesson->id AND prevpageid = 0")) {
error("Move: first page not found");
@@ -19,7 +19,7 @@
get_string("movepagehere", "lesson")."</small></a></td></tr>\n";
while (true) {
if ($page->id != $pageid) {
if (!$title = trim($page->title)) {
if (!$title = trim(format_string($page->title))) {
$title = "<< ".get_string("notitle", "lesson")." >>";
}
echo "<tr><td><b>$title</b></td></tr>\n";
@@ -36,4 +36,4 @@
}
}
echo "</table>\n";
?>
?>
+2 -2
View File
@@ -14,7 +14,7 @@
}
$after = required_param('after', PARAM_INT); // target page
print_heading(get_string("moving", "lesson", $page->title));
print_heading(get_string("moving", "lesson", format_string($page->title)));
// first step. determine the new first page
// (this is done first as the current first page will be lost in the next step)
@@ -99,4 +99,4 @@
error("Moveit: unable to update link");
}
redirect("view.php?id=$cm->id", get_string('movedpage', 'lesson'));
?>
?>
+4 -4
View File
@@ -927,7 +927,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) {
}
}
$output .= "<a href=\"view.php?id=$id&amp;action=navigation&amp;pageid=$page->id\">".$page->title."</a>\n";
$output .= "<a href=\"view.php?id=$id&amp;action=navigation&amp;pageid=$page->id\">".format_string($page->title,true)."</a>\n";
if($close) {
$output.="</em>";
@@ -951,9 +951,9 @@ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) {
while ($pageid != 0) {
echo "<tr><td>";
if(($pages[$pageid]->qtype != LESSON_BRANCHTABLE) && ($pages[$pageid]->qtype != LESSON_ENDOFBRANCH)) {
$output = "<a style='color:#DF041E;' href=\"view.php?id=$cmid&display=".$pages[$pageid]->id."\">".$pages[$pageid]->title."</a>\n";
$output = "<a style='color:#DF041E;' href=\"view.php?id=$cmid&display=".$pages[$pageid]->id."\">".format_string($pages[$pageid]->title,true)."</a>\n";
} else {
$output = "<a href=\"view.php?id=$cmid&display=".$pages[$pageid]->id."\">".$pages[$pageid]->title."</a>\n";
$output = "<a href=\"view.php?id=$cmid&display=".$pages[$pageid]->id."\">".format_string($pages[$pageid]->title,true)."</a>\n";
if($answers = get_records_select("lesson_answers", "lessonid = $lessonid and pageid = $pageid")) {
$output .= "Jumps to: ";
@@ -976,7 +976,7 @@ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) {
} elseif ($answer->jumpto == LESSON_CLUSTERJUMP) {
$output .= get_string("clusterjump", "lesson");
} else {
$output .= $pages[$answer->jumpto]->title;
$output .= format_string($pages[$answer->jumpto]->title);
}
if ($answer->id != $end->id) {
$output .= ", ";
+4 -4
View File
@@ -406,7 +406,7 @@
$data ='';
$answerdata = new stdClass;
$answerpage->title = $page->title;
$answerpage->title = format_string($page->title);
$answerpage->contents = $page->contents;
// get the page qtype
@@ -741,7 +741,7 @@
} elseif ($answer->jumpto == LESSON_CLUSTERJUMP) {
$data .= get_string("clusterjump", "lesson");
} else {
$data .= $lessonpages[$answer->jumpto]->title." ".get_string("page", "lesson");
$data .= format_string($lessonpages[$answer->jumpto]->title)." ".get_string("page", "lesson");
}
$answerdata->answers[] = array($data, "");
@@ -768,7 +768,7 @@
} elseif ($answer->jumpto == LESSON_CLUSTERJUMP) {
$data .= get_string("clusterjump", "lesson");
} else {
$data .= $lessonpages[$answer->jumpto]->title." ".get_string("page", "lesson");
$data .= format_string($lessonpages[$answer->jumpto]->title)." ".get_string("page", "lesson");
}
$answerdata->answers[] = array($data, "");
$answerpage->grayout = 1; // always grayed out
@@ -843,7 +843,7 @@
$fontend2 = "";
}
$table->head = array($fontstart2.$page->qtype.": ".$page->title.$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2);
$table->head = array($fontstart2.$page->qtype.": ".format_string($page->title).$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2);
$table->data[] = array($fontstart.get_string("question", "lesson").": <br />".$fontend.$fontstart2.$page->contents.$fontend2, " ");
$table->data[] = array($fontstart.get_string("answer", "lesson").":".$fontend);
// apply the font to each answer
+4 -4
View File
@@ -549,7 +549,7 @@
echo format_string($lesson->name) . "</strong></em>";
if ($page->qtype == LESSON_BRANCHTABLE) {
echo ":<br />";
print_heading($page->title);
print_heading(format_string($page->title));
}
echo "</div><br />";
@@ -1255,7 +1255,7 @@
/// CDC-FLAG /// end tree code (note, there is an "}" below for an else above)
while (true) {
echo "<tr><td>\n";
echo "<table width=\"100%\" border=\"1\"><tr><th colspan=\"2\">$page->title&nbsp;&nbsp;\n";
echo "<table width=\"100%\" border=\"1\"><tr><th colspan=\"2\">".format_string($page->title)."&nbsp;&nbsp;\n";
if (isteacheredit($course->id)) {
if ($npages > 1) {
echo "<a title=\"".get_string("move")."\" href=\"lesson.php?id=$cm->id&amp;action=move&amp;pageid=$page->id\">\n".
@@ -1592,7 +1592,7 @@
$style = "style='color:#999999;'";
}
// link for each essay
$essaylinks[] = "<a $style href=\"view.php?id=$cm->id&amp;action=essaygrade&attemptid=$essay->id\">".$pages[$essay->pageid]->title."</a>";
$essaylinks[] = "<a $style href=\"view.php?id=$cm->id&amp;action=essaygrade&attemptid=$essay->id\">".format_string($pages[$essay->pageid]->title,true)."</a>";
}
}
// email link for this user
@@ -1774,7 +1774,7 @@
foreach ($essayattempts as $essay) {
$essayinfo = unserialize($essay->useranswer);
if ($essayinfo->graded && !$essayinfo->sent) {
$subject = get_string('essayemailsubject', 'lesson', $pages[$essay->pageid]->title);
$subject = get_string('essayemailsubject', 'lesson', format_string($pages[$essay->pageid]->title,true));
$message = get_string('question', 'lesson').":<br>";
$message .= $pages[$essay->pageid]->contents;
$message .= "<br><br>";