Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'message_nav_23' of git://github.com/andyjdavis/moodle i…

…nto MOODLE_23_STABLE
  • Loading branch information...
commit 532577bb97a8b31f53f8dc792598a9a727d0afff 2 parents 5b2b3bd + b4a8ab2
Sam Hemelryk samhemelryk authored

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
@@ -4194,7 +4194,7 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
4194 4194
4195 4195 // Messaging
4196 4196 if (($currentuser && has_capability('moodle/user:editownmessageprofile', $systemcontext)) || (!isguestuser($user) && has_capability('moodle/user:editmessageprofile', $usercontext) && !is_primary_admin($user->id))) {
4197   - $url = new moodle_url('/message/edit.php', array('id'=>$user->id, 'course'=>$course->id));
  4197 + $url = new moodle_url('/message/edit.php', array('id'=>$user->id));
4198 4198 $usersetting->add(get_string('editmymessage', 'message'), $url, self::TYPE_SETTING);
4199 4199 }
4200 4200
34 message/edit.php
@@ -26,30 +26,14 @@
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
38   -if (!$course = $DB->get_record('course', array('id' => $course))) {
39   - print_error('invalidcourseid');
40   -}
41   -
42   -if ($course->id != SITEID) {
43   - require_login($course);
44   -
45   -} else {
46   - if (!isloggedin()) {
47   - if (empty($SESSION->wantsurl)) {
48   - $SESSION->wantsurl = $CFG->httpswwwroot.'/message/edit.php';
49   - }
50   - redirect(get_login_url());
51   - }
52   -}
  36 +require_login();
53 37
54 38 if (isguestuser()) {
55 39 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 532577b

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