"MDL-23374, chat, fixed undefined variable"
This commit is contained in:
+16
-13
@@ -87,25 +87,28 @@
|
||||
echo '<p class="boxaligncenter">'.userdate($start).' --> '. userdate($end).'</p>';
|
||||
|
||||
echo $OUTPUT->box_start('center');
|
||||
$participates = array();
|
||||
foreach ($messages as $message) { // We are walking FORWARDS through messages
|
||||
if (!isset($participates[$message->userid])) {
|
||||
$participates[$message->userid] = true;
|
||||
}
|
||||
$formatmessage = chat_format_message($message, $course->id, $USER);
|
||||
if (isset($formatmessage->html)) {
|
||||
echo $formatmessage->html;
|
||||
}
|
||||
}
|
||||
if (has_capability('mod/chat:exportsession', $context)
|
||||
|| (array_key_exists($USER->id, $sessionusers)
|
||||
&& has_capability('mod/chat:exportparticipatedsession', $context))) {
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
$buttonoptions = array(
|
||||
'id' => $cm->id,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
);
|
||||
$button = new portfolio_add_button();
|
||||
$button->set_callback_options('chat_portfolio_caller', $buttonoptions, '/mod/chat/locallib.php');
|
||||
$button->render();
|
||||
}
|
||||
$participated_cap = array_key_exists($USER->id, $participates) && has_capability('mod/chat:exportparticipatedsession', $context);
|
||||
if (has_capability('mod/chat:exportsession', $context) || $participated_cap) {
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
$buttonoptions = array(
|
||||
'id' => $cm->id,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
);
|
||||
$button = new portfolio_add_button();
|
||||
$button->set_callback_options('chat_portfolio_caller', $buttonoptions, '/mod/chat/locallib.php');
|
||||
$button->render();
|
||||
}
|
||||
echo $OUTPUT->box_end();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user