From 0733cc0062a7d4ab8c5e076ec0edb69ad4d97ebf Mon Sep 17 00:00:00 2001 From: michaelpenne Date: Thu, 27 Jan 2005 21:35:37 +0000 Subject: [PATCH] made a change to lesson_clean_data_submitted and added some xhtml compliance fixes --- mod/lesson/locallib.php | 45 +++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 3cbb7ef974..ba990c378f 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -913,21 +913,25 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) { // set up some variables NoticeFix changed whole function $output = ""; $close = false; - $title=$page->title; //CDC Chris Berri took out parsing of title in left menu on 6/11 $link="id=$id&action=navigation&pageid=".$page->id; + $output = "
  • "; + if (isset($_REQUEST['pageid'])) { if($page->id == $_REQUEST['pageid']) { $close=true; - $output.=""; + $output.=""; } } - $output .= "
  • id\">".$title."
  • \n"; + $output .= "id\">".$page->title."\n"; if($close) { - $output.=""; - } + $output.=""; + } + $output .= ""; + + echo $output; } @@ -935,6 +939,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) { /*******************************************************************/ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) { // this function prints out the tree view list + global $USER; if(!$pages = get_records_select("lesson_pages", "lessonid = $lessonid")) { error("Error: could not find lesson pages"); @@ -982,9 +987,9 @@ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) { echo "id."\">\n". "\"move\"\n"; //CDC alt text added. } - echo "id."\">\n". + echo "id."\">\n". "\"edit\"\n". - "id."\">\n". + "sesskey."&action=confirmdelete&pageid=".$pages[$pageid]->id."\">\n". "\"delete\"\n"; //CDC alt text added. echo ""; @@ -1102,7 +1107,7 @@ function lesson_qtype_menu($qtypes, $selected="", $link="", $onclick="") { foreach ($qtypes as $value => $label) { if ($value == $selected) { $output .= "$label"; - $output .= " \n"; + $output .= " \n"; } else { $output .= "$label"; } @@ -1137,20 +1142,20 @@ function lesson_clean_data_submitted() { // this function runs through all post/get data submitted to a page // and runs clean_param on each // returns an object - + // get the data - $form = data_submitted(); - - // run through and clean each form value - // detect arrays as well and process them accordingly - foreach ($form as $valuename => $formvalue) { - if (is_array($formvalue)) { - foreach ($formvalue as $index => $formsubvalue) { - $formvalue[$index] = clean_param($formsubvalue, PARAM_CLEAN); + if ($form = data_submitted()) { + // run through and clean each form value + // detect arrays as well and process them accordingly + foreach ($form as $valuename => $formvalue) { + if (is_array($formvalue)) { + foreach ($formvalue as $index => $formsubvalue) { + $formvalue[$index] = clean_param($formsubvalue, PARAM_CLEAN); + } + $form->$valuename = $formvalue; + } else { + $form->$valuename = clean_param($formvalue, PARAM_CLEAN); } - $form->$valuename = $formvalue; - } else { - $form->$valuename = clean_param($formvalue, PARAM_CLEAN); } } -- 2.39.5