mod-hotpot MDL-19810 Added set_url calls, replaced deprecated functions
authorsamhemelryk <samhemelryk>
Thu, 24 Sep 2009 07:47:50 +0000 (07:47 +0000)
committersamhemelryk <samhemelryk>
Thu, 24 Sep 2009 07:47:50 +0000 (07:47 +0000)
mod/hotpot/attempt.php
mod/hotpot/grade.php
mod/hotpot/index.php
mod/hotpot/report.php
mod/hotpot/review.php
mod/hotpot/show.php
mod/hotpot/view.php

index 8cf1f9aa078b1a18812a8914e641c28c960b7b0a..589f1fd5ba1e8243168d1e47f31ba7453c405e30 100644 (file)
@@ -1,9 +1,12 @@
-<?php // $Id$
+<?php
+
     require_once("../../config.php");
     require_once("lib.php");
 
     $attemptid = required_param('attemptid', PARAM_INT);
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/attempt.php', array('attemptid'=>$attemptid)));
+
     // get attempt, hotpot, course and course_module records
     if (! $attempt = $DB->get_record("hotpot_attempts", array("id"=>$attemptid))) {
         print_error('invalidattemptid', 'hotpot');
index 08ffc8a38e476714a9899fd6b1887f462c186925..5863989b4e31d952cb36302775d36ffdfb90b983 100644 (file)
@@ -1,9 +1,11 @@
-<?php  // $Id$
+<?php
 
     require_once("../../config.php");
 
     $id   = required_param('id', PARAM_INT);          // Course module ID
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/grade.php', array('id'=>$id)));
+
     if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
         print_error('invalidcoursemodule');
     }
index b2a1109586c7d2b4d400e05d6c62ced1a2e37379..ddfcfb73e265687a69d8ddc6d289e6c19f3f537f 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP // $Id$
+<?PHP
 
 // This page lists all the instances of hotpot in a particular course
 
@@ -6,7 +6,10 @@
     require_once("../../course/lib.php");
     require_once("lib.php");
 
-    $id = required_param('id', PARAM_INT);   // course    
+    $id = required_param('id', PARAM_INT);   // course
+
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/index.php', array('id'=>$id)));
+
     if (!$course = $DB->get_record('course', array('id'=>$id))) {
         print_error('invalidcourseid');
     }
index b65c6812959da18bbed9549fb2c5dfbdc794fd9d..d9b20e073402953f8159844de131fb03a0c54744 100644 (file)
@@ -9,6 +9,7 @@
     $hp = optional_param('hp', 0, PARAM_INT); // hotpot ID
 
     if ($id) {
+        $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/report.php', array('id'=>$id)));
         if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
             print_error('invalidcoursemodule');
         }
@@ -20,6 +21,7 @@
         }
 
     } else {
+        $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/report.php', array('hp'=>$hp)));
         if (! $hotpot = $DB->get_record("hotpot", array("id"=>$hp))) {
             print_error('invalidhotpotid', 'hotpot');
         }
@@ -442,7 +444,7 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
 
     $PAGE->set_title(format_string($course->shortname) . ": $hotpot->name");
     $PAGE->set_heading($course->fullname);
-    $PAGE->set_button(update_module_button($cm->id, $course->id, $strmodulename));
+    $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'hotpot'));
     echo $OUTPUT->header();
     
     $course_context = get_context_instance(CONTEXT_COURSE, $course->id);
index 76c4c6725991b15524dacb2606288a12d830122e..03e12b41712dc88d2aa44b301a85c09f3de1df3c 100644 (file)
@@ -1,4 +1,5 @@
-<?PHP // $Id$
+<?PHP
+
 // This page prints a review of a particular quiz attempt
     require_once("../../config.php");
     require_once("lib.php");
@@ -8,6 +9,7 @@
     $attempt = required_param('attempt', PARAM_INT); // A particular attempt ID for review
 
     if ($id) {
+        $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/review.php', array('id'=>$id,'attempt'=>$attempt)));
         if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
             print_error('invalidcoursemodule');
         }
@@ -18,6 +20,7 @@
             print_error('invalidcoursemodule');
         }
     } else {
+        $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/review.php', array('hp'=>$hp,'attempt'=>$attempt)));
         if (! $hotpot = $DB->get_record("hotpot", array("id"=>$hp))) {
             print_error('invalidcoursemodule');
         }
@@ -56,7 +59,7 @@
     $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
     $PAGE->set_title(format_string($course->shortname) . ": $hotpot->name");
     $PAGE->set_heading($course->fullname);
-    $PAGE->set_button(update_module_button($cm->id, $course->id, $strmodulename));
+    $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'hotpot'));
     echo $OUTPUT->header();
     print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
     echo $OUTPUT->heading($hotpot->name);
index e29f3c7a7636c3693cd0619805ea017b1e04ac11..c78a029bd7959f6929bedf5a1d160f19b3beb6c9 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
     require_once("../../config.php");
     require_once("lib.php");
@@ -8,6 +8,8 @@
     $params->course = required_param('course', PARAM_INT);
     $params->reference = required_param('reference', PARAM_PATH);
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/show.php', array('action'=>$params->action, 'course'=>$params->course, 'reference'=>$params->reference)));
+
     require_login($params->course);
 
     if (!has_capability('mod/hotpot:viewreport',get_context_instance(CONTEXT_COURSE, $params->course))) {
index c5fb549d2d505c39aeaaf46965403cb3e651951a..59a8a15527c04e9ba626b7aff59c52398d2dbd87 100644 (file)
@@ -1,4 +1,5 @@
-<?PHP // $Id$
+<?PHP
+
     /// This page prints a hotpot quiz
     if (defined('HOTPOT_FIRST_ATTEMPT') && HOTPOT_FIRST_ATTEMPT==false) {
         // this script is being included (by attempt.php)
@@ -12,6 +13,7 @@
         $hp = optional_param('hp', 0, PARAM_INT); // hotpot ID
 
         if ($id) {
+            $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/report.php', array('id'=>$id)));
             if (! $cm = get_coursemodule_from_id('hotpot', $id)) {
                 print_error('invalidcoursemodule');
             }
@@ -23,6 +25,7 @@
             }
 
         } else {
+            $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/hotpot/report.php', array('hp'=>$hp)));
             if (! $hotpot = $DB->get_record("hotpot", array("id"=>$hp))) {
                 print_error('invalidhotpotid', 'hotpot');
             }
@@ -43,7 +46,7 @@
     $title = format_string($course->shortname.': '.$hotpot->name, true);
     $heading = $course->fullname;
 
-    $button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
+    $button = $OUTPUT->update_module_button($cm->id, 'hotpot');
     $button = '<div style="font-size:0.75em;">'.$button.'</div>';
     $loggedinas = '<span class="logininfo">'.user_login_string($course, $USER).'</span>';
 
     $footer = '</div></div>'.$footer;
     switch ($hotpot->navigation) {
         case HOTPOT_NAVIGATION_BAR:
-            //update_module_button($cm->id, $course->id, $strmodulename.'" style="font-size:0.8em')
-            print_header($title, $heading, '', "", $head.$styles.$scripts, true, $button, $loggedinas, false, $body_tags);
+            $PAGE->set_title($title);
+            $PAGE->set_heading($heading);
+            $PAGE->set_button($button);
+            $PAGE->set_headingmenu($loggedinas);
+            echo $OUTPUT->header();
             if (!empty($available_msg)) {
                 echo $OUTPUT->notification($available_msg);
             }