diff --git a/course/editsection.php b/course/editsection.php index 783461d0ac4..6e9b848a668 100644 --- a/course/editsection.php +++ b/course/editsection.php @@ -29,7 +29,7 @@ } add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section"); - + redirect("view.php?id=$course->id"); exit; } @@ -57,14 +57,14 @@ $strsummaryof = get_string('summaryof', '', " $sectionname $form->section"); } - print_header_simple($stredit, '', $stredit, 'theform.summary' ); + print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' ); print_heading($strsummaryof); print_simple_box_start('center'); include('editsection.html'); print_simple_box_end(); - if ($usehtmleditor) { + if ($usehtmleditor) { use_html_editor("summary"); } print_footer($course); diff --git a/course/enrol.php b/course/enrol.php index 6c077504e3e..1cc1f87e220 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -1,6 +1,6 @@ loginhttps)) { $wwwroot = str_replace('http:','https:', $wwwroot); } - // do not use require_login here because we are usually comming from it + // do not use require_login here because we are usually comming from it redirect($wwwroot.'/login/index.php'); } @@ -32,14 +32,14 @@ print_error('loginasnoenrol', '', $CFG->wwwroot.'/course/view.php?id='.$USER->loginascontext->instanceid); } - $enrol = enrolment_factory::factory($course->enrol); // do not use if (!$enrol... here, it can not work in PHP4 - see MDL-7529 + $enrol = enrolment_factory::factory($course->enrol); // do not use if (!$enrol... here, it can not work in PHP4 - see MDL-7529 /// Refreshing all current role assignments for the current user load_all_capabilities(); -/// Double check just in case they are actually enrolled already and -/// thus got to this script by mistake. This might occur if enrolments +/// Double check just in case they are actually enrolled already and +/// thus got to this script by mistake. This might occur if enrolments /// changed during this session or something if (has_capability('moodle/course:view', $context) and !has_capability('moodle/legacy:guest', $context, NULL, false)) { @@ -57,14 +57,14 @@ print_header_simple(); notice(get_string('coursenotaccessible'), "$CFG->wwwroot/index.php"); } - + /// Users can't enroll to site course if ($course->id == SITEID) { print_header_simple(); notice(get_string('enrollfirst'), "$CFG->wwwroot/index.php"); } -/// Double check just in case they are enrolled to start in the future +/// Double check just in case they are enrolled to start in the future if ($course->enrolperiod) { // Only active if the course has an enrolment period in effect if ($roles = get_user_roles($context, $USER->id)) { @@ -88,7 +88,7 @@ ($course->enrollable == 2 && $course->enrolstartdate > 0 && $course->enrolstartdate > time()) || ($course->enrollable == 2 && $course->enrolenddate > 0 && $course->enrolenddate <= time()) ) { - print_header($course->shortname, $course->fullname, $course->shortname ); + print_header($course->shortname, $course->fullname, build_navigation(array(array('name'=>$course->shortname,'link'=>'','type'=>'misc'))) ); notice(get_string('notenrollable'), "$CFG->wwwroot/index.php"); } diff --git a/course/import.php b/course/import.php index eef47dc4777..3c30c383238 100644 --- a/course/import.php +++ b/course/import.php @@ -31,9 +31,11 @@ } $strimport = get_string('import'); + $navlinks = array(); + $navlinks[] = array('name' => $strimport, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); - print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport, - ''.$course->shortname.' -> '.$strimport); + print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport, $navigation); $directories = get_list_of_plugins('course/import'); diff --git a/course/import/activities/index.php b/course/import/activities/index.php index 8364871af74..8b593cacd2d 100644 --- a/course/import/activities/index.php +++ b/course/import/activities/index.php @@ -3,7 +3,7 @@ require_once('../../../config.php'); require_once('../../lib.php'); require_once($CFG->dirroot.'/backup/restorelib.php'); - + $id = required_param('id', PARAM_INT); // course id to import TO $fromcourse = optional_param('fromcourse', 0, PARAM_INT); $fromcoursesearch = optional_param('fromcoursesearch', '', PARAM_RAW); @@ -16,7 +16,7 @@ error("That's an invalid course id"); } - if (!$site = get_site()){ + if (!$site = get_site()){ error("Couldn't get site course"); } @@ -45,7 +45,7 @@ $restore->restoreto = 1; $restore->course_id = $id; $restore->importing = 1; // magic variable so we know that we're importing rather than just restoring. - + $SESSION->restore = $restore; redirect($CFG->wwwroot.'/backup/restore.php?file='.$filename.'&id='.$fromcourse.'&to='.$id); } @@ -53,12 +53,19 @@ redirect($CFG->wwwroot.'/backup/backup.php?id='.$from->id.'&to='.$course->id); } } - - print_header("$course->shortname: $strimportactivities", $course->fullname, - "wwwroot/course/view.php?id=$course->id\">$course->shortname ". - "-> wwwroot/course/import.php?id=$course->id\">".get_string('import')." ". - "-> $strimportactivities"); + + $navlinks = array(); + $navlinks[] = array('name' => $course->shortname, + 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", + 'type' => 'misc'); + $navlinks[] = array('name' => get_string('import'), + 'link' => "$CFG->wwwroot/course/import.php?id=$course->id", + 'type' => 'misc'); + $navlinks[] = array('name' => $strimportactivities, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); + + print_header("$course->shortname: $strimportactivities", $course->fullname, $navigation); require_once('mod.php'); print_footer(); -?> \ No newline at end of file +?> diff --git a/course/import/groups/index.php b/course/import/groups/index.php index 831d1fe4d61..7dc75208cf5 100755 --- a/course/import/groups/index.php +++ b/course/import/groups/index.php @@ -1,21 +1,21 @@ -dirroot.'/course/lib.php'); require_once($CFG->dirroot.'/group/lib.php'); - + $id = required_param('id', PARAM_INT); // Course id - + if (! $course = get_record('course', 'id', $id) ) { error("That's an invalid course id"); } - + require_login($course->id); $context = get_context_instance(CONTEXT_COURSE, $id); - - + + if (!has_capability('moodle/course:managegroups', $context)) { error("You do not have the required permissions to manage groups."); } @@ -27,7 +27,7 @@ $strimportgroups = get_string("importgroups"); $csv_encode = '/\&\#44/'; - if (isset($CFG->CSV_DELIMITER)) { + if (isset($CFG->CSV_DELIMITER)) { $csv_delimiter = '\\' . $CFG->CSV_DELIMITER; $csv_delimiter2 = $CFG->CSV_DELIMITER; @@ -40,11 +40,17 @@ } /// Print the header + $navlinks = array(); + $navlinks[] = array('name' => $course->shortname, + 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", + 'type' => 'misc'); + $navlinks[] = array('name' => get_string('import'), + 'link' => "$CFG->wwwroot/course/import.php?id=$course->id", + 'type' => 'misc'); + $navlinks[] = array('name' => $strimportgroups, 'link' => null, 'type' => 'misc'); + $navigation = build_navigation($navlinks); - print_header("$course->shortname: $strimportgroups", $course->fullname, - "wwwroot/course/view.php?id=$course->id\">$course->shortname ". - "-> wwwroot/course/import.php?id=$course->id\">".get_string('import')." ". - "-> $strimportgroups"); + print_header("$course->shortname: $strimportgroups", $course->fullname, $navigation); /// If a file has been uploaded, then process it @@ -65,12 +71,12 @@ // make arrays of valid fields for error checking $required = array("groupname" => 1, ); $optionalDefaults = array("lang" => 1, ); - $optional = array("coursename" => 1, + $optional = array("coursename" => 1, "idnumber" =>1, "description" => 1, "enrolmentkey" => 1, "theme" => 1, - "picture" => 1, + "picture" => 1, "hidepicture" => 1, ); // --- get header (field names) --- @@ -78,8 +84,8 @@ // check for valid field names foreach ($header as $i => $h) { $h = trim($h); $header[$i] = $h; // remove whitespace - if ( !(isset($required[$h]) or - isset($optionalDefaults[$h]) or + if ( !(isset($required[$h]) or + isset($optionalDefaults[$h]) or isset($optional[$h])) ) { error(get_string('invalidfieldname', 'error', $h), 'index.php?id='.$id.'&sesskey='.$USER->sesskey); } @@ -96,7 +102,7 @@ $linenum = 2; // since header is line 1 while (!feof ($fp)) { - + $newgroup = new object();//to make Martin happy foreach ($optionalDefaults as $key => $value) { $newgroup->$key = current_language(); //defaults to current language @@ -117,7 +123,7 @@ if (isset($required[$name]) and !$value) { error(get_string('missingfield', 'error', $name). " ". get_string('erroronline', 'error', $linenum) .". ". - get_string('processingstops', 'error'), + get_string('processingstops', 'error'), 'uploaduser.php?sesskey='.$USER->sesskey); } else if ($name == "groupname") { @@ -129,7 +135,7 @@ } } ///Find the courseid of the course with the given shortname - + //if idnumber is set, we use that. //unset invalid courseid if (isset($newgroup->idnumber)){ @@ -137,23 +143,23 @@ notify(get_string('unknowncourseidnumber', 'error', $newgroup->idnumber)); unset($newgroup->courseid);//unset so 0 doesnt' get written to database } - $newgroup->courseid = $mycourse->id; + $newgroup->courseid = $mycourse->id; } //else use course short name to look up //unset invalid coursename (if no id) - + else if (isset($newgroup->coursename)){ if (!$mycourse = get_record('course', 'shortname',$newgroup->coursename)){ notify(get_string('unknowncourse', 'error', $newgroup->coursename)); unset($newgroup->courseid);//unset so 0 doesnt' get written to database } - $newgroup->courseid = $mycourse->id; + $newgroup->courseid = $mycourse->id; } //else juse use current id else{ $newgroup->courseid = $id; } - + //if courseid is set if (isset($newgroup->courseid)){ @@ -162,22 +168,22 @@ $linenum++; $groupname = $newgroup->name; $newgrpcoursecontext = get_context_instance(CONTEXT_COURSE, $newgroup->courseid); - + ///Users cannot upload groups in courses they cannot update. if (!has_capability('moodle/course:managegroups', $newgrpcoursecontext)){ notify(get_string('nopermissionforcreation','group',$groupname)); } else { if ( $groupid = groups_get_group_by_name($newgroup->courseid, $groupname) || !($newgroup->id = groups_create_group($newgroup)) ) { - + //Record not added - probably because group is already registered //In this case, output groupname from previous registration if ($groupid) { notify("$groupname :".get_string('groupexistforcourse', 'error', $groupname)); } else { notify(get_string('groupnotaddederror', 'error', $groupname)); - } - } + } + } else { notify(get_string('groupaddedsuccesfully', 'group', $groupname)); } diff --git a/course/importstudents.php b/course/importstudents.php index d182dde227d..845cd51a1bb 100644 --- a/course/importstudents.php +++ b/course/importstudents.php @@ -45,8 +45,7 @@ print_header("$course->shortname: $strassigncourses", $site->fullname, - "id\">$course->shortname -> $strassigncourses", - "searchtext"); + build_navigation(array(array('name' => $strassigncourses, 'link' => null, 'type' => 'misc'))), "searchtext"); /// Print a help notice about the need to use this page diff --git a/course/index.php b/course/index.php index 5ab89eb36b7..44ac487f933 100644 --- a/course/index.php +++ b/course/index.php @@ -15,7 +15,7 @@ $moveto = optional_param('moveto',-1,PARAM_INT); $moveup = optional_param('moveup',0,PARAM_INT); $movedown = optional_param('movedown',0,PARAM_INT); - + $context = get_context_instance(CONTEXT_SYSTEM, SITEID); if (!$site = get_site()) { @@ -71,17 +71,18 @@ if ($countcategories > 1 || ($countcategories == 1 && count_records('course') > 200)) { $strcourses = get_string('courses'); $strcategories = get_string('categories'); - print_header("$site->shortname: $strcategories", $strcourses, + print_header("$site->shortname: $strcategories", build_navigation(array(array('name'=>$strcourses,'link'=>'','type'=>'misc'))), $strcategories, '', '', true, update_categories_button()); print_heading($strcategories); print_box_start('categorybox'); - print_category_create_form(); + print_category_create_form(); print_whole_category_list(); print_box_end(); print_course_search(); } else { $strfulllistofcourses = get_string('fulllistofcourses'); - print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses, $strfulllistofcourses, + print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses, + build_navigation(array(array('name'=>$strfulllistofcourses, 'link'=>'','type'=>'misc'))), '', '', true, update_categories_button()); print_box_start('courseboxes'); print_category_create_form(); @@ -89,7 +90,7 @@ print_box_end(); } - /// I am not sure this context in the next has_capability call is correct. + /// I am not sure this context in the next has_capability call is correct. if (isloggedin() and !isguest() and !has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID)) and $CFG->enablecourserequests) { // Print link to request a new course print_single_button('request.php', NULL, get_string('courserequest'), 'get'); } @@ -108,24 +109,24 @@ /// From now on is all the admin/course creator functions /// Print headings - + if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) { require_once($CFG->libdir.'/adminlib.php'); - admin_externalpage_setup('coursemgmt'); + admin_externalpage_setup('coursemgmt'); admin_externalpage_print_header(); } else { - print_header("$site->shortname: $strcategories", $strcourses, - $strcategories, '', '', true, update_categories_button()); - } - + print_header("$site->shortname: $strcategories", build_navigation(array(array('name'=>$strcourses,'link'=>'','type'=>'misc'))), + $strcategories, '', '', true, update_categories_button()); + } + print_heading($strcategories); /// Delete a category if necessary if (!empty($delete) and confirm_sesskey()) { - + // context is coursecat, if not present admins should have it set in site level - $context = get_context_instance(CONTEXT_COURSECAT, $delete); + $context = get_context_instance(CONTEXT_COURSECAT, $delete); if ($deletecat = get_record('course_categories', 'id', $delete) and has_capability('moodle/category:delete', $context)) { if (!empty($sure) && $sure == md5($deletecat->timemodified)) { /// Send the children categories to live with their grandparent @@ -136,8 +137,8 @@ } } } - - /// If the grandparent is a valid (non-zero) category, then + + /// If the grandparent is a valid (non-zero) category, then /// send the children courses to live with their grandparent as well if ($deletecat->parent) { if ($childcourses = get_records('course', 'category', $deletecat->id)) { @@ -148,13 +149,13 @@ } } } - + /// Finally delete the category itself if (delete_records('course_categories', 'id', $deletecat->id)) { notify(get_string('categorydeleted', '', format_string($deletecat->name))); // MLD-9983 events_trigger('category_deleted', $deletecat); - } + } } else { $strdeletecategorycheck = get_string('deletecategorycheck','', format_string($deletecat->name)); @@ -162,7 +163,7 @@ "index.php?delete=$delete&sure=".md5($deletecat->timemodified)."&sesskey=$USER->sesskey", "index.php?sesskey=$USER->sesskey"); - print_footer(); + print_footer(); exit(); } } @@ -188,14 +189,14 @@ if (! set_field('course_categories', 'parent', $moveto, 'id', $tempcat->id)) { notify('Could not update that category!'); } else { - rebuild_context_rel(get_context_instance(CONTEXT_COURSECAT, $move)); - } + rebuild_context_rel(get_context_instance(CONTEXT_COURSECAT, $move)); + } } } } -/// Hide or show a category +/// Hide or show a category if ((!empty($hide) or !empty($show)) and confirm_sesskey()) { if (!empty($hide)) { $tempcat = get_record('course_categories', 'id', $hide); @@ -218,7 +219,7 @@ /// Move a category up or down if ((!empty($moveup) or !empty($movedown)) and confirm_sesskey()) { - + $swapcategory = NULL; $movecategory = NULL; @@ -283,11 +284,11 @@ } } } - + fix_course_sortorder(); /// Print form for creating new categories - + if (has_capability('moodle/category:create', get_context_instance(CONTEXT_SYSTEM))) { $mform->display(); } @@ -323,7 +324,7 @@ $options['category'] = $category->id; print_single_button('edit.php', $options, get_string('addnewcourse'), 'get'); } - + if (has_capability('moodle/site:approvecourse', get_context_instance(CONTEXT_SYSTEM, SITEID)) and !empty($CFG->enablecourserequests)) { print_single_button('pending.php',NULL, get_string('coursespending'), 'get'); } @@ -341,7 +342,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $ global $CFG, $USER; static $str = ''; - + if (empty($str)) { $str->delete = get_string('delete'); $str->moveup = get_string('moveup'); @@ -350,11 +351,11 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $ $str->hide = get_string('hide'); $str->show = get_string('show'); } - + if ($category) { $context = get_context_instance(CONTEXT_COURSECAT, $category->id); - + echo '
';
}
-
+
if (has_capability('moodle/category:visibility', $context)) {
if (!empty($category->visible)) {
echo '
' : ''),
format_string($course->shortname),format_string($course->fullname),fullname($requester),
format_string($course->summary),format_string($course->reason),
diff --git a/course/recent.php b/course/recent.php
index af2f60f1aed..b909b0af650 100644
--- a/course/recent.php
+++ b/course/recent.php
@@ -28,7 +28,7 @@
$meta = ''; // prevent duplicate content in search engines MDL-7299
$loggedinas = user_login_string($course, $USER);
-
+ $navlinks = array();
if (!empty($chooserecent)) {
$userinfo = get_string("allparticipants");
@@ -43,14 +43,10 @@
if ($date)
$dateinfo = userdate($date, get_string("strftimedaydate"));
- if ($course->id != SITEID) {
- print_header("$course->shortname: $strrecentactivity", $course->fullname,
- "id\">$course->shortname ->
- id\">$strrecentactivity -> $userinfo, $dateinfo", "", $meta);
- } else {
- print_header("$course->shortname: $strrecentactivity", $course->fullname,
- "id\">$strrecentactivity -> $userinfo, $dateinfo", "", $meta);
- }
+ $navlinks[] = array('name' => $strrecentactivity, 'link' => "recent.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => "$userinfo, $dateinfo", 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, "", $meta);
print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")", '', 3);
$advancedfilter = 1;
@@ -67,14 +63,9 @@
}
}
}
-
- if ($course->id != SITEID) {
- print_header("$course->shortname: $strrecentactivity", $course->fullname,
- "id\">$course->shortname -> $strrecentactivity", "", $meta);
- } else {
- print_header("$course->shortname: $strrecentactivity", $course->fullname,
- "$strrecentactivity", "", $meta);
- }
+ $navlinks[] = array('name' => $strrecentactivity, 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, "", $meta);
print_heading(get_string("activitysince", "", userdate($date)));
diff --git a/course/report.php b/course/report.php
index 5954b3f597a..515e0bb5d4d 100644
--- a/course/report.php
+++ b/course/report.php
@@ -15,8 +15,10 @@
$strreports = get_string('reports');
- print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports,
- ''.$course->shortname.' -> '.$strreports);
+ $navlinks = array();
+ $navlinks[] = array('name' => $strreports, 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports, $navigation);
$directories = get_list_of_plugins('course/report');
@@ -29,6 +31,6 @@
echo '';
}
}
-
+
print_footer();
?>
diff --git a/course/report/log/index.php b/course/report/log/index.php
index a2dcc54f294..96bb6e5d6c3 100644
--- a/course/report/log/index.php
+++ b/course/report/log/index.php
@@ -7,9 +7,9 @@
require_once($CFG->libdir.'/adminlib.php');
$id = optional_param('id', 0, PARAM_INT);// Course ID
-
+
$host_course = optional_param('host_course', '', PARAM_PATH);// Course ID
-
+
if (empty($host_course)) {
$hostid = $CFG->mnet_localhost_id;
if (empty($id)) {
@@ -19,7 +19,7 @@
} else {
list($hostid, $id) = explode('/', $host_course);
}
-
+
$group = optional_param('group', -1, PARAM_INT); // Group to display
$user = optional_param('user', 0, PARAM_INT); // User to display
$date = optional_param('date', 0, PARAM_FILE); // Date to display - number or some string
@@ -27,7 +27,7 @@
$modid = optional_param('modid', 0, PARAM_FILE); // number or 'site_errors'
$modaction = optional_param('modaction', '', PARAM_PATH); // an action as recorded in the logs
$page = optional_param('page', '0', PARAM_INT); // which page to show
- $perpage = optional_param('perpage', '100', PARAM_INT); // how many per page
+ $perpage = optional_param('perpage', '100', PARAM_INT); // how many per page
$showcourses = optional_param('showcourses', 0, PARAM_INT); // whether to show courses if we're over our limit.
$showusers = optional_param('showusers', 0, PARAM_INT); // whether to show users if we're over our limit.
$chooselog = optional_param('chooselog', 0, PARAM_INT);
@@ -50,7 +50,7 @@
require_capability('moodle/site:viewreports', $context);
- add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id);
+ add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id);
$strlogs = get_string('logs');
$stradministration = get_string('administration');
@@ -58,6 +58,8 @@
session_write_close();
+ $navlinks = array();
+
if (!empty($chooselog)) {
$userinfo = get_string('allparticipants');
$dateinfo = get_string('alldays');
@@ -79,18 +81,19 @@
admin_externalpage_print_header();
} else {
- print_header($course->shortname .': '. $strlogs, $course->fullname,
- "wwwroot/course/view.php?id=$course->id\">$course->shortname ->
- wwwroot/course/report.php?id=$course->id\">$strreports ->
- id\">$strlogs -> $userinfo, $dateinfo", '');
+ $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => $strlogs, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => "$userinfo, $dateinfo", 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation '');
}
print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")");
print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
-
+
if($hostid == $CFG->mnet_localhost_id) {
- print_log($course, $user, $date, 'l.time DESC', $page, $perpage,
- "index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group",
+ print_log($course, $user, $date, 'l.time DESC', $page, $perpage,
+ "index.php?id=$course->id&chooselog=1&user=$user&date=$date&modid=$modid&modaction=$modaction&group=$group",
$modname, $modid, $modaction, $group);
} else {
print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
@@ -125,10 +128,10 @@
admin_externalpage_setup('reportlog');
admin_externalpage_print_header();
} else {
- print_header($course->shortname .': '. $strlogs, $course->fullname,
- "wwwroot/course/view.php?id=$course->id\">$course->shortname ->
- wwwroot/course/report.php?id=$course->id\">$strreports ->
- $strlogs", '');
+ $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
}
print_heading(get_string('chooselogs') .':');
diff --git a/course/report/outline/index.php b/course/report/outline/index.php
index 99c5461bd5b..784d589fcc3 100644
--- a/course/report/outline/index.php
+++ b/course/report/outline/index.php
@@ -19,7 +19,7 @@
require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $course->id));
- add_to_log($course->id, "course", "report outline", "report/outline/index.php?id=$course->id", $course->id);
+ add_to_log($course->id, "course", "report outline", "report/outline/index.php?id=$course->id", $course->id);
$stractivityreport = get_string("activityreport");
$strparticipants = get_string("participants");
@@ -29,10 +29,12 @@
$strtodaylogs = get_string("todaylogs");
$strreports = get_string("reports");
- print_header("$course->shortname: $stractivityreport", $course->fullname,
- "id\">$course->shortname ->
- id\">$strreports ->
- $stractivityreport");
+ $navlinks = array();
+ $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+
+ print_header("$course->shortname: $stractivityreport", $course->fullname, $navigation);
print_heading(format_string($course->fullname));
diff --git a/course/report/participation/index.php b/course/report/participation/index.php
index 9baf30c0fe9..cf4339d890c 100644
--- a/course/report/participation/index.php
+++ b/course/report/participation/index.php
@@ -2,10 +2,10 @@
require_once('../../../config.php');
require_once($CFG->libdir.'/statslib.php');
-
+
define('DEFAULT_PAGE_SIZE', 20);
define('SHOW_ALL_PAGE_SIZE', 5000);
-
+
$id = required_param('id', PARAM_INT); // course id.
$moduleid = optional_param('moduleid', 0, PARAM_INT); // module id.
$oldmod = optional_param('oldmod', 0, PARAM_INT);
@@ -16,7 +16,7 @@
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page
- if ($action != 'view' && $action != 'post') {
+ if ($action != 'view' && $action != 'post') {
$action = ''; // default to all (don't restrict)
}
@@ -35,14 +35,14 @@
require_login($course->id);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
-
+
if (!has_capability('moodle/site:viewreports', $context)) {
print_error('mustbeteacher', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
-
- add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id);
-
+
+ add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id);
+
$strparticipation = get_string('participationreport');
$strviews = get_string('views');
$strposts = get_string('posts');
@@ -51,15 +51,11 @@
$strallactions = get_string('allactions');
$strreports = get_string('reports');
- $strnav = "id\">" . format_string($course->shortname) . " ->
- id\">$strreports -> ". $strparticipation;
-
- print_header("$course->shortname: $strparticipation", $course->fullname,
- "id\">$course->shortname ->
- id\">$strreports ->
- $strparticipation");
-
-// print_header($course->fullname.' '.$strparticipation,$strparticipation,$strnav);
+ $navlinks = array();
+ $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
+ $navlinks[] = array('name' => $strparticipation, 'link' => null, 'type' => 'misc');
+ $navigation = build_navigation($navlinks);
+ print_header("$course->shortname: $strparticipation", $course->fullname, $navigation);
$allowedmodules = array('assignment','book','chat','choice','exercise','forum','glossary','hotpot',
'journal','lesson','questionnaire','quiz','resource','scorm',
@@ -96,7 +92,7 @@
$timeoptions[strtotime('-'.$i.' weeks',$now)] = get_string('numweeks','moodle',$i);
}
}
- // months
+ // months
for ($i = 2; $i < 12; $i++) {
if (strtotime('-'.$i.' months',$now) >= $minlog) {
$timeoptions[strtotime('-'.$i.' months',$now)] = get_string('nummonths','moodle',$i);
@@ -121,8 +117,8 @@
'view' => $strview,
'post' => $strpost,
);
-
-
+
+
// print first controls.
echo '\n";
-
+
if (!empty($instanceid) && !empty($roleid)) {
if (!$cm = get_coursemodule_from_instance($module->name,$instanceid,$course->id)) {
print_error('cmunknown');
@@ -211,7 +207,7 @@
$table->set_attribute('class', 'generaltable generalbox reporttable');
$table->sortable(true,'lastname','ASC');
-
+
$table->set_control_variables(array(
TABLE_VAR_SORT => 'ssort',
TABLE_VAR_HIDE => 'shide',
@@ -221,7 +217,7 @@
TABLE_VAR_PAGE => 'spage'
));
$table->setup();
-
+
$primary_roles = sql_primary_role_subselect(); // In dmllib.php
$sql = 'SELECT DISTINCT prs.userid, u.firstname,u.lastname,u.idnumber,count(l.action) as count FROM ('.$primary_roles.') prs'
@@ -237,14 +233,14 @@
break;
default:
// some modules have stuff we want to hide, ie mail blocked etc so do actually need to limit here.
- $sql .= ' AND action IN (\''.implode('\',\'',array_merge($viewnames,$postnames)).'\' )';
+ $sql .= ' AND action IN (\''.implode('\',\'',array_merge($viewnames,$postnames)).'\' )';
}
-
+
$sql .= ' WHERE prs.courseid = '.$course->id.' AND prs.primary_roleid = '.$roleid.' AND prs.contextlevel = '.CONTEXT_COURSE.' AND prs.courseid = '.$course->id;
-
+
if ($table->get_sql_where()) {
- $sql .= ' AND '.$table->get_sql_where(); //initial bar
+ $sql .= ' AND '.$table->get_sql_where(); //initial bar
}
$sql .= ' GROUP BY prs.userid,u.firstname,u.lastname,u.idnumber,l.userid';
@@ -254,9 +250,9 @@
}
$countsql = 'SELECT COUNT(DISTINCT(prs.userid)) FROM ('.$primary_roles.') prs '
- .' JOIN '.$CFG->prefix.'user u ON u.id = prs.userid WHERE prs.courseid = '.$course->id
+ .' JOIN '.$CFG->prefix.'user u ON u.id = prs.userid WHERE prs.courseid = '.$course->id
.' AND prs.primary_roleid = '.$roleid.' AND prs.contextlevel = '.CONTEXT_COURSE;
-
+
$totalcount = count_records_sql($countsql);
if ($table->get_sql_where()) {
@@ -264,11 +260,11 @@
} else {
$matchcount = $totalcount;
}
-
+
echo ''.$modulename . ' ' . $strviews.': '.implode(', ',$viewnames).'
'."\n"
. $modulename . ' ' . $strposts.': '.implode(', ',$postnames).'