MDL-47494 ddmarker: Fix use of deprecated accesslib functions.

This commit is contained in:
Tim Hunt
2014-01-31 16:17:04 +00:00
parent 9d26e5b4ec
commit 3c3633b3c6
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ function qtype_ddmarker_pluginfile($course, $cm, $context, $filearea, $args, $fo
function qtype_ddmarker_course_context_id($catcontextid) {
$context = context::instance_by_id($catcontextid);
while ($context->contextlevel != CONTEXT_COURSE) {
$context = context::instance_by_id(get_parent_contextid($context));
$context = $context->get_parent_context();
}
return $context->id;
}
+5 -5
View File
@@ -169,7 +169,7 @@ class qtype_ddmarker_context_list_item extends qtype_ddmarker_list_item {
}
public function item_name() {
return print_context_name($this->record);
return context_helper::preload_from_record($this->record)->get_context_name();
}
public function course_context_id() {
@@ -218,10 +218,10 @@ class qtype_ddmarker_context_list extends qtype_ddmarker_list {
if (!isset($this->records[$contextid])) {
$this->records[$contextid] = context::instance_by_id($contextid);
}
$parents = get_parent_contexts($this->records[$contextid]);
foreach ($parents as $parentcontextid) {
if (!isset($this->records[$parentcontextid])) {
$this->records[$parentcontextid] = context::instance_by_id($parentcontextid);
$parents = $this->records[$contextid]->get_parent_contexts();
foreach ($parents as $parentcontext) {
if (!isset($this->records[$parentcontext->id])) {
$this->records[$parentcontext->id] = $parentcontext;
}
}
}