';
$sessions = chat_get_sessions($messages, $showall);
foreach ($sessions as $session) {
echo '
';
echo '
'.userdate($session->sessionstart).' --> '. userdate($session->sessionend).'
';
echo $OUTPUT->box_start();
arsort($session->sessionusers);
foreach ($session->sessionusers as $sessionuser => $usermessagecount) {
if ($user = $DB->get_record('user', array('id' => $sessionuser))) {
$OUTPUT->user_picture($user, array('courseid' => $course->id));
echo ' ' . fullname($user, $canviewfullnames);
echo " ($usermessagecount)
";
}
}
echo '
';
echo "id&start=$session->sessionstart&end=$session->sessionend\">$strseesession";
$participatedcap = (array_key_exists($USER->id, $session->sessionusers)
&& has_capability('mod/chat:exportparticipatedsession', $context));
if (!empty($CFG->enableportfolios) && ($canexportsess || $participatedcap)) {
require_once($CFG->libdir . '/portfoliolib.php');
$buttonoptions = array(
'id' => $cm->id,
'start' => $session->sessionstart,
'end' => $session->sessionend,
);
$button = new portfolio_add_button();
$button->set_callback_options('chat_portfolio_caller', $buttonoptions, 'mod_chat');
$portfoliobutton = $button->to_html(PORTFOLIO_ADD_TEXT_LINK);
if (!empty($portfoliobutton)) {
echo '
' . $portfoliobutton;
}
}
if (has_capability('mod/chat:deletelog', $context)) {
$deleteurl = "report.php?id=$cm->id&start=$session->sessionstart&end=$session->sessionend&deletesession=1";
echo "
$strdeletesession";
}
echo '
';
echo $OUTPUT->box_end();
echo '