Merge branch 'MDL-56411-int-fix' of github.com:ryanwyllie/moodle

This commit is contained in:
David Monllao
2016-10-18 14:00:29 +08:00
3 changed files with 12 additions and 2 deletions
@@ -82,7 +82,13 @@ class messages implements templatable, renderable {
$data->currentuserid = $this->currentuserid;
$data->otheruserid = $this->otheruserid;
$data->otheruserfullname = fullname($this->otheruser);
$data->isonline = \core_message\helper::is_online($this->otheruser->lastaccess);
if (empty($this->otheruser)) {
$data->isonline = false;
} else {
$data->isonline = \core_message\helper::is_online($this->otheruser->lastaccess);
}
$data->messages = array();
foreach ($this->messages as $message) {
$message = new message($message);
+1 -1
View File
@@ -99,7 +99,7 @@ $settings->make_active();
$renderer = $PAGE->get_renderer('core_message');
$requestedconversation = false;
$conversations = \core_message\api::get_conversations($user1->id, 0, 20);
$messages = null;
$messages = [];
if (!$user2realuser) {
// If there are conversations, but the user has not chosen a particular one, then render the most recent one.
$user2 = new stdClass();
@@ -14,6 +14,7 @@
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{#otheruserid}}
<div class="messages-header">
<div class="view-toggle btn-container">
<button class="btn btn-link" data-action="show-contacts">&lt; {{#str}} messages, message {{/str}}</button>
@@ -38,9 +39,11 @@
<button class="btn btn-link cancel-messages-delete" data-action="cancel-delete-messages">{{#str}}cancel{{/str}}</button>
</div>
</div>
{{/otheruserid}}
<div class="messages" data-region="messages" data-userid="{{otheruserid}}">
{{> core_message/message_area_messages }}
</div>
{{#otheruserid}}
<div class="response" data-region="response">
{{#iscurrentuser}}
<div class="message-box">
@@ -51,3 +54,4 @@
<button class="btn btn-link confirm" data-action="delete-messages">{{#str}} deleteselectedmessages, message {{/str}}</button>
</div>
</div>
{{/otheruserid}}