Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-36162 core_message: removed the unnecessary and confusing course …

…URL parameter as well as fixing the broken breadcrumb
  • Loading branch information...
commit 8b72167d0e787e5ebc7ae801be60849859a87094 1 parent f92305b
Andrew Davis andyjdavis authored samhemelryk committed

Showing 2 changed files with 5 additions and 31 deletions. Show diff stats Hide diff stats

  1. +1 1  lib/navigationlib.php
  2. +4 30 message/edit.php
2  lib/navigationlib.php
@@ -3978,7 +3978,7 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
3978 3978
3979 3979 // Messaging
3980 3980 if (($currentuser && has_capability('moodle/user:editownmessageprofile', $systemcontext)) || (!isguestuser($user) && has_capability('moodle/user:editmessageprofile', $usercontext) && !is_primary_admin($user->id))) {
3981   - $url = new moodle_url('/message/edit.php', array('id'=>$user->id, 'course'=>$course->id));
  3981 + $url = new moodle_url('/message/edit.php', array('id'=>$user->id));
3982 3982 $usersetting->add(get_string('editmymessage', 'message'), $url, self::TYPE_SETTING);
3983 3983 }
3984 3984
34 message/edit.php
@@ -26,31 +26,15 @@
26 26 require_once($CFG->dirroot . '/message/lib.php');
27 27
28 28 $userid = optional_param('id', $USER->id, PARAM_INT); // user id
29   -$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
30 29 $disableall = optional_param('disableall', 0, PARAM_BOOL); //disable all of this user's notifications
31 30
32 31 $url = new moodle_url('/message/edit.php');
33 32 $url->param('id', $userid);
34   -$url->param('course', $course);
35 33
36 34 $PAGE->set_url($url);
37 35 $PAGE->set_popup_notification_allowed(false); // We are within the messaging system so don't show message popups
38 36
39   -if (!$course = $DB->get_record('course', array('id' => $course))) {
40   - print_error('invalidcourseid');
41   -}
42   -
43   -if ($course->id != SITEID) {
44   - require_login($course);
45   -
46   -} else {
47   - if (!isloggedin()) {
48   - if (empty($SESSION->wantsurl)) {
49   - $SESSION->wantsurl = $CFG->httpswwwroot.'/message/edit.php';
50   - }
51   - redirect(get_login_url());
52   - }
53   -}
  37 +require_login();
54 38
55 39 if (isguestuser()) {
56 40 print_error('guestnoeditmessage', 'message');
@@ -71,10 +55,6 @@
71 55 if ($user->id == $USER->id) {
72 56 //editing own message profile
73 57 require_capability('moodle/user:editownmessageprofile', $systemcontext);
74   - if ($course->id != SITEID && $node = $PAGE->navigation->find($course->id, navigation_node::TYPE_COURSE)) {
75   - $node->make_active();
76   - $PAGE->navbar->includesettingsbase = true;
77   - }
78 58 } else {
79 59 // teachers, parents, etc.
80 60 require_capability('moodle/user:editmessageprofile', $personalcontext);
@@ -144,7 +124,7 @@
144 124 print_error('cannotupdateusermsgpref');
145 125 }
146 126
147   - redirect("$CFG->wwwroot/message/edit.php?id=$user->id&course=$course->id");
  127 + redirect("$CFG->wwwroot/message/edit.php?id=$user->id");
148 128 }
149 129
150 130 /// Load preferences
@@ -179,14 +159,8 @@
179 159
180 160 /// Display page header
181 161 $streditmymessage = get_string('editmymessage', 'message');
182   -$strparticipants = get_string('participants');
183   -
184   -$PAGE->set_title("$course->shortname: $streditmymessage");
185   -if ($course->id != SITEID) {
186   - $PAGE->set_heading("$course->fullname: $streditmymessage");
187   -} else {
188   - $PAGE->set_heading($course->fullname);
189   -}
  162 +$PAGE->set_title($streditmymessage);
  163 +$PAGE->set_heading($streditmymessage);
190 164
191 165 // Grab the renderer
192 166 $renderer = $PAGE->get_renderer('core', 'message');

0 comments on commit 8b72167

Please sign in to comment.
Something went wrong with that request. Please try again.