Permalink
Browse files

MDL-30895 switch from dl tag to table in the accessible chat

  • Loading branch information...
1 parent 41e7411 commit 0b121f15186a32bcfd4b24363a7b65410422259f @mouneyrac mouneyrac committed Aug 8, 2013
Showing with 27 additions and 8 deletions.
  1. +7 −2 mod/chat/gui_basic/index.php
  2. +20 −6 mod/chat/lib.php
@@ -181,15 +181,20 @@
$allmessages[] = chat_format_message($message, $course->id, $USER);
}
}
-
+echo '<table class="generaltable"><tbody>';
+echo '<tr>
+ <th scope="col" class="cell">' . get_string('from') . '</th>
+ <th scope="col" class="cell">' . get_string('message', 'message') . '</th>
+ <th scope="col" class="cell">' . get_string('time') . '</th>
+ </tr>';
if (empty($allmessages)) {
echo get_string('nomessagesfound', 'message');
} else {
foreach ($allmessages as $message) {
echo $message->basic;
}
}
-
+echo '</tbody></table>';
echo '</div>';
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
View
@@ -758,8 +758,11 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser
$output->text = $message->strtime.': '.get_string('message'.$message->message, 'chat', fullname($sender));
$output->html = '<table class="chat-event"><tr'.$rowclass.'><td class="picture">'.$message->picture.'</td><td class="text">';
$output->html .= '<span class="event">'.$output->text.'</span></td></tr></table>';
- $output->basic = '<dl><dt class="event">'.$message->strtime.': '.get_string('message'.$message->message, 'chat', fullname($sender)).'</dt></dl>';
-
+ $output->basic = '<tr class="r1">
+ <th scope="row" class="cell c1 title"></th>
+ <td class="cell c2 text">' . get_string('message'.$message->message, 'chat', fullname($sender)) . '</td>
+ <td class="cell c3">' . $message->strtime . '</td>
+ </tr>';
if($message->message == 'exit' or $message->message == 'enter') {
$output->refreshusers = true; //force user panel refresh ASAP
}
@@ -784,13 +787,16 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser
$beepwho = trim(substr($text, 5));
if ($beepwho == 'all') { // everyone
- $outinfo = $message->strtime.': '.get_string('messagebeepseveryone', 'chat', fullname($sender));
+ $outinfobasic = get_string('messagebeepseveryone', 'chat', fullname($sender));
+ $outinfo = $message->strtime . ': ' . $outinfobasic;
$outmain = '';
+
$output->beep = true; // (eventually this should be set to
// to a filename uploaded by the user)
} else if ($beepwho == $currentuser->id) { // current user
- $outinfo = $message->strtime.': '.get_string('messagebeepsyou', 'chat', fullname($sender));
+ $outinfobasic = get_string('messagebeepsyou', 'chat', fullname($sender));
+ $outinfo = $message->strtime . ': ' . $outinfobasic;
$outmain = '';
$output->beep = true;
@@ -839,9 +845,17 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser
$output->html .= "<span class=\"title\">$outinfo</span>";
if ($outmain) {
$output->html .= ": $outmain";
- $output->basic = '<dl><dt class="title">'.$outinfo.':</dt><dd class="text">'.$outmain.'</dd></dl>';
+ $output->basic = '<tr class="r0">
+ <th scope="row" class="cell c1 title">' . $sender->firstname . '</th>
+ <td class="cell c2 text">' . $outmain . '</td>
+ <td class="cell c3">' . $message->strtime . '</td>
+ </tr>';
} else {
- $output->basic = '<dl><dt class="title">'.$outinfo.'</dt></dl>';
+ $output->basic = '<tr class="r1">
+ <th scope="row" class="cell c1 title"></th>
+ <td class="cell c2 text">' . $outinfobasic . '</td>
+ <td class="cell c3">' . $message->strtime . '</td>
+ </tr>';
}
$output->html .= "</td></tr></table>";
return $output;

0 comments on commit 0b121f1

Please sign in to comment.