Browse files

MDL-34468 survey: Replace all instances of get_context_instance() wit…

…h respective context_XXXX class in mod/survey
  • Loading branch information...
1 parent bc659e5 commit 1c9691160b046486de6c13bd4a4e9409e92ebe9c @ankitagarwal ankitagarwal committed Jul 24, 2012
Showing with 6 additions and 6 deletions.
  1. +2 −2 mod/survey/download.php
  2. +1 −1 mod/survey/graph.php
  3. +1 −1 mod/survey/report.php
  4. +1 −1 mod/survey/save.php
  5. +1 −1 mod/survey/view.php
View
4 mod/survey/download.php
@@ -40,7 +40,7 @@
print_error('coursemisconf');
}
-$context = get_context_instance(CONTEXT_MODULE, $cm->id);
+$context = context_module::instance($cm->id);
$PAGE->set_url('/mod/survey/download.php', array('id'=>$id, 'type'=>$type, 'group'=>$group));
@@ -146,7 +146,7 @@
}
// Output the file as a valid ODS spreadsheet if required
-$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
+$coursecontext = context_course::instance($course->id);
$courseshortname = format_string($course->shortname, true, array('context' => $coursecontext));
if ($type == "ods") {
View
2 mod/survey/graph.php
@@ -39,7 +39,7 @@
require_login($course, false, $cm);
$groupmode = groups_get_activity_groupmode($cm); // Groups are being used
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = context_module::instance($cm->id);
if (!has_capability('mod/survey:readresponses', $context)) {
if ($type != "student.png" or $sid != $USER->id ) {
View
2 mod/survey/report.php
@@ -63,7 +63,7 @@
require_login($course, false, $cm);
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = context_module::instance($cm->id);
require_capability('mod/survey:readresponses', $context);
View
2 mod/survey/save.php
@@ -47,7 +47,7 @@
$PAGE->set_url('/mod/survey/save.php', array('id'=>$id));
require_login($course, false, $cm);
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = context_module::instance($cm->id);
require_capability('mod/survey:participate', $context);
if (! $survey = $DB->get_record("survey", array("id"=>$cm->instance))) {
View
2 mod/survey/view.php
@@ -38,7 +38,7 @@
$PAGE->set_url('/mod/survey/view.php', array('id'=>$id));
require_login($course, false, $cm);
- $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+ $context = context_module::instance($cm->id);
require_capability('mod/survey:participate', $context);

0 comments on commit 1c96911

Please sign in to comment.