mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-19808 Upgraded view.php to new pagelib and outputlib APIs
This commit is contained in:
parent
78a038d3ed
commit
385219cba9
1 changed files with 9 additions and 9 deletions
|
@ -27,8 +27,6 @@
|
||||||
}
|
}
|
||||||
$PAGE->set_url('mod/forum/view.php', $params);
|
$PAGE->set_url('mod/forum/view.php', $params);
|
||||||
|
|
||||||
$buttontext = '';
|
|
||||||
|
|
||||||
if ($id) {
|
if ($id) {
|
||||||
if (! $cm = get_coursemodule_from_id('forum', $id)) {
|
if (! $cm = get_coursemodule_from_id('forum', $id)) {
|
||||||
print_error('invalidcoursemodule');
|
print_error('invalidcoursemodule');
|
||||||
|
@ -44,7 +42,7 @@
|
||||||
require_course_login($course, true, $cm);
|
require_course_login($course, true, $cm);
|
||||||
$strforums = get_string("modulenameplural", "forum");
|
$strforums = get_string("modulenameplural", "forum");
|
||||||
$strforum = get_string("modulename", "forum");
|
$strforum = get_string("modulename", "forum");
|
||||||
$buttontext = update_module_button($cm->id, $course->id, $strforum);
|
$PAGE->set_button(update_module_button($cm->id, $course->id, $strforum));
|
||||||
|
|
||||||
} else if ($f) {
|
} else if ($f) {
|
||||||
|
|
||||||
|
@ -63,23 +61,25 @@
|
||||||
require_course_login($course, true, $cm);
|
require_course_login($course, true, $cm);
|
||||||
$strforums = get_string("modulenameplural", "forum");
|
$strforums = get_string("modulenameplural", "forum");
|
||||||
$strforum = get_string("modulename", "forum");
|
$strforum = get_string("modulename", "forum");
|
||||||
$buttontext = update_module_button($cm->id, $course->id, $strforum);
|
$PAGE->set_button(update_module_button($cm->id, $course->id, $strforum));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
print_error('missingparameter');
|
print_error('missingparameter');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$buttontext) {
|
if (!$PAGE->button) {
|
||||||
$buttontext = forum_search_form($course, $search);
|
$PAGE->set_button(forum_search_form($course, $search));
|
||||||
}
|
}
|
||||||
|
|
||||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||||
|
$PAGE->set_context($context);
|
||||||
|
|
||||||
|
|
||||||
/// Print header.
|
/// Print header.
|
||||||
$navigation = build_navigation('', $cm);
|
$navigation = build_navigation('', $cm);
|
||||||
print_header_simple(format_string($forum->name), "",
|
$PAGE->set_title(format_string($forum->name));
|
||||||
$navigation, "", "", true, $buttontext, navmenu($course, $cm));
|
$PAGE->set_heading(format_string($course->fullname));
|
||||||
|
echo $OUTPUT->header($navigation, navmenu($course, $cm));
|
||||||
|
|
||||||
/// Some capability checks.
|
/// Some capability checks.
|
||||||
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
|
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
|
||||||
|
@ -283,6 +283,6 @@
|
||||||
}
|
}
|
||||||
$completion=new completion_info($course);
|
$completion=new completion_info($course);
|
||||||
$completion->set_module_viewed($cm);
|
$completion->set_module_viewed($cm);
|
||||||
print_footer($course);
|
echo $OUTPUT->footer($course);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue