From 3b27b0fe21d41918d83e8f5e4fdfe6a720ed89ef Mon Sep 17 00:00:00 2001 From: mattc-catalyst Date: Thu, 5 Jul 2007 04:40:48 +0000 Subject: [PATCH] MDL-9615: Correct incorrect use of term breadcrumbs - $crumbs -> $navlinks Author: Matt Clarkson --- admin/settings/appearance.php | 2 +- course/mod.php | 6 +-- course/modedit.php | 12 ++--- grade/report.php | 6 +-- grade/report/grader/preferences.php | 8 +-- lang/en_utf8/admin.php | 6 +-- lib/moodlelib.php | 30 +++++------ lib/pagelib.php | 28 +++++------ lib/weblib.php | 4 +- mod/assignment/index.php | 6 +-- mod/assignment/lib.php | 8 +-- mod/chat/index.php | 4 +- mod/chat/report.php | 25 ++++------ mod/choice/index.php | 4 +- mod/choice/report.php | 16 ++++-- mod/choice/view.php | 18 ++++--- mod/data/edit.php | 22 ++++---- mod/data/field/latlong/kml.php | 6 +-- mod/data/import.php | 13 ++--- mod/data/index.php | 6 +-- mod/data/lib.php | 6 +-- mod/data/pagelib.php | 4 +- mod/data/templates.php | 13 ++--- mod/data/view.php | 21 ++++---- mod/exercise/assessments.php | 8 +-- mod/exercise/index.php | 4 +- mod/exercise/submissions.php | 8 +-- mod/exercise/upload.php | 8 +-- mod/exercise/view.php | 15 ++---- mod/forum/discuss.php | 8 +-- mod/forum/index.php | 6 +-- mod/forum/markposts.php | 6 +-- mod/forum/post.php | 45 ++++++++++------- mod/forum/search.php | 12 ++--- mod/forum/settracking.php | 6 +-- mod/forum/subscribe.php | 6 +-- mod/forum/subscribers.php | 15 +++--- mod/forum/user.php | 10 ++-- mod/forum/view.php | 50 ++----------------- mod/glossary/comment.php | 10 ++-- mod/glossary/comments.php | 8 +-- mod/glossary/deleteentry.php | 6 +-- mod/glossary/edit.php | 8 +-- mod/glossary/editcategories.php | 8 +-- mod/glossary/export.php | 6 +-- mod/glossary/exportentry.php | 6 +-- mod/glossary/formats.php | 12 ++--- mod/glossary/import.php | 8 +-- mod/glossary/index.php | 4 +- mod/glossary/showentry.php | 6 +-- mod/glossary/view.php | 10 ++-- mod/hotpot/index.php | 4 +- mod/hotpot/report.php | 16 +++--- mod/hotpot/review.php | 6 +-- mod/hotpot/view.php | 6 +-- mod/journal/edit.php | 8 +-- mod/journal/index.php | 4 +- mod/journal/report.php | 15 +++--- mod/journal/view.php | 6 +-- mod/lesson/import.php | 8 +-- mod/lesson/importppt.php | 8 +-- mod/lesson/index.php | 4 +- mod/lesson/locallib.php | 6 +-- mod/lesson/pagelib.php | 12 ++--- mod/quiz/attempt.php | 8 +-- mod/quiz/edit.php | 16 +++--- mod/quiz/index.php | 4 +- mod/quiz/report/default.php | 6 +-- mod/quiz/review.php | 8 +-- mod/resource/index.php | 4 +- mod/resource/lib.php | 10 ++-- .../type/directory/resource.class.php | 10 ++-- mod/resource/type/html/resource.class.php | 8 +-- mod/resource/type/ims/deploy.php | 6 +-- mod/resource/type/ims/resource.class.php | 8 +-- mod/resource/type/text/resource.class.php | 4 +- mod/scorm/index.php | 4 +- mod/scorm/player.php | 10 ++-- mod/scorm/report.php | 20 ++++---- mod/scorm/view.php | 6 +-- mod/survey/index.php | 4 +- mod/survey/report.php | 8 +-- mod/survey/save.php | 8 +-- mod/survey/view.php | 6 +-- mod/wiki/admin.php | 8 +-- mod/wiki/index.php | 4 +- mod/wiki/view.php | 6 +-- mod/workshop/assess.php | 8 +-- mod/workshop/assessments.php | 8 +-- mod/workshop/index.php | 4 +- mod/workshop/submissions.php | 8 +-- mod/workshop/upload.php | 8 +-- mod/workshop/view.php | 38 +++----------- mod/workshop/viewassessment.php | 8 +-- question/category.php | 16 +++--- question/edit.php | 16 +++--- question/export.php | 16 +++--- question/import.php | 16 +++--- question/question.php | 20 ++++---- 99 files changed, 471 insertions(+), 547 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 2764c972d3..7ae0d5ffc7 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -11,7 +11,7 @@ $temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('all $temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('showblocksonmodpages', get_string('showblocksonmodpages', 'admin'), get_string('configshowblocksonmodpages', 'admin'), 0)); -$temp->add(new admin_setting_configselect('hideactivitytypecrumb', get_string('hideactivitytypecrumb', 'admin'), get_string('confighideactivitytypecrumb', 'admin'), 0, +$temp->add(new admin_setting_configselect('hideactivitytypenavlink', get_string('hideactivitytypenavlink', 'admin'), get_string('confighideactivitytypenavlink', 'admin'), 0, array( 0 => get_string('hidefromnone', 'admin'), 1 => get_string('hidefromstudents', 'admin'), diff --git a/course/mod.php b/course/mod.php index 5e33df4913..76ee94afcc 100644 --- a/course/mod.php +++ b/course/mod.php @@ -672,9 +672,9 @@ $focuscursor = "form.name"; } - $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => $streditinga, 'link' => '', 'type' => 'action'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $streditinga, 'link' => '', 'type' => 'action'); + $navigation = build_navigation($navlinks); print_header_simple($streditinga, '', $navigation, $focuscursor, "", false); diff --git a/course/modedit.php b/course/modedit.php index ed9d7f6e24..bcef6aa9ee 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -111,7 +111,7 @@ $pageheading = get_string("updatinga", "moodle", $fullmodulename); } - $crumbsinstancename = array('name' => format_string($form->name,true), 'link' => "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinksinstancename = array('name' => format_string($form->name,true), 'link' => "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id", 'type' => 'activityinstance'); $CFG->pagepath = 'mod/'.$module->name; if (!empty($type)) { @@ -299,13 +299,13 @@ $streditinga = get_string("editinga", "moodle", $fullmodulename); $strmodulenameplural = get_string("modulenameplural", $module->name); - $crumbs[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity'); - if (isset($crumbsinstancename)) { - $crumbs[] = $crumbsinstancename; + $navlinks[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity'); + if (isset($navlinksinstancename)) { + $navlinks[] = $navlinksinstancename; } - $crumbs[] = array('name' => $streditinga, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $streditinga, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple($streditinga, '', $navigation, $mform->focus(), "", false); diff --git a/grade/report.php b/grade/report.php index 35bded2056..20e60f9be8 100644 --- a/grade/report.php +++ b/grade/report.php @@ -82,10 +82,10 @@ $strgrades = get_string('grades'); - $crumbs[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc'); - $crumbs[] = array('name' => $reportnames[$report], 'link' => '', 'type' => 'misc'); + $navlinks[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc'); + $navlinks[] = array('name' => $reportnames[$report], 'link' => '', 'type' => 'misc'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); // build buttons here /// setting up editting mode diff --git a/grade/report/grader/preferences.php b/grade/report/grader/preferences.php index 8d0b458021..7e3117bc2a 100644 --- a/grade/report/grader/preferences.php +++ b/grade/report/grader/preferences.php @@ -59,12 +59,12 @@ $strgrades = get_string('grades'); $strgraderreport = get_string('graderreport', 'grades'); $strgradepreferences = get_string('gradepreferences', 'grades'); -$crumbs[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc'); -$crumbs[] = array('name' => $strgraderreport, +$navlinks[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc'); +$navlinks[] = array('name' => $strgraderreport, 'link' => $CFG->wwwroot . '/grade/report.php?id=' . $courseid . '&report=grader', 'type' => 'misc'); -$crumbs[] = array('name' => $strgradepreferences, 'link' => '', 'type' => 'misc'); +$navlinks[] = array('name' => $strgradepreferences, 'link' => '', 'type' => 'misc'); -$navigation = build_navigation($crumbs); +$navigation = build_navigation($navlinks); print_header_simple($strgrades.': '.$strgraderreport . ': ' . $strgradepreferences,': '.$strgradepreferences, $navigation, '', '', true, '', navmenu($course)); diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index ec45342206..2c8685523f 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -111,7 +111,7 @@ $string['configgradebookroles'] = 'This setting allows you to control who appear $string['configgradeexport'] = 'Choose which gradebook export formats are your primary methods for exporting grades. Chosen plugins will then set and use a \"last exported\" field for every grade. For example, this might result in exported records being identified as being \"new\" or \"updated\". If you are not sure about this then leave everything unchecked.'; $string['configguestroleid'] = 'This role is automatically assigned to the guest user. It is also temporarily assigned to not enrolled users when they enter course that allows guests without password. Please verify that the role has moodle/legacy:guest and moodle/course:view capability.'; $string['confighiddenuserfields'] = 'Select which user infomation fields you wish to hide from other users other than course teachers/admins. This will increase student privacy. Hold CTRL key to select multiple fields.'; -$string['confighideactivitytypecrumb'] = 'Select from whom to hide the activity type (e.g. Quizzes) crumb in the breadcrumb trail displayed for activity modules.'; +$string['confighideactivitytypenavlink'] = 'Select from whom to hide the activity type (e.g. Quizzes) link in the navigation displayed for activity modules.'; $string['confightmleditor'] = 'Choose whether or not to allow use of the embedded HTML text editor. Even if you choose allow, this editor will only appear when the user is using a compatible web browser. Users can also choose not to use it.'; $string['configidnumber'] = 'This option specifies whether (a) Users are not be asked for an ID number at all, (b) Users are asked for an ID number but can leave it blank or (c) Users are asked for an ID Number and cannot leave it blank. If given the User\'s ID number is displayed in their Profile.'; $string['configintcachemax'] = 'For internal cache only. Maximum number of records to keep in the cache. Recommended value: 50. Use lower values to reduce memory usage.'; @@ -142,7 +142,7 @@ $string['configminpasswordlength'] = 'Passwords must be at least these many char $string['configminpasswordlower'] = 'Passwords must have at least these many lower case letters.'; $string['configminpasswordnonalphanum'] = 'Passwords must have at least these many non-alphanumeric characters.'; $string['configminpasswordupper'] = 'Passwords must have at least these many upper case letters.'; -$string['configmymoodleredirect'] = 'This setting forces redirects to /my on login for non-admins and replaces the top level site breadcrumb with /my'; +$string['configmymoodleredirect'] = 'This setting forces redirects to /my on login for non-admins and replaces the top level site navigation with /my'; $string['confignodefaultuserrolelists'] = 'This setting prevents all users from being returned from the database from deprecated calls of get_course_user, etc., for the site course if the default role provides that access. Check this, if you suffer a performance hit.'; $string['confignonmetacoursesyncroleids'] = 'By default all enrolments from child courses are synchronised to metacourses. Roles that are selected here will not be included in the synchronisation process.'; $string['confignoreplyaddress'] = 'Emails are sometimes sent out on behalf of a user (eg forum posts). The email address you specify here will be used as the \"From\" address in those cases when the recipients should not be able to reply directly to the user (eg when a user chooses to keep their address private).'; @@ -330,7 +330,7 @@ $string['helpupcominglookahead'] = 'How many days in the future does the calenda $string['helpupcomingmaxevents'] = 'How many (maximum) upcoming events are shown to users by default?'; $string['helpweekenddays'] = 'Which days of the week are treated as \"weekend\" and shown with a different colour?'; $string['hiddenuserfields'] = 'Hide user fields'; -$string['hideactivitytypecrumb'] = 'Hide activity type crumb'; +$string['hideactivitytypenavlink'] = 'Hide activity type navigation'; $string['hidefromall'] = 'Hide from all users'; $string['hidefromnone'] = 'Hide from nobody'; $string['hidefromstudents'] = 'Hide from students'; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 90c00a7363..602c5847ba 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7019,51 +7019,51 @@ function setup_lang_from_browser() { * and others * @uses $CFG * @uses $THEME - * @param $extrabreadcrumbs - array of associative arrays, keys: name, link, type + * @param $extranavlinks - array of associative arrays, keys: name, link, type * @return $navigation as an object so it can be differentiated from old style * navigation strings. */ -function build_navigation($extrabreadcrumbs) { +function build_navigation($extranavlinks) { global $CFG, $COURSE; $navigation = ''; //Site name if ($site = get_site()) { - $breadcrumbs[] = array('name' => format_string($site->shortname), 'link' => "$CFG->wwwroot/", 'type' => 'home'); + $navlinks[] = array('name' => format_string($site->shortname), 'link' => "$CFG->wwwroot/", 'type' => 'home'); } if ($COURSE) { if ($COURSE->id != SITEID) { //Course - $breadcrumbs[] = array('name' => format_string($COURSE->shortname), 'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",'type' => 'course'); + $navlinks[] = array('name' => format_string($COURSE->shortname), 'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",'type' => 'course'); } } - //Merge in extra bread crumbs - $breadcrumbs = array_merge($breadcrumbs, $extrabreadcrumbs); + //Merge in extra navigation links + $navlinks = array_merge($navlinks, $extranavlinks); - //Construct an unordered list from $breadcrumbs + //Construct an unordered list from $navlinks //Accessibility: heading hidden from visual browsers by default. $navigation = '

'.get_string('youarehere','access')."

"; - return(array('newnav' => true, 'breadcrumbs' => $navigation)); + return(array('newnav' => true, 'navlinks' => $navigation)); } function is_newnav($navigation) { diff --git a/lib/pagelib.php b/lib/pagelib.php index 076639822b..9a8a29412c 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -181,7 +181,7 @@ class page_base { // HTML OUTPUT SECTION // We have absolutely no idea what derived pages are all about - function print_header($title, $morebreadcrumbs) { + function print_header($title, $morenavlinks) { trigger_error('Page class does not implement method print_header()', E_USER_WARNING); return; } @@ -386,7 +386,7 @@ class page_course extends page_base { // This function prints out the common part of the page's header. // You should NEVER print the header "by hand" in other code. - function print_header($title, $morebreadcrumbs=NULL, $meta='', $bodytags='') { + function print_header($title, $morenavlinks=NULL, $meta='', $bodytags='') { global $USER, $CFG; $this->init_full(); @@ -397,18 +397,18 @@ class page_course extends page_base { $title = str_replace($search, $replace, $title); } - $crumbs = array(); + $navlinks = array(); - if(!empty($morebreadcrumbs)) { - $crumbs = array_merge($crumbs, $morebreadcrumbs); + if(!empty($morenavlinks)) { + $navlinks = array_merge($navlinks, $morenavlinks); } - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); // The "Editing On" button will be appearing only in the "main" course screen // (i.e., no breadcrumbs other than the default one added inside this function) $buttons = switchroles_form($this->courserecord->id) . update_course_icon($this->courserecord->id ); - $buttons = empty($morebreadcrumbs) ? $buttons : ' '; + $buttons = empty($morenavlinks) ? $buttons : ' '; print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, user_login_string($this->courserecord, $USER), false, $bodytags); @@ -611,7 +611,7 @@ class page_generic_activity extends page_base { return BLOCK_POS_LEFT; } - function print_header($title, $morebreadcrumbs = NULL, $bodytags = '', $meta = '') { + function print_header($title, $morenavlinks = NULL, $bodytags = '', $meta = '') { global $USER, $CFG; $this->init_full(); @@ -623,14 +623,14 @@ class page_generic_activity extends page_base { } - $crumbs[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance'); + $navlinks[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance'); - if (!empty($morebreadcrumbs)) { - $breadcrumbs = array_merge($crumbs, $morebreadcrumbs); + if (!empty($morenavlinks)) { + $navlinks = array_merge($navlinks, $morenavlinks); } - if (empty($morebreadcrumbs) && $this->user_allowed_editing()) { + if (empty($morenavlinks) && $this->user_allowed_editing()) { $buttons = ''; if (!empty($CFG->showblocksonmodpages)) { $buttons .= '
'.update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', $this->activityname)).'
'. @@ -643,7 +643,7 @@ class page_generic_activity extends page_base { $buttons = ' '; } - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags); } diff --git a/lib/weblib.php b/lib/weblib.php index 609744076e..6bb1835bdc 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3242,9 +3242,9 @@ function print_navigation ($navigation, $separator=0, $return=false) { if (is_newnav($navigation)) { if ($return) { - return($navigation['breadcrumbs']); + return($navigation['navlinks']); } else { - echo $navigation['breadcrumbs']; + echo $navigation['navlinks']; return; } } else { diff --git a/mod/assignment/index.php b/mod/assignment/index.php index a133017f31..c5b21aa628 100644 --- a/mod/assignment/index.php +++ b/mod/assignment/index.php @@ -22,8 +22,8 @@ $strsubmitted = get_string("submitted", "assignment"); $strgrade = get_string("grade"); - $crumbs[] = array('name' => $strassignments, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strassignments, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple($strassignments, "", $navigation, "", "", true, "", navmenu($course)); @@ -45,7 +45,7 @@ $table->align = array ("left", "left", "left", "right"); } - $currentgroup = get_current_group($course->id); + $currentgroup = get_and_set_current_group($course, groupmode($course)); if ($currentgroup and has_capability('moodle/site:accessallgroups', get_context_instance(CONTEXT_COURSE, $id))) { $group = groups_get_group($currentgroup, false); $groupname = " ($group->name)"; diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index d9f99021a4..90ff4f6ca6 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -959,10 +959,10 @@ class assignment_base { add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->assignment->id, $this->assignment->id, $this->cm->id); - $crumbs[] = array('name' => $this->strassignments, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($this->assignment->name,true), 'link' => "view.php?a={$this->assignment->id}", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $this->strsubmissions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $this->strassignments, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($this->assignment->name,true), 'link' => "view.php?a={$this->assignment->id}", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $this->strsubmissions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($this->assignment->name,true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm)); diff --git a/mod/chat/index.php b/mod/chat/index.php index bb720ce0d3..20d3d45f15 100644 --- a/mod/chat/index.php +++ b/mod/chat/index.php @@ -22,8 +22,8 @@ /// Print the header - $crumbs[] = array('name' => $strchats, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strchats, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple($strchats, '', $navigation, '', '', true, '', navmenu($course)); diff --git a/mod/chat/report.php b/mod/chat/report.php index 4813a20ed9..e45ef97f88 100644 --- a/mod/chat/report.php +++ b/mod/chat/report.php @@ -39,23 +39,20 @@ if ($start and $end and !$confirmdelete) { // Show a full transcript - $crumbs[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strchatreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); + $navlinks[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strchatreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation, '', '', true, '', navmenu($course, $cm)); /// Check to see if groups are being used here - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id"); - } else { - $currentgroup = false; - } + $groupmode = groupmode($course, $cm); + $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id"); - if (!empty($currentgroup)) { + if ($currentgroup) { $groupselect = " AND groupid = '$currentgroup'"; } else { $groupselect = ""; @@ -95,11 +92,11 @@ /// Print the Sessions display - $crumbs[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strchatreport, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strchatreport, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation, '', '', true, '', navmenu($course, $cm)); diff --git a/mod/choice/index.php b/mod/choice/index.php index 1db9e4737e..46c93c5555 100644 --- a/mod/choice/index.php +++ b/mod/choice/index.php @@ -15,8 +15,8 @@ $strchoice = get_string("modulename", "choice"); $strchoices = get_string("modulenameplural", "choice"); - $crumbs[] = array('name' => $strchoices, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strchoices, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strchoices", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/choice/report.php b/mod/choice/report.php index 285bc3d92f..9d1654983f 100644 --- a/mod/choice/report.php +++ b/mod/choice/report.php @@ -38,16 +38,22 @@ redirect("report.php?id=$cm->id"); } - if ($download <> "xls" and $download <> "txt" and $download <> "ods") { + if (!$download) { - $crumbs[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($choice->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strresponses, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($choice->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strresponses, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($choice->name).": $strresponses", "", $navigation, "", '', true, update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm)); + /// Check to see if groups are being used in this choice + $groupmode = groupmode($course, $cm); + setup_and_print_groups($course, $groupmode, 'report.php?id='.$id); + } else { + $groupmode = groupmode($course, $cm); + get_and_set_current_group($course, $groupmode); } $users = get_users_by_capability($context, 'mod/choice:choose', 'u.id, u.picture, u.firstname, u.lastname, u.idnumber', 'u.firstname ASC'); diff --git a/mod/choice/view.php b/mod/choice/view.php index ba734978b9..9d47fe8977 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -58,22 +58,26 @@ if ($action == 'delchoice') { /// Display the choice and possibly results - $crumbs[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($choice->name), 'link' => '', 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($choice->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($choice->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm)); add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id); - + + /// Check to see if groups are being used in this choice + $groupmode = groupmode($course, $cm); + setup_and_print_groups($course, $groupmode, 'view.php?id='.$id); + if (has_capability('mod/choice:readresponses', $context)) { - choice_show_reportlink($choice, $course->id, $cm->id); - } else if (!$cm->visible) { - notice(get_string("activityiscurrentlyhidden")); + choice_show_reportlink($choice, $course->id, $cm->id, $groupmode); } + echo '
'; + if ($choice->text) { print_box(format_text($choice->text, $choice->format), 'generalbox', 'intro'); } diff --git a/mod/data/edit.php b/mod/data/edit.php index 194ec8acd9..1dec9c9553 100755 --- a/mod/data/edit.php +++ b/mod/data/edit.php @@ -69,9 +69,9 @@ $strdatabases = get_string("modulenameplural", "data"); $navigation = "id\">$strdatabases ->"; - $crumbs[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm)); notice(get_string("activityiscurrentlyhidden")); @@ -113,23 +113,19 @@ /// Print the page header $strdata = get_string('modulenameplural','data'); - $crumbs[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple($data->name, '', $navigation, '', $meta, true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')), navmenu($course, $cm), '', ''); - print_heading(format_string($data->name)); - /// Check to see if groups are being used here + $groupmode = groupmode($course, $cm); + $currentgroup = setup_and_print_groups($course, $groupmode, 'edit.php?d='.$data->id); - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, 'edit.php?d='.$data->id.'&sesskey='.sesskey().'&'); - } else { - $currentgroup = 0; - } + print_heading(format_string($data->name)); if ($currentgroup) { $groupselect = " AND groupid = '$currentgroup'"; diff --git a/mod/data/field/latlong/kml.php b/mod/data/field/latlong/kml.php index 9b0f7416aa..07c3650245 100644 --- a/mod/data/field/latlong/kml.php +++ b/mod/data/field/latlong/kml.php @@ -57,9 +57,9 @@ require_course_login($course, true, $cm); /// If it's hidden then it's don't show anything. :) if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities',get_context_instance(CONTEXT_MODULE, $cm->id))) { - $crumbs[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm)); diff --git a/mod/data/import.php b/mod/data/import.php index bae831f912..ba244de15a 100755 --- a/mod/data/import.php +++ b/mod/data/import.php @@ -76,19 +76,16 @@ /// Print the page header $strdata = get_string('modulenameplural','data'); - $crumbs[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple($data->name, "", $navigation, "", "", true, "", navmenu($course)); print_heading(format_string($data->name)); /// Groups needed for Add entry tab - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = get_and_set_current_group($course, $groupmode); - } else { - $currentgroup = 0; - } + $groupmode = groupmode($course, $cm); + $currentgroup = get_and_set_current_group($course, $groupmode); /// Print the tabs $currenttab = 'add'; diff --git a/mod/data/index.php b/mod/data/index.php index b6859af1f4..7fb16b3bf0 100755 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -42,8 +42,8 @@ $strname = get_string('name'); $strdata = get_string('modulename','data'); - $crumbs[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple($strdata, '', $navigation, '', '', true, "", navmenu($course)); @@ -78,7 +78,7 @@ array_push($table->align, 'center'); } - $currentgroup = get_current_group($course->id); + $currentgroup = get_and_set_current_group($course, groupmode($course)); if ($currentgroup and has_capability('mod/data:manageentries', $context)) { $group = groups_get_group($currentgroup, false); $groupname = " ($group->name)"; diff --git a/mod/data/lib.php b/mod/data/lib.php index c6e95e503e..68a21573d5 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1687,10 +1687,10 @@ function data_print_header($course, $cm, $data, $currenttab='') { global $CFG, $displaynoticegood, $displaynoticebad; $strdata = get_string('modulenameplural','data'); - $crumbs[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => $data->name, 'link' => '', 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $data->name, 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple($data->name, '', $navigation, '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')), diff --git a/mod/data/pagelib.php b/mod/data/pagelib.php index 942b8905ad..0ff3a02b83 100755 --- a/mod/data/pagelib.php +++ b/mod/data/pagelib.php @@ -28,8 +28,8 @@ class page_data extends page_generic_activity { parent::init_quick($data); } - function print_header($title, $morebreadcrumbs = NULL, $meta) { - parent::print_header($title, $morebreadcrumbs, '', $meta); + function print_header($title, $morenavlinks = NULL, $meta) { + parent::print_header($title, $morenavlinks, '', $meta); } function get_type() { diff --git a/mod/data/templates.php b/mod/data/templates.php index e608dae70e..ec659501eb 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -96,9 +96,9 @@ $meta .= '//]]>'."\n"; $meta .= ''."\n"; - $crumbs[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple($data->name, '', $navigation, '', $meta, true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')), @@ -108,11 +108,8 @@ /// Groups needed for Add entry tab - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = get_and_set_current_group($course, $groupmode); - } else { - $currentgroup = 0; - } + $groupmode = groupmode($course, $cm); + $currentgroup = get_and_set_current_group($course, $groupmode); /// Print the tabs. $currenttab = 'templates'; diff --git a/mod/data/view.php b/mod/data/view.php index 03d134952e..5255e316ba 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -94,9 +94,9 @@ if (empty($cm->visible) and !has_capability('mod/data:managetemplates', $context)) { $strdatabases = get_string("modulenameplural", "data"); - $crumbs[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm)); @@ -258,6 +258,12 @@ if (!empty($THEME->customcorners)) print_custom_corners_start(); } +/// Check to see if groups are being used here + $groupmode = groupmode($course, $cm); + $currentgroup = setup_and_print_groups($course, $groupmode, + 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort). + '&order='.s($order).'&'); + print_heading(format_string($data->name)); // Do we need to show a link to the RSS feed for the records? @@ -272,15 +278,6 @@ print_box(format_text($data->intro), 'generalbox', 'intro'); } -/// Check to see if groups are being used here - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, - 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort). - '&order='.s($order).'&'); - } else { - $currentgroup = 0; - } - /// Delete any requested records if ($delete && confirm_sesskey() && (has_capability('mod/data:manageentries', $context) or data_isowner($delete))) { diff --git a/mod/exercise/assessments.php b/mod/exercise/assessments.php index 12884d4ea6..0c26a84f08 100644 --- a/mod/exercise/assessments.php +++ b/mod/exercise/assessments.php @@ -62,11 +62,11 @@ $strassessments = get_string("assessments", "exercise"); // ... print the header and... - $crumbs[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strassessments, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strassessments, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($exercise->name), "", $navigation, "", "", true); diff --git a/mod/exercise/index.php b/mod/exercise/index.php index dd92c4bca8..ce83ef45c0 100644 --- a/mod/exercise/index.php +++ b/mod/exercise/index.php @@ -24,8 +24,8 @@ $strdeadline = get_string("deadline", "exercise"); $strsubmitted = get_string("submitted", "assignment"); - $crumbs[] = array('name' => $strexercises, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strexercises, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strexercises", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/exercise/submissions.php b/mod/exercise/submissions.php index 8698a8812c..02ab23978d 100644 --- a/mod/exercise/submissions.php +++ b/mod/exercise/submissions.php @@ -50,11 +50,11 @@ $strsubmissions = get_string("submissions", "exercise"); // ... print the header and... - $crumbs[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($exercise->name), "", $navigation, "", "", true); diff --git a/mod/exercise/upload.php b/mod/exercise/upload.php index 491bf49231..58b50c6ae8 100644 --- a/mod/exercise/upload.php +++ b/mod/exercise/upload.php @@ -28,10 +28,10 @@ $strexercise = get_string("modulename", "exercise"); $strupload = get_string("upload"); - $crumbs[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strupload, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strupload, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($exercise->name)." : $strupload", "", $navigation, "", "", true); diff --git a/mod/exercise/view.php b/mod/exercise/view.php index 8f073107fb..83ca9f378d 100644 --- a/mod/exercise/view.php +++ b/mod/exercise/view.php @@ -47,9 +47,9 @@ $strexercise = get_string("modulename", "exercise"); // ...display header... - $crumbs[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($exercise->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($exercise->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($exercise->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strexercise), navmenu($course, $cm)); @@ -340,14 +340,7 @@ /// Check to see if groups are being used in this exercise /// and if so, set $currentgroup to reflect the current group $groupmode = groupmode($course, $cm); // Groups are being used? - $currentgroup = get_and_set_current_group($course, $groupmode, $changegroup); - - /// Allow the teacher to change groups (for this session) - if ($groupmode) { - if ($groups = groups_get_groups_names($course->id)) { //TODO: - print_group_menu($groups, $groupmode, $currentgroup, "view.php?id=$cm->id"); - } - } + $currentgroup = setup_and_print_groups($course, $groupmode, "view.php?id=$cm->id"); print_heading_with_help(get_string("managingassignment", "exercise"), "managing", "exercise"); diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index 82863dd16c..c0dc30fb2c 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -97,9 +97,9 @@ unset($SESSION->fromdiscussion); - $crumbs[] = array('name' => get_string("forums", "forum"), 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name,true), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => format_string($discussion->name,true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title'); + $navlinks[] = array('name' => get_string("forums", "forum"), 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name,true), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => format_string($discussion->name,true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title'); if ($mode) { @@ -136,7 +136,7 @@ $searchform = forum_search_form($course); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$course->shortname: ".format_string($discussion->name), $course->fullname, $navigation, "", "", true, $searchform, navmenu($course, $cm)); diff --git a/mod/forum/index.php b/mod/forum/index.php index 4d5d97c795..e710694d5e 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -18,7 +18,7 @@ } require_course_login($course); - $currentgroup = get_current_group($course->id); + $currentgroup = get_and_set_current_group($course, groupmode($course)); $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); @@ -451,10 +451,10 @@ /// Output the page - $crumbs[] = array('name' => $strforums, 'link' => '', 'type' => 'activity'); + $navlinks[] = array('name' => $strforums, 'link' => '', 'type' => 'activity'); print_header("$course->shortname: $strforums", $course->fullname, - build_navigation($crumbs), + build_navigation($navlinks), "", "", true, $searchform, navmenu($course)); if (!isguest()) { diff --git a/mod/forum/markposts.php b/mod/forum/markposts.php index 11b6512994..d927720a01 100644 --- a/mod/forum/markposts.php +++ b/mod/forum/markposts.php @@ -33,10 +33,10 @@ } $strforums = get_string('modulenameplural', 'forum'); - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm)); notice_yesno(get_string('noguesttracking', 'forum').'

'.get_string('liketologin'), diff --git a/mod/forum/post.php b/mod/forum/post.php index c7ef23f008..cade93fb1b 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -58,10 +58,10 @@ require_login(); } - $crumbs[] = array('name' => get_string("forums", "forum"), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name,true), 'link' => '../forum/index.php?id=$course->id', 'type' => 'activityinstance'); + $navlinks[] = array('name' => get_string("forums", "forum"), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name,true), 'link' => '../forum/index.php?id=$course->id', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm)); @@ -98,7 +98,11 @@ } } - $SESSION->fromurl = $_SERVER["HTTP_REFERER"]; + if (isset($_SERVER["HTTP_REFERER"])) { + $SESSION->fromurl = $_SERVER["HTTP_REFERER"]; + } else { + $SESSION->fromurl = ''; + } // Load up the $post variable. @@ -112,11 +116,14 @@ $post->userid = $USER->id; $post->message = ''; - $post->groupid = get_current_group($course->id); - if ($post->groupid == 0) { - $post->groupid = -1; + if ($groupmode = groupmode($course, $cm)) { + $post->groupid = get_and_set_current_group($course, $groupmode); + if ($post->groupid == 0) { + $post->groupid = -1; //TODO: why -1?? + } + } else { + $post->groupid = -1; //TODO: why -1?? } - forum_set_return(); } else if (!empty($reply)) { // User is writing a new reply @@ -403,12 +410,12 @@ $course = get_record('course', 'id', $forum->course); $strforums = get_string("modulenameplural", "forum"); - $crumbs[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => format_string($post->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title'); - $crumbs[] = array('name' => get_string("prune", "forum"), 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => format_string($post->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title'); + $navlinks[] = array('name' => get_string("prune", "forum"), 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($discussion->name).": ".format_string($post->subject), "", $navigation, '', "", true, "", navmenu($course, $cm)); @@ -628,15 +635,15 @@ $strforums = get_string("modulenameplural", "forum"); - $crumbs[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); if ($post->parent) { - $crumbs[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'action'); + $navlinks[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'action'); } else { - $crumbs[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'action'); + $navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'action'); } if (empty($post->edit)) { @@ -664,7 +671,7 @@ $forcefocus = empty($reply) ? NULL : 'message'; - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$course->shortname: $strdiscussionname ". format_string($toppost->subject), $course->fullname, diff --git a/mod/forum/search.php b/mod/forum/search.php index bd2e13993c..fe6f08389d 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -97,12 +97,12 @@ $strsearchresults = get_string("searchresults", "forum"); $strpage = get_string("page"); - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); if (!$search || $showform) { $crumns[] = array('name' => $strsearch, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple("$strsearch", "", $navigation, 'search.words', "", "", " ", navmenu($course)); @@ -119,9 +119,9 @@ $searchform = forum_search_form($course, $search); - $crumbs[] = array('name' => $strsearch, 'link' => "search.php?id=$course->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => s($search, true), 'link' => '', 'type' => 'link'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strsearch, 'link' => "search.php?id=$course->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => s($search, true), 'link' => '', 'type' => 'link'); + $navigation = build_navigation($navlinks); if (!$posts = forum_search_posts($searchterms, $course->id, $page*$perpage, $perpage, $totalcount)) { @@ -407,7 +407,7 @@ function forum_clean_search_terms($words, $prefix='') { function forum_menu_list($course) { $menu = array(); - $currentgroup = get_current_group($course->id); + $currentgroup = get_and_set_current_group($course, groupmode($course)); if ($forums = get_all_instances_in_course("forum", $course)) { if ($course->format == 'weeks') { diff --git a/mod/forum/settracking.php b/mod/forum/settracking.php index cea87415de..f1d270de44 100644 --- a/mod/forum/settracking.php +++ b/mod/forum/settracking.php @@ -31,10 +31,10 @@ } $strforums = get_string('modulenameplural', 'forum'); - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm)); notice_yesno(get_string('noguesttracking', 'forum').'

'.get_string('liketologin'), diff --git a/mod/forum/subscribe.php b/mod/forum/subscribe.php index 995871556d..e9bc2166a5 100644 --- a/mod/forum/subscribe.php +++ b/mod/forum/subscribe.php @@ -52,10 +52,10 @@ } $strforums = get_string('modulenameplural', 'forum'); - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm)); diff --git a/mod/forum/subscribers.php b/mod/forum/subscribers.php index 0109fd3056..9c5fa8228c 100644 --- a/mod/forum/subscribers.php +++ b/mod/forum/subscribers.php @@ -36,11 +36,11 @@ $strsubscribers = get_string("subscribers", "forum"); $strforums = get_string("forums", "forum"); - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strsubscribers, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strsubscribers, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); if (has_capability('mod/forum:managesubscriptions', $context)) { print_header_simple("$strsubscribers", "", $navigation, @@ -54,11 +54,8 @@ } /// Check to see if groups are being used in this forum - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, "subscribers.php?id=$forum->id"); - } else { - $currentgroup = false; - } + $groupmode = groupmode($course, $cm); + $currentgroup = setup_and_print_groups($course, $groupmode, "subscribers.php?id=$forum->id"); if (empty($USER->subscriptionsediting)) { /// Display an overview of subscribers diff --git a/mod/forum/user.php b/mod/forum/user.php index e3aae64ff5..498e974bc6 100644 --- a/mod/forum/user.php +++ b/mod/forum/user.php @@ -40,12 +40,12 @@ $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $syscontext)); // TODO: add new cookie tail here! - $crumbs[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'core'); - $crumbs[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id", 'type' => 'title'); - $crumbs[] = array('name' => $strforumposts, 'link' => '', 'type' => 'title'); - $crumbs[] = array('name' => $strmode, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'core'); + $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id", 'type' => 'title'); + $navlinks[] = array('name' => $strforumposts, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strmode, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$course->shortname: $fullname: $strmode", $course->fullname,$navigation); diff --git a/mod/forum/view.php b/mod/forum/view.php index c57f82b3c3..960a1f0783 100644 --- a/mod/forum/view.php +++ b/mod/forum/view.php @@ -64,10 +64,10 @@ /// Print header. - $crumbs[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($forum->name), "", $navigation, "", "", true, $buttontext, navmenu($course, $cm)); @@ -82,15 +82,9 @@ notice(get_string('noviewdiscussionspermission', 'forum')); } +/// find out current groups mode $groupmode = groupmode($course, $cm); - $currentgroup = get_and_set_current_group($course, $groupmode, $changegroup); - - if ($groupmode == SEPARATEGROUPS && ($currentgroup === false) && - !has_capability('moodle/site:accessallgroups', $context)) { - notice(get_string('notingroup', 'forum')); - } - - + $currentgroup = setup_and_print_groups($course, $groupmode, 'view.php?id=' . $cm->id); /// Okay, we can show the discussions. Log the forum view. if ($cm->id) { @@ -123,40 +117,6 @@ print_box_start('forumcontrol'); - /// 2 ways to do this, 1. we can changed the setup_and_print_groups functions - /// in moodlelib, taking in 1 more parameter, and tell the function when to - /// allow student menus, 2, we can just use this code to explicitly print this - /// menu for students in forums. - - /// Now we need a menu for separategroups as well! - if ($groupmode == VISIBLEGROUPS || ($groupmode - && has_capability('moodle/site:accessallgroups', $context))) { - - //the following query really needs to change - if ($groups = groups_get_groups_names($course->id)) { //TODO: - print_box_start('groupmenu'); - print_group_menu($groups, $groupmode, $currentgroup, "$CFG->wwwroot/mod/forum/view.php?id=$cm->id"); - print_box_end(); // groupmenu - } - } - - /// Only print menus the student is in any course - else if ($groupmode == SEPARATEGROUPS){ - $validgroups = array(); - // Get all the groups this guy is in in this course - - if ($p = user_group($course->id,$USER->id)){ - /// Extract the name and id for the group - foreach ($p as $index => $object){ - $validgroups[$object->id] = $object->name; - } - /// Print them in the menu - print_box_start('groupmenu'); - print_group_menu($validgroups, $groupmode, $currentgroup, "view.php?id=$cm->id",0); - print_box_end(); // groupmenu - } - } - print_box_start('subscription'); if (!empty($USER->id) && !has_capability('moodle/legacy:guest', $context, NULL, false)) { diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index 0a7b8430aa..84713712e0 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -223,12 +223,12 @@ function glossary_comment_print_header($course, $cm, $glossary, $entry, $action) $strglossary = get_string('modulename', 'glossary'); $strcomments = get_string('comments', 'glossary'); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strcomments, 'link' => "comments.php?id=$cm->id&eid=$entry->id", 'type' => 'title'); - $crumbs[] = array('name' => $straction, 'link' => '', 'type' => 'action'); + $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $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($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/comments.php b/mod/glossary/comments.php index e09510fe8f..98566a68c2 100644 --- a/mod/glossary/comments.php +++ b/mod/glossary/comments.php @@ -42,10 +42,10 @@ $strcomments = get_string("comments", "glossary"); $straddcomment = get_string("addcomment", "glossary"); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strcomments, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strcomments, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(strip_tags("$strcomments: $entry->concept"), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/deleteentry.php b/mod/glossary/deleteentry.php index 1830f9a98d..51793f43bd 100644 --- a/mod/glossary/deleteentry.php +++ b/mod/glossary/deleteentry.php @@ -39,10 +39,10 @@ $strareyousuredelete = get_string("areyousuredelete","glossary"); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $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", 'type' => 'activityinstance'); -$navigation = build_navigation($crumbs); +$navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index 66bbe8478b..e4b44f8440 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -192,11 +192,11 @@ $strglossary = get_string("modulename", "glossary"); $strglossaries = get_string("modulenameplural", "glossary"); $stredit = empty($e) ? get_string('addentry', 'glossary') : get_string("edit"); -$crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); -$crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); -$crumbs[] = array('name' => $stredit, 'link' => '', 'type' => 'title'); +$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", 'type' => 'activityinstance'); +$navlinks[] = array('name' => $stredit, 'link' => '', 'type' => 'title'); -$navigation = build_navigation($crumbs); +$navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, "", navmenu($course, $cm)); diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 723956609b..e0733f8edb 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -47,11 +47,11 @@ $strglossaries = get_string("modulenameplural", "glossary"); $strglossary = get_string("modulename", "glossary"); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id&tab=GLOSSARY_CATEGORY_VIEW", 'type' => 'activityinstance'); - $crumbs[] = array('name' => get_string("categories","glossary"), 'link' => '', 'type' => 'title'); + $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($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/export.php b/mod/glossary/export.php index 484452d92e..0c6cb4002d 100644 --- a/mod/glossary/export.php +++ b/mod/glossary/export.php @@ -37,10 +37,10 @@ $strexportfile = get_string("exportfile", "glossary"); $strexportentries = get_string('exportentries', 'glossary'); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $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", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "",$navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/exportentry.php b/mod/glossary/exportentry.php index 2eef92d8de..2745107a74 100644 --- a/mod/glossary/exportentry.php +++ b/mod/glossary/exportentry.php @@ -38,10 +38,10 @@ $entryalreadyexist = get_string('entryalreadyexist','glossary'); $entryexported = get_string('entryexported','glossary'); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $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", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm)); diff --git a/mod/glossary/formats.php b/mod/glossary/formats.php index bba5a0057b..ba8fb855be 100644 --- a/mod/glossary/formats.php +++ b/mod/glossary/formats.php @@ -51,13 +51,13 @@ $strmodulename = get_string("modulename", "glossary"); $strdisplayformats = get_string("displayformats","glossary"); - $crumbs[] = array('name' => $stradmin, 'link' => "../../$CFG->admin/index.php", 'type' => 'core'); - $crumbs[] = array('name' => $strconfiguration, 'link' => "../../$CFG->admin/configure.php", 'type' => 'core'); - $crumbs[] = array('name' => $strmanagemodules, 'link' => "../../$CFG->admin/modules.php", 'type' => 'core'); - $crumbs[] = array('name' => $strmodulename, 'link' => "../../$CFG->admin/module.php?module=glossary&sesskey=$USER->sesskey", 'type' => 'core'); - $crumbs[] = array('name' => $strdisplayformats, 'link' => '', 'type' => 'core'); + $navlinks[] = array('name' => $stradmin, 'link' => "../../$CFG->admin/index.php", 'type' => 'core'); + $navlinks[] = array('name' => $strconfiguration, 'link' => "../../$CFG->admin/configure.php", 'type' => 'core'); + $navlinks[] = array('name' => $strmanagemodules, 'link' => "../../$CFG->admin/modules.php", 'type' => 'core'); + $navlinks[] = array('name' => $strmodulename, 'link' => "../../$CFG->admin/module.php?module=glossary&sesskey=$USER->sesskey", 'type' => 'core'); + $navlinks[] = array('name' => $strdisplayformats, 'link' => '', 'type' => 'core'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$strmodulename: $strconfiguration", $site->fullname, $navigation); diff --git a/mod/glossary/import.php b/mod/glossary/import.php index 4d3b21f4c5..db18e27176 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -45,11 +45,11 @@ $strsearch = get_string("search"); $strimportentries = get_string('importentriesfromxml', 'glossary'); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strimportentries, 'link' => '', 'type' => 'title'); + $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", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strimportentries, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), diff --git a/mod/glossary/index.php b/mod/glossary/index.php index e516c3f635..54d314526b 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -27,8 +27,8 @@ /// Print the header - $crumbs[] = array('name' => $strglossarys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strglossarys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strglossarys", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/glossary/showentry.php b/mod/glossary/showentry.php index d3602beccb..937b88cb3a 100644 --- a/mod/glossary/showentry.php +++ b/mod/glossary/showentry.php @@ -49,10 +49,10 @@ $CFG->framename = "newwindow"; if ($course->id != SITEID) { - $crumbs[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity'); - $crumbs[] = array('name' => $strsearch, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity'); + $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, " ", " "); } else { diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 2a4774ecbc..b400bb0e6a 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -224,22 +224,22 @@ $strsearch = get_string("search"); $strwaitingapproval = get_string('waitingapproval', 'glossary'); - $crumbs[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$id", 'type' => 'activityinstance'); /// If we are in approval mode, prit special header if ($tab == GLOSSARY_APPROVAL_VIEW) { require_capability('mod/glossary:approve', $context); - $crumbs[] = array('name' => $strwaitingapproval, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strwaitingapproval, '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)); print_heading($strwaitingapproval); } else { /// Print standard header - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($glossary->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm)); } diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index c50c0c07b6..b583f41460 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -37,8 +37,8 @@ $title = format_string($course->shortname) . ": $strmodulenameplural"; $heading = $course->fullname; - $crumbs[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strmodulenameplural, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header($title, $heading, $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index d31f25ec48..761279b247 100644 --- a/mod/hotpot/report.php +++ b/mod/hotpot/report.php @@ -402,8 +402,8 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) { $title = format_string($course->shortname) . ": $hotpot->name"; $heading = $course->fullname; - $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity'); - $crumbs[] = array('name' => $hotpot->name, 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity'); + $navlinks[] = array('name' => $hotpot->name, 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); $modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id); @@ -414,16 +414,16 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) { $module = "hotpot"; } - $crumbs[] = array('name' => get_string("report$mode", $module), 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => get_string("report$mode", $module), 'link' => '', 'type' => 'title'); } else { - $crumbs[] = array('name' => get_string("report", "quiz"), 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => get_string("report", "quiz"), 'link' => '', 'type' => 'title'); } $button = update_module_button($cm->id, $course->id, $strmodulename); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm)); print_heading($hotpot->name); @@ -600,10 +600,8 @@ function hotpot_get_report_users($course, $formdata) { $users = array(); /// Check to see if groups are being used in this module - $currentgroup = false; - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id&mode=simple"); - } + $groupmode = groupmode($course, $cm); //TODO: there is no $cm defined! + $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id&mode=simple"); $sort = "u.lastname ASC"; diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php index eb399ae4a9..d37a6d499d 100644 --- a/mod/hotpot/review.php +++ b/mod/hotpot/review.php @@ -53,9 +53,9 @@ $title = format_string($course->shortname) . ": $hotpot->name"; $heading = $course->fullname; - $crumbs[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity'); - $crumbs[] = array('name' => get_string("review", "quiz"), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity'); + $navlinks[] = array('name' => get_string("review", "quiz"), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); $button = update_module_button($cm->id, $course->id, $strmodulename); diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index 6a08acc69b..9473f584dc 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -42,10 +42,10 @@ // header strings $title = format_string($course->shortname.': '.$hotpot->name, true); $heading = $course->fullname; - $crumbs[] = array('name' => get_string("modulenameplural", "hotpot"), 'link' => $CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id, 'type' => 'activity'); - $crumbs[] = array('name' => $hotpot->name, 'link' => '', 'type' => 'activityinstance'); + $navlinks[] = array('name' => get_string("modulenameplural", "hotpot"), 'link' => $CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id, 'type' => 'activity'); + $navlinks[] = array('name' => $hotpot->name, 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); $button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot")); $button = '
'.$button.'
'; diff --git a/mod/journal/edit.php b/mod/journal/edit.php index 27ad00e81c..aa04b3b858 100644 --- a/mod/journal/edit.php +++ b/mod/journal/edit.php @@ -75,10 +75,10 @@ $entry->format = $defaultformat; } - $crumbs[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $stredit, 'link' => '', 'type' => 'action'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $stredit, 'link' => '', 'type' => 'action'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($journal->name), "", $navigation, "", "", true, "", navmenu($course, $cm)); diff --git a/mod/journal/index.php b/mod/journal/index.php index b7ec1bd177..b8f11ab3ac 100644 --- a/mod/journal/index.php +++ b/mod/journal/index.php @@ -17,8 +17,8 @@ $strweek = get_string("week"); $strtopic = get_string("topic"); - $crumbs[] = array('name' => $strjournals, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strjournals, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strjournals", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/journal/report.php b/mod/journal/report.php index 1ab7eeb811..b65eb0542a 100644 --- a/mod/journal/report.php +++ b/mod/journal/report.php @@ -38,20 +38,17 @@ $strentries = get_string("entries", "journal"); $strjournals = get_string("modulenameplural", "journal"); - $crumbs[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strentries, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strentries, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple("$strjournals", "", $navigation, "", "", true); /// Check to see if groups are being used in this journal - if ($groupmode = groupmode($course, $cm)) { // Groups are being used - $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id"); - } else { - $currentgroup = false; - } + $groupmode = groupmode($course, $cm); + $currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id"); /// Process incoming data if there is any if ($data = data_submitted()) { diff --git a/mod/journal/view.php b/mod/journal/view.php index 5918933aa7..8195662a5d 100644 --- a/mod/journal/view.php +++ b/mod/journal/view.php @@ -28,9 +28,9 @@ $strjournal = get_string("modulename", "journal"); $strjournals = get_string("modulenameplural", "journal"); - $crumbs[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($journal->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($journal->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($journal->name), '', $navigation, '', '', true, update_module_button($cm->id, $course->id, $strjournal), navmenu($course, $cm)); diff --git a/mod/lesson/import.php b/mod/lesson/import.php index 98fdfe0a82..3b9ffd72f2 100644 --- a/mod/lesson/import.php +++ b/mod/lesson/import.php @@ -35,11 +35,11 @@ $strimportquestions = get_string("importquestions", "lesson"); $strlessons = get_string("modulenameplural", "lesson"); - $crumbs[] = array('name' => $strlesson, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($lesson->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strimportquestions, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strlesson, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($lesson->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strimportquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple("$strimportquestions", " $strimportquestions", $navigation); diff --git a/mod/lesson/importppt.php b/mod/lesson/importppt.php index fb057f1a87..81cd9c0dfc 100644 --- a/mod/lesson/importppt.php +++ b/mod/lesson/importppt.php @@ -44,11 +44,11 @@ $strimportppt = get_string("importppt", "lesson"); $strlessons = get_string("modulenameplural", "lesson"); - $crumbs[] = array('name' => $strlessons, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($mod->name,true), 'link' => "$CFG->wwwroot/mod/$modname/view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strimportppt, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strlessons, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($mod->name,true), 'link' => "$CFG->wwwroot/mod/$modname/view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strimportppt, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple("$strimportppt", " $strimportppt", $navigation); diff --git a/mod/lesson/index.php b/mod/lesson/index.php index a8c98d7c83..b144d2973d 100644 --- a/mod/lesson/index.php +++ b/mod/lesson/index.php @@ -30,9 +30,9 @@ /// Print the header - $crumbs[] = array('name' => $strlessons, 'link' => '', 'type' => 'activity'); + $navlinks[] = array('name' => $strlessons, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$course->shortname: $strlessons", $course->fullname, $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 859ca26bb8..362ca5450e 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -240,10 +240,10 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') { /// Header setup - $crumbs[] = array('name' => $strlessons, 'link' => "$CFG->wwwroot/mod/lesson/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => $strname, 'link' => '', 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strlessons, 'link' => "$CFG->wwwroot/mod/lesson/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $strname, 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); /// Print header, heading, tabs and messages print_header("$course->shortname: $strname", $course->fullname, $navigation, diff --git a/mod/lesson/pagelib.php b/mod/lesson/pagelib.php index 5626f32872..9f5460ed8b 100644 --- a/mod/lesson/pagelib.php +++ b/mod/lesson/pagelib.php @@ -60,7 +60,7 @@ class page_lesson extends page_generic_activity { * * @return void **/ - function print_header($title = '', $morebreadcrumbs = array()) { + function print_header($title = '', $morenavlinks = array()) { global $CFG; $this->init_full(); @@ -76,11 +76,11 @@ class page_lesson extends page_generic_activity { $title = "{$this->courserecord->shortname}: $activityname"; } - $crumbs[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance'); + $navlinks[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance'); - if (!empty($morebreadcrumbs)) { - $breadcrumbs = array_merge($crumbs, $morebreadcrumbs); + if (!empty($morenavlinks)) { + $navlinks = array_merge($navlinks, $morenavlinks); } @@ -132,7 +132,7 @@ class page_lesson extends page_generic_activity { $meta = ''; // } - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord)); diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 694f57bb0b..d660e5fb0b 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -396,11 +396,11 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext) ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) : ""; - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strattemptnum, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strattemptnum, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule); } diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index e788e1de9e..90470a5b25 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -310,10 +310,10 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext) ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) : ""; - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingquiz, '', $navigation, "", "", true, $strupdatemodule); @@ -350,10 +350,10 @@ ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) : ""; - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingquiz, '', $navigation, "", "", true, $strupdatemodule); diff --git a/mod/quiz/index.php b/mod/quiz/index.php index 30a99d12b3..87b4faacb9 100644 --- a/mod/quiz/index.php +++ b/mod/quiz/index.php @@ -31,8 +31,8 @@
"; } - $crumbs[] = array('name' => $strquizzes, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strquizzes, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple($strquizzes, '', $navigation, '', '', true, $streditquestions, navmenu($course)); diff --git a/mod/quiz/report/default.php b/mod/quiz/report/default.php index f59fccf6c4..539ec1bec2 100644 --- a/mod/quiz/report/default.php +++ b/mod/quiz/report/default.php @@ -27,9 +27,9 @@ class quiz_default_report { $strquizzes = get_string("modulenameplural", "quiz"); $strquiz = get_string("modulename", "quiz"); /// Print the page header - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($quiz->name), 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($quiz->name), "", $navigation, '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm)); diff --git a/mod/quiz/review.php b/mod/quiz/review.php index a66a55abb1..fb7cd39765 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -125,11 +125,11 @@ ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) : ""; - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strreview, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strreview, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule); } diff --git a/mod/resource/index.php b/mod/resource/index.php index e4ef54622d..d00c9e2f5a 100644 --- a/mod/resource/index.php +++ b/mod/resource/index.php @@ -28,8 +28,8 @@ $strlastmodified = get_string("lastmodified"); - $crumbs[] = array('name' => $strresources, 'link' => '', 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strresources, 'link' => '', 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header("$course->shortname: $strresources", $course->fullname, $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/resource/lib.php b/mod/resource/lib.php index b73a73240f..acd438d89f 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -112,12 +112,12 @@ function resource_base($cmid=0) { $this->strresource = get_string("modulename", "resource"); $this->strresources = get_string("modulenameplural", "resource"); - $this->crumbs[] = array('name' => $this->strresources, 'link' => "index.php?id={$this->course->id}", 'type' => 'activity'); + $this->navlinks[] = array('name' => $this->strresources, 'link' => "index.php?id={$this->course->id}", 'type' => 'activity'); if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) { $pagetitle = strip_tags($this->course->shortname.': '.$this->strresource); - $this->crumbs[] = array('name' => $this->strresource, 'link' => '', 'type' => 'activityinstance'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => $this->strresource, 'link' => '', 'type' => 'activityinstance'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $this->course->fullname, $this->navigation, "", "", true, '', navmenu($this->course, $this->cm)); notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}"); @@ -163,10 +163,10 @@ function display_course_blocks_start() { $USER->editing = $edit; } - $morebreadcrumbs = array($this->strresources => 'index.php?id='.$this->course->id, + $morenavlinks = array($this->strresources => 'index.php?id='.$this->course->id, $this->resource->name => ''); - $PAGE->print_header($this->course->shortname.': %fullname%', $morebreadcrumbs); + $PAGE->print_header($this->course->shortname.': %fullname%', $morenavlinks); echo ''; diff --git a/mod/resource/type/directory/resource.class.php b/mod/resource/type/directory/resource.class.php index 549ae63c6e..ed40f7e8a0 100644 --- a/mod/resource/type/directory/resource.class.php +++ b/mod/resource/type/directory/resource.class.php @@ -63,20 +63,20 @@ function display() { $count = 0; $subnav = "id}\">".format_string($resource->name,true).""; $backsub = ''; - $this->crumbs[] = array('name' => format_string($resource->name,true), 'link' => "view.php?id={$cm->id}", 'type' => 'activity'); + $this->navlinks[] = array('name' => format_string($resource->name,true), 'link' => "view.php?id={$cm->id}", 'type' => 'activity'); foreach ($subs as $sub) { $count++; if ($count < $countsubs) { $backsub .= "/$sub"; - $this->crumbs[] = array('name' => $sub, 'link' => "view.php?id={$cm->id}", 'type' => 'title'); + $this->navlinks[] = array('name' => $sub, 'link' => "view.php?id={$cm->id}", 'type' => 'title'); } else { - $this->crumbs[] = array('name' => $sub, 'link' => '', 'type' => 'title'); + $this->navlinks[] = array('name' => $sub, 'link' => '', 'type' => 'title'); } } } else { - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activity'); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activity'); } $pagetitle = strip_tags($course->shortname.': '.format_string($resource->name)); @@ -87,7 +87,7 @@ function display() { $editfiles = print_single_button("$CFG->wwwroot/files/index.php", $options, get_string("editfiles"), 'get', '', true); $update = $editfiles.$update; } - $this->navigation = build_navigation($this->crumbs); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, $update, navmenu($course, $cm)); diff --git a/mod/resource/type/html/resource.class.php b/mod/resource/type/html/resource.class.php index 22678843c7..0e90c15481 100644 --- a/mod/resource/type/html/resource.class.php +++ b/mod/resource/type/html/resource.class.php @@ -84,8 +84,8 @@ function display() { print_footer($course); } else { /// Make a page and a pop-up window - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), @@ -113,8 +113,8 @@ function display() { } } else { /// not a popup at all - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), diff --git a/mod/resource/type/ims/deploy.php b/mod/resource/type/ims/deploy.php index c3895e3cdd..74470d8b9a 100644 --- a/mod/resource/type/ims/deploy.php +++ b/mod/resource/type/ims/deploy.php @@ -64,9 +64,9 @@ print_header($pagetitle, $course->fullname); } else { - $resource_obj->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); - $resource_obj->crumbs[] = array('name' => $strdeploy, 'link' => '', 'type' => 'action'); - $navigation = build_navigation($resource_obj->crumbs); + $resource_obj->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); + $resource_obj->navlinks[] = array('name' => $strdeploy, 'link' => '', 'type' => 'action'); + $navigation = build_navigation($resource_obj->navlinks); print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $resource_obj->strresource)); diff --git a/mod/resource/type/ims/resource.class.php b/mod/resource/type/ims/resource.class.php index 694d1676f8..4ce1c9262b 100644 --- a/mod/resource/type/ims/resource.class.php +++ b/mod/resource/type/ims/resource.class.php @@ -373,8 +373,8 @@ class resource_ims extends resource_base { print_header($pagetitle, $course->fullname.' : '.$resource->name); } else { - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm)); } @@ -474,8 +474,8 @@ class resource_ims extends resource_base { //print_header($pagetitle, $course->fullname.' : '.$resource->name); print_header(); } else { - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent")); } /// content - this produces everything else diff --git a/mod/resource/type/text/resource.class.php b/mod/resource/type/text/resource.class.php index 426d104364..b323e98f26 100644 --- a/mod/resource/type/text/resource.class.php +++ b/mod/resource/type/text/resource.class.php @@ -110,8 +110,8 @@ function display() { } else { /// not a popup at all add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id); - $this->crumbs[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'title'); - $this->navigation = build_navigation($this->crumbs); + $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'title'); + $this->navigation = build_navigation($this->navlinks); print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), diff --git a/mod/scorm/index.php b/mod/scorm/index.php index e4d378e713..78a017c92c 100755 --- a/mod/scorm/index.php +++ b/mod/scorm/index.php @@ -25,8 +25,8 @@ $strreport = get_string("report",'scorm'); $strlastmodified = get_string("lastmodified"); - $crumbs[] = array('name' => $strscorms, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strscorms, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strscorms", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/scorm/player.php b/mod/scorm/player.php index 15c6d17203..3fd6f69fba 100755 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -51,7 +51,7 @@ // The module SCORM/AICC activity with the first id is the course $firstscorm = current($scorms); if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) { - $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); } } } @@ -59,8 +59,8 @@ $pagetitle = strip_tags("$course->shortname: ".format_string($scorm->name)); if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE,$course->id))) { - $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false); @@ -125,8 +125,8 @@ $bodyscript = 'onunload="main.close();"'; } - $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); $exitlink = ''.$strexit.' '; print_header($pagetitle, $course->fullname, diff --git a/mod/scorm/report.php b/mod/scorm/report.php index cb543202c9..d7b07b96bf 100755 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -64,29 +64,29 @@ $strattempt = get_string('attempt', 'scorm'); $strname = get_string('name'); - $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); if (empty($b)) { if (empty($a)) { - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,$navigation, '', '', true); } else { - $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); - $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); + $navlinks[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, $navigation, '', '', true); } } else { - $crumbs[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); - $crumbs[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => "report.php?a=$a&user=$user&attempt=$attempt", 'type' => 'title'); - $crumbs[] = array('name' => $sco->title, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title'); + $navlinks[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => "report.php?a=$a&user=$user&attempt=$attempt", 'type' => 'title'); + $navlinks[] = array('name' => $sco->title, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, $navigation, '', '', true); diff --git a/mod/scorm/view.php b/mod/scorm/view.php index 5e8e64f631..98139ecb7f 100755 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -48,7 +48,7 @@ // The module SCORM activity with the least id is the course $firstscorm = current($scorms); if (!(($course->format == 'scorm') && ($firstscorm->id == $scorm->id))) { - $crumbs[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity'); } } } @@ -63,8 +63,8 @@ // // Print the page header // - $crumbs[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navigation = build_navigation($navlinks); print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm)); diff --git a/mod/survey/index.php b/mod/survey/index.php index b078f0241e..d537094d6e 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -21,8 +21,8 @@ $strdone = get_string("done", "survey"); $strnotdone = get_string("notdone", "survey"); - $crumbs[] = array('name' => $strsurveys, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strsurveys, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strsurveys", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/survey/report.php b/mod/survey/report.php index cced689e57..25c2169d4f 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -65,10 +65,10 @@ id\">".format_string($survey->name,true)." -> "; } - $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($survey->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strreport, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($survey->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strreport, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header("$course->shortname: ".format_string($survey->name), $course->fullname, $navigation, "", "", true, diff --git a/mod/survey/save.php b/mod/survey/save.php index 141fc9328f..ced931c2ab 100644 --- a/mod/survey/save.php +++ b/mod/survey/save.php @@ -33,10 +33,10 @@ $strsurveys = get_string("modulenameplural", "survey"); $strsurveysaved = get_string("surveysaved", "survey"); - $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strsurveysaved, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strsurveysaved, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple("$strsurveysaved", "", $navigation, ""); diff --git a/mod/survey/view.php b/mod/survey/view.php index ee7bc86c00..1cbee4464a 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -37,9 +37,9 @@ $strsurveys = get_string("modulenameplural", "survey"); $strsurvey = get_string("modulename", "survey"); - $crumbs[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');; - $crumbs[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinistance'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');; + $navlinks[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinistance'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($survey->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm)); diff --git a/mod/wiki/admin.php b/mod/wiki/admin.php index 65228b22a3..d31e50b223 100644 --- a/mod/wiki/admin.php +++ b/mod/wiki/admin.php @@ -114,11 +114,11 @@ default: break; } } - $crumbs[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace'); - $crumbs[] = array('name' => get_string("administration","wiki"), 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace'); + $navlinks[] = array('name' => get_string("administration","wiki"), 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple("$wiki_entry->pagename", "", $navigation, $focus, "", true, update_module_button($cm->id, $course->id, $strwiki), diff --git a/mod/wiki/index.php b/mod/wiki/index.php index 9d1c18aa2f..88bc3358dc 100644 --- a/mod/wiki/index.php +++ b/mod/wiki/index.php @@ -24,8 +24,8 @@ /// Print the header - $crumbs[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strwikis", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/wiki/view.php b/mod/wiki/view.php index cbf94dd003..44fe38afae 100644 --- a/mod/wiki/view.php +++ b/mod/wiki/view.php @@ -281,10 +281,10 @@ $strwikis = get_string("modulenameplural", "wiki"); $strwiki = get_string("modulename", "wiki"); - $crumbs[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace'); + $navlinks[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace'); - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple($ewiki_title?$ewiki_title:format_string($wiki->name), "", $navigation, "", "", $cacheme, update_module_button($cm->id, $course->id, $strwiki), diff --git a/mod/workshop/assess.php b/mod/workshop/assess.php index ee9cb83595..12abeb053d 100644 --- a/mod/workshop/assess.php +++ b/mod/workshop/assess.php @@ -61,10 +61,10 @@ if ($frameset == "top") { // removed // because it does not validate MDL-7861 - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strassess, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strassess, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($workshop->name), "",$navigation, "", '', true); diff --git a/mod/workshop/assessments.php b/mod/workshop/assessments.php index 88ca8ec6e1..fce004fca3 100644 --- a/mod/workshop/assessments.php +++ b/mod/workshop/assessments.php @@ -71,10 +71,10 @@ // ... print the header and... - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strassessments, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strassessments, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($workshop->name), "", $navigation, "", "", true); diff --git a/mod/workshop/index.php b/mod/workshop/index.php index 4e11a27113..dfc4287d72 100644 --- a/mod/workshop/index.php +++ b/mod/workshop/index.php @@ -23,8 +23,8 @@ $strdeadline = get_string("deadline", "workshop"); $strsubmitted = get_string("submitted", "assignment"); - $crumbs[] = array('name' => $strworkshops, 'link' => '', 'type' => 'activity'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => '', 'type' => 'activity'); + $navigation = build_navigation($navlinks); print_header_simple("$strworkshops", "", $navigation, "", "", true, "", navmenu($course)); diff --git a/mod/workshop/submissions.php b/mod/workshop/submissions.php index 916fe510b9..3bc30892c4 100644 --- a/mod/workshop/submissions.php +++ b/mod/workshop/submissions.php @@ -51,10 +51,10 @@ $strsubmissions = get_string("submissions", "workshop"); // ... print the header and... - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($workshop->name), "", $navigation, "", "", true); diff --git a/mod/workshop/upload.php b/mod/workshop/upload.php index ae131f9777..0ee3325f0a 100644 --- a/mod/workshop/upload.php +++ b/mod/workshop/upload.php @@ -23,10 +23,10 @@ $strworkshop = get_string('modulename', 'workshop'); $strsubmission = get_string('submission', 'workshop'); - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strsubmission, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strsubmission, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple(format_string($workshop->name)." : $strsubmission", "", $navigation, "", "", true); diff --git a/mod/workshop/view.php b/mod/workshop/view.php index 18d89f3156..e2bac48862 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -69,12 +69,12 @@ } // ...display header... - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); if ($straction) { - $crumbs[] = array('name' => $straction, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $straction, 'link' => '', 'type' => 'title'); } - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple(format_string($workshop->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm)); @@ -305,34 +305,12 @@ workshop_grade_assessments($workshop); } - /// Check to see if groups are being used in this workshop - /* - setup_and_print_groups($course, groupmode($course, $cm), "view.php?id=$cm->id"); - $currentgroup = get_current_group($course->id); - */ - - /// copied code from assignment module, if this is not the way to do this please change it - /// the above code does not work - /// set_and_print_groups() is not fully implemented as function groups_instance_print_grouping_selector() - /// and function groups_instance_print_group_selector() are missing. - $context = get_context_instance(CONTEXT_MODULE, $cm->id); - $changegroup = optional_param('group', -1, PARAM_INT); // choose the current group + + /// find out current groups mode $groupmode = groupmode($course, $cm); - $currentgroup = get_and_set_current_group($course, $groupmode, $changegroup); - - /// Now we need a menu for separategroups as well! - if ($groupmode == VISIBLEGROUPS || ($groupmode - && has_capability('moodle/site:accessallgroups', $context))) { - - //the following query really needs to change - if ($groups = groups_get_groups_names($course->id)) { //TODO: - print_box_start('groupmenu'); - print_group_menu($groups, $groupmode, $currentgroup, "view.php?id=$cm->id"); - print_box_end(); // groupmenu - } - } - + $currentgroup = setup_and_print_groups($course, $groupmode, "view.php?id=$cm->id"); + /// Print admin links echo "
"; echo "id&action=adminlist\">". diff --git a/mod/workshop/viewassessment.php b/mod/workshop/viewassessment.php index 8ef0f89994..4582e9c2db 100644 --- a/mod/workshop/viewassessment.php +++ b/mod/workshop/viewassessment.php @@ -58,10 +58,10 @@ /// top frame with the navigation bar and the assessment form if ($frameset == "top") { - $crumbs[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strassess, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $navlinks[] = array('name' => $strassess, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); // removed as it does not validate print_header_simple(format_string($workshop->name), "", $navigation, diff --git a/question/category.php b/question/category.php index 56cc56f16e..190f5d0ae7 100644 --- a/question/category.php +++ b/question/category.php @@ -54,15 +54,15 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id)) ? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname)) : ""; - $crumbs = array(); - $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), + $navlinks = array(); + $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($module->name), + $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); - $crumbs[] = array('name' => $streditingcategories, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks[] = array('name' => $streditingcategories, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingcategories, '', $navigation, "", "", true, $strupdatemodule); @@ -72,9 +72,9 @@ include($CFG->dirroot."/mod/{$cm->modname}/tabs.php"); } else { // Print basic page layout. - $crumbs = array(); - $crumbs[] = array('name' => $streditingcategories, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => $streditingcategories, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingcategories, '', $navigation); diff --git a/question/edit.php b/question/edit.php index 1f1b0da33e..9edd5cd7ff 100644 --- a/question/edit.php +++ b/question/edit.php @@ -27,11 +27,11 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id)) ? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname)) : ""; - $crumbs = array(); - $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); - $crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); + $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule); $currenttab = 'edit'; @@ -40,9 +40,9 @@ include($CFG->dirroot."/mod/$cm->modname/tabs.php"); } else { // Print basic page layout. - $crumbs = array(); - $crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingquestions, '', $navigation); diff --git a/question/export.php b/question/export.php index 277c1cc67a..55c89197d2 100644 --- a/question/export.php +++ b/question/export.php @@ -69,11 +69,11 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id)) ? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname)) : ""; - $crumbs = array(); - $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); - $crumbs[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); + $navlinks[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($txt->exportquestions, '', $navigation, "", "", true, $strupdatemodule); $currenttab = 'edit'; @@ -82,9 +82,9 @@ include($CFG->dirroot."/mod/$cm->modname/tabs.php"); } else { // Print basic page layout. - $crumbs = array(); - $crumbs[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($txt->exportquestions, '', $navigation); // print tabs diff --git a/question/import.php b/question/import.php index ac3cb82eef..476f524a3d 100644 --- a/question/import.php +++ b/question/import.php @@ -87,11 +87,11 @@ $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id)) ? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname)) : ""; - $crumbs = array(); - $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); - $crumbs[] = array('name' => $txt->importquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); + $navlinks[] = array('name' => $txt->importquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($txt->importquestions, '', $navigation, "", "", true, $strupdatemodule); $currenttab = 'edit'; @@ -100,9 +100,9 @@ include($CFG->dirroot."/mod/$cm->modname/tabs.php"); } else { // Print basic page layout. - $crumbs = array(); - $crumbs[] = array('name' => $txt->importquestions, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => $txt->importquestions, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($txt->importquestions, '', $navigation); // print tabs diff --git a/question/question.php b/question/question.php index a7949d23c1..45e8ac9963 100644 --- a/question/question.php +++ b/question/question.php @@ -121,21 +121,21 @@ if ($mform->is_cancelled()){ $strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $category->course)) ? update_module_button($cm->id, $category->course, get_string('modulename', $cm->modname)) : ""; - $crumbs = array(); - $crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$category->course", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); - $crumbs[] = array('name' => get_string('editingquiz', 'quiz'), 'link' => $returnurl, 'type' => 'title'); - $crumbs[] = array('name' => $streditingquestion, 'link' => '', 'type' => 'title'); - $navigation = build_navigation($crumbs); + $navlinks = array(); + $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$category->course", 'type' => 'activity'); + $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title'); + $navlinks[] = array('name' => get_string('editingquiz', 'quiz'), 'link' => $returnurl, 'type' => 'title'); + $navlinks[] = array('name' => $streditingquestion, 'link' => '', 'type' => 'title'); + $navigation = build_navigation($navlinks); print_header_simple($streditingquestion, '', $navigation, "", "", true, $strupdatemodule); } else { - $crumbs = array(); - $crumbs[] = array('name' => get_string('editquestions', "quiz"), 'link' => $returnurl, 'type' => 'title'); - $crumbs[] = array('name' => $streditingquestion, 'link' => '', 'type' => 'title'); + $navlinks = array(); + $navlinks[] = array('name' => get_string('editquestions', "quiz"), 'link' => $returnurl, 'type' => 'title'); + $navlinks[] = array('name' => $streditingquestion, 'link' => '', 'type' => 'title'); $strediting = ''. get_string("editquestions", "quiz").' -> '.$streditingquestion; - $navigation = build_navigation($crumbs); + $navigation = build_navigation($navlinks); print_header_simple($streditingquestion, '', $navigation); } -- 2.39.5