Ejemplo n.º 1
0
 /**
  * Display meeting status, times, join link, etc..
  *
  * @param $times
  * @param $cm
  * @param bool $canmoderate
  * @param bool $canparticipate
  * @return string
  */
 public function meeting_status($times, $cm, $canmoderate = false, $canparticipate = false, $unrestored = false)
 {
     global $OUTPUT;
     $o = '<div class = "path-mod-collaborate__meetingstatus">';
     $o .= '<div class = "path-mod-collaborate__meetingstatus_times">' . $this->meeting_times($times) . '</div>';
     $boundarytime = local::boundary_time() * 60;
     if (time() < $times->end) {
         if (time() > $times->start - $boundarytime) {
             if ($canparticipate && $unrestored) {
                 $o .= $OUTPUT->notification(get_string('unrestored', 'collaborate'));
             } else {
                 if ($canmoderate || $canparticipate) {
                     $url = new moodle_url('view.php', ['action' => 'forward', 'id' => $cm->id]);
                     $o .= html_writer::link($url, get_string('meetingtimejoin', 'mod_collaborate', $times), ['class' => 'btn btn-success', 'target' => '_blank']);
                 } else {
                     $o .= $OUTPUT->notification(get_string('noguestentry', 'collaborate'));
                 }
             }
         }
         // Note: it is intentional that users don't see any message indicating that the meeting is scheduled to occur.
         // This can already be inferred by the title and times.
     } else {
         $o .= '<p>' . get_string('meetingtimepast', 'mod_collaborate', $times) . '</p>';
     }
     $o .= '</div>';
     return $o;
 }