Skip to content

Commit

Permalink
Now lesson_pages->title supports filterall
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 26, 2005
1 parent 630bd96 commit 68dfc4d
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions mod/lesson/action/addpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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>
2 changes: 1 addition & 1 deletion mod/lesson/action/confirmdelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/action/editpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions mod/lesson/action/insertpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -188,4 +188,4 @@
}
/// CDC-FLAG ///
redirect("view.php?id=$cm->id", get_string('insertedpage', 'lesson'));
?>
?>
6 changes: 3 additions & 3 deletions mod/lesson/action/move.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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";
Expand All @@ -36,4 +36,4 @@
}
}
echo "</table>\n";
?>
?>
4 changes: 2 additions & 2 deletions mod/lesson/action/moveit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -99,4 +99,4 @@
error("Moveit: unable to update link");
}
redirect("view.php?id=$cm->id", get_string('movedpage', 'lesson'));
?>
?>
8 changes: 4 additions & 4 deletions mod/lesson/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>";
Expand All @@ -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: ";
Expand All @@ -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 .= ", ";
Expand Down
8 changes: 4 additions & 4 deletions mod/lesson/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, "");
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 />";

Expand Down Expand Up @@ -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".
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>";
Expand Down

0 comments on commit 68dfc4d

Please sign in to comment.