]> git.mjollnir.org Git - moodle.git/commitdiff
mod-scorm MDL-19816 Added set_url calls, replaced deprecated functions
authorsamhemelryk <samhemelryk>
Thu, 24 Sep 2009 08:36:06 +0000 (08:36 +0000)
committersamhemelryk <samhemelryk>
Thu, 24 Sep 2009 08:36:06 +0000 (08:36 +0000)
mod/survey/graph.php
mod/survey/index.php
mod/survey/report.php
mod/survey/view.php

index 0e6757bdedf6a9d4cf858609b4f3a192cf6fe2ed..4bcd5a9e4578dc8b995fb6ff8951d82f485a97a1 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
 
     require_once("../../config.php");
     require_once("$CFG->libdir/graphlib.php");
     $sid   = optional_param('sid', false, PARAM_INT);  // Student ID
     $qid   = optional_param('qid', 0, PARAM_INT);  // Group ID
 
+    $url = new moodle_url($CFG->wwwroot.'/mod/survey/graph.php', array('id'=>$id, 'type'=>$type));
+    if ($group !== 0) {
+        $url->param('group', $group);
+    }
+    if ($sid !== false) {
+        $url->param('sid', $sid);
+    }
+    if ($qid !== 0) {
+        $url->param('qid', $qid);
+    }
+    $PAGE->set_url($url);
+
     if (! $cm = get_coursemodule_from_id('survey', $id)) {
         print_error('invalidcoursemodule');
     }
index 188d8dbab76a12a0ea90b6e8d6d548747e67de14..f85f737ad795d672a7953cb40135cb8505e35e0f 100644 (file)
@@ -1,10 +1,12 @@
-<?php // $Id$
+<?php
 
     require_once("../../config.php");
     require_once("lib.php");
 
     $id = required_param('id', PARAM_INT);    // Course Module ID
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/survey/index.php', array('id'=>$id)));
+
     if (!$course = $DB->get_record('course', array('id'=>$id))) {
         print_error('invalidcourseid');
     }
index 9a31a9862d3fab6840ec63677dec21d12cbaa34c..767760763a1774ca91cbb9e6de69b4bcd5bd86d5 100644 (file)
 
     $PAGE->set_title("$course->shortname: ".format_string($survey->name));
     $PAGE->set_heading($course->fullname);
-    $PAGE->set_button(update_module_button($cm->id, $course->id, $strsurvey));
+    $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'survey'));
     echo $OUTPUT->header();
 
 /// Check to see if groups are being used in this survey
                     $table->data[] = array($contents);
 
                     echo $OUTPUT->table($table);
-                    print_spacer(30);
+                    
+                    $spacer = new html_image();
+                    $spacer->height = 30;
+                    $spacer->width = 1;
+                    echo $OUTPUT->spacer($spacer);
                 }
             }
         }
index d5e9384cd5eeed1d2224139e69df5174f4fe57f5..8f4f4bb1b323f2b6e6af5372b56ba6bd2bc42866 100644 (file)
@@ -59,7 +59,7 @@
 
     $strsurvey = get_string("modulename", "survey");
     $PAGE->set_title(format_string($survey->name));
-    $PAGE->set_button(update_module_button($cm->id, $course->id, $strsurvey));
+    $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'survey'));
     echo $OUTPUT->header();
 
 /// Check to see if groups are being used in this survey
@@ -82,7 +82,7 @@
         notice(get_string("activityiscurrentlyhidden"));
     }
 
-    if (isguest()) {
+    if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
         echo $OUTPUT->notification(get_string("guestsnotallowed", "survey"));
     }
 
         }
     }
 
-    if (isguest()) {
+    if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
         echo '</div>';
         echo "</form>";
         echo $OUTPUT->footer();