//////////////////////////////////
function glossary_comment_print_header($course, $cm, $glossary, $entry, $action) {
+ global $PAGE, $OUTPUT;
switch ($action){
case 'add':
$straction = get_string('addingcomment','glossary');
$strglossary = get_string('modulename', 'glossary');
$strcomments = get_string('comments', 'glossary');
- $navlinks = array();
- $navlinks[] = array('name' => $strcomments, 'link' => "comments.php?id=$cm->id&eid=$entry->id", 'type' => 'title');
- $navlinks[] = array('name' => $straction, 'link' => '', 'type' => 'action');
- $navigation = build_navigation($navlinks, $cm);
-
- print_header_simple(format_string($glossary->name), '', $navigation,
- '', '', true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
+ $PAGE->navbar->add($strcomments, new moodle_url($CFG->wwwroot.'/mod/glossary/comments.php', array('id'=>$cm->id,'eid'=>$entry->id)));
+ $PAGE->navbar->add($straction);
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+ echo $OUTPUT->header();
+
/// print original glossary entry for any comment action (add, update, delete)
glossary_print_entry($course, $cm, $glossary, $entry, 'approval', '', false);
}
$strcomments = get_string("comments", "glossary");
$straddcomment = get_string("addcomment", "glossary");
- $navigation = build_navigation($strcomments, $cm);
- print_header_simple(strip_tags("$strcomments: $entry->concept"), "", $navigation,
- "", "", true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
+ $PAGE->navbar->add($strcomments);
+ $PAGE->set_title(strip_tags("$strcomments: $entry->concept"));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+ echo $OUTPUT->header();
/// original glossary entry
$strareyousuredelete = get_string("areyousuredelete","glossary");
- $navigation = build_navigation('', $cm);
-
if (($entry->userid != $USER->id) and !$manageentries) { // guest id is never matched, no need for special check here
print_error('nopermissiontodelentry');
}
redirect("view.php?id=$cm->id&mode=$prevmode&hook=$hook");
} else { // the operation has not been confirmed yet so ask the user to do so
- print_header_simple(format_string($glossary->name), "", $navigation,
- "", "", true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+ echo $OUTPUT->header();
$areyousure = "<b>".format_string($entry->concept)."</b><p>$strareyousuredelete</p>";
$linkyes = 'deleteentry.php';
$linkno = 'view.php';
$stredit = empty($entry->id) ? get_string('addentry', 'glossary') : get_string('edit');
-$navigation = build_navigation($stredit, $cm);
-print_header_simple(format_string($glossary->name), "", $navigation, "",
- "", true, "", navmenu($course, $cm));
-
+$PAGE->navbar->add($stredit);
+$PAGE->set_title(format_string($glossary->name));
+echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($glossary->name));
$mform->display();
$strglossaries = get_string("modulenameplural", "glossary");
$strglossary = get_string("modulename", "glossary");
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id&tab=GLOSSARY_CATEGORY_VIEW", 'type' => 'activityinstance');
- $navlinks[] = array('name' => get_string("categories","glossary"), 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
- print_header_simple(format_string($glossary->name), "", $navigation,
- "", "", true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
+ $PAGE->navbar->add($strglossaries, new moodle_url($CFG->wwwroot.'/mod/glossary/index.php', array('id'=>$course->id)));
+ $PAGE->navbar->add(format_string($glossary->name), new moodle_url($CFG->wwwroot.'/mod/glossary/view.php', array('id'=>$cm->id,'tab'=>'GLOSSARY_CATEGORY_VIEW')));
+ $PAGE->navbar->add(get_string("categories","glossary"));
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+ echo $OUTPUT->header();
if ( $hook >0 ) {
$strexportfile = get_string("exportfile", "glossary");
$strexportentries = get_string('exportentriestoxml', 'glossary');
- $navigation = build_navigation($strexportentries, $cm);
- print_header_simple(format_string($glossary->name), "",$navigation,
- "", "", true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
+ $PAGE->navbar->add($strexportentries);
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+ echo $OUTPUT->header();
echo $OUTPUT->heading($strexportentries);
-
echo $OUTPUT->box_start('glossarydisplay generalbox');
?>
<form action="exportfile.php" method="post">
$entryalreadyexist = get_string('entryalreadyexist','glossary');
$entryexported = get_string('entryexported','glossary');
- $navigation = build_navigation('', $cm);
-
if (!$mainglossary->allowduplicatedentries) {
if ($DB->get_record('glossary_entries', array('glossaryid'=>$mainglossary->id, 'lower(concept)'=>moodle_strtolower($entry->concept)))) {
- print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
+ $PAGE->set_title(format_string($glossary->name));
+ echo $OUTPUT->header();
echo $OUTPUT->notification(get_string('errconceptalreadyexists', 'glossary'));
echo $OUTPUT->continue_button($returnurl);
echo $OUTPUT->box_end();
}
if (!data_submitted() or !$confirm or !confirm_sesskey()) {
- print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
+ $PAGE->set_title(format_string($glossary->name));
+ echo $OUTPUT->header();
echo '<div class="boxaligncenter">';
$areyousure = '<h2>'.format_string($entry->concept).'</h2><p align="center">'.get_string('areyousureexport','glossary').'<br /><b>'.format_string($mainglossary->name).'</b>?';
$linkyes = 'exportentry.php';
$strsearch = get_string("search");
$strimportentries = get_string('importentriesfromxml', 'glossary');
- $navigation = build_navigation($strimportentries, $cm);
- print_header_simple(format_string($glossary->name), "", $navigation,
- "", "", true, update_module_button($cm->id, $course->id, $strglossary),
- navmenu($course, $cm));
-
+ $PAGE->navbar->add($strimportentries);
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
+
+ echo $OUTPUT->header();
echo $OUTPUT->heading($strimportentries);
if ( !$step ) {
/// Print the header
- $navlinks = array();
- $navlinks[] = array('name' => $strglossarys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navigation = build_navigation($navlinks);
-
- print_header_simple("$strglossarys", "", $navigation, "", "", true, "", navmenu($course));
+ $PAGE->navbar->add($strglossarys, "index.php?id=$course->id");
+ $PAGE->set_title($strglossarys);
+ echo $OUTPUT->header();
/// Get all the appropriate data
$entriesbypage = $CFG->glossary_entbypage;
}
- print_header();
+ echo $OUTPUT->header();
require_course_login($course, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$strname = get_string('name');
$strtime = get_string('time');
- print_header("$strratings: $entry->concept");
+ $PAGE->set_title("$strratings: $entry->concept");
+ echo $OUTPUT->header();
if (!$ratings = glossary_get_ratings($entry->id, $sqlsort)) {
print_error('ratingno', 'glossary');
$strsearch = get_string("search");
$CFG->framename = "newwindow";
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity');
- $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
- print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, " ", " ");
+ $PAGE->navbar->add($strglossaries);
+ $PAGE->navbar->add($strsearch);
+ $PAGE->set_title(strip_tags("$course->shortname: $strglossaries $strsearch"));
+ $PAGE->set_heading($course->fullname);
+ echo $OUTPUT->header();
} else {
- print_header(); // Needs to be something here to allow linking back to the whole glossary
+ echo $OUTPUT->header(); // Needs to be something here to allow linking back to the whole glossary
}
if ($entries) {
require_login($course->id);
}
if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)) {
- print_header();
+ echo $OUTPUT->header();
notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id&tab=$tab", $glossary->id, $cm->id);
$strwaitingapproval = get_string('waitingapproval', 'glossary');
/// If we are in approval mode, prit special header
+ $PAGE->set_title(format_string($glossary->name));
+ $PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
if ($tab == GLOSSARY_APPROVAL_VIEW) {
require_capability('mod/glossary:approve', $context);
-
- $navigation = build_navigation($strwaitingapproval, $cm);
- print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
- update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
-
+ $PAGE->navbar->add($strwaitingapproval);
+ echo $OUTPUT->header();
echo $OUTPUT->heading($strwaitingapproval);
- } else { /// Print standard header
- $navigation = build_navigation('', $cm);
- print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
- update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
+ } else { /// Print standard header
+ echo $OUTPUT->header();
}
/// All this depends if whe have $showcommonelements