MDL-32245 question bank: update URL after moving question between categories.

Also, improve the URL when you go to edit the questions in a category.
This commit is contained in:
Tim Hunt 2012-12-19 09:31:02 +00:00 committed by Sam Hemelryk
parent 917169221f
commit 9645fe83ff

View File

@ -100,7 +100,7 @@ class question_category_list_item extends list_item {
$editqestions = get_string('editquestions', 'question');
/// Each section adds html to be displayed as part of this list item
$questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('category'=>"$category->id,$category->contextid")));
$questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('cat'=>"$category->id,$category->contextid")));
$catediturl = $this->parentlist->pageurl->out(true, array('edit' => $this->id));
$item = "<b><a title=\"{$str->edit}\" href=\"$catediturl\">" .
format_string($category->name, true, array('context' => $this->parentlist->context)) .
@ -456,6 +456,8 @@ class question_category_object {
question_move_category_to_context($cat->id, $oldcat->contextid, $tocontextid);
}
// Cat param depends on the context id, so update it.
$this->pageurl->param('cat', $updateid . ',' . $tocontextid);
redirect($this->pageurl);
}
}