From: samhemelryk Date: Thu, 24 Sep 2009 08:36:06 +0000 (+0000) Subject: mod-scorm MDL-19816 Added set_url calls, replaced deprecated functions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5956e2ef3ba61ac9d2225a4f3033f81327049030;p=moodle.git mod-scorm MDL-19816 Added set_url calls, replaced deprecated functions --- diff --git a/mod/survey/graph.php b/mod/survey/graph.php index 0e6757bded..4bcd5a9e45 100644 --- a/mod/survey/graph.php +++ b/mod/survey/graph.php @@ -1,4 +1,4 @@ -libdir/graphlib.php"); @@ -10,6 +10,18 @@ $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'); } diff --git a/mod/survey/index.php b/mod/survey/index.php index 188d8dbab7..f85f737ad7 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -1,10 +1,12 @@ -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'); } diff --git a/mod/survey/report.php b/mod/survey/report.php index 9a31a9862d..767760763a 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -119,7 +119,7 @@ $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 @@ -307,7 +307,11 @@ $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); } } } diff --git a/mod/survey/view.php b/mod/survey/view.php index d5e9384cd5..8f4f4bb1b3 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -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")); } @@ -177,7 +177,7 @@ } } - if (isguest()) { + if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) { echo ''; echo ""; echo $OUTPUT->footer();