public static function show_schedule_detail($schedule)
 {
     $tab2 = new html_table();
     $tab2->align = array('right', 'left');
     $tab2->cellpadding = '2px';
     $tab2->attributes['class'] = "twocolstable";
     $tab2->data[] = array(get_string('time') . ":", userdate($schedule->timestart, get_string('strftimedayshort')) . "  " . userdate($schedule->timestart, get_string('strftimetime')) . " - " . userdate($schedule->timeend, get_string('strftimetime')));
     $tab2->data[] = array(get_string('schoolroom', 'praxe') . ":", s($schedule->schoolroom));
     $tab2->data[] = array(get_string('yearclass', 'praxe') . ":", praxe_get_yearclass($schedule->yearclass));
     $tab2->data[] = array(get_string('subject', 'praxe') . ":", s($schedule->lessubject));
     $tab2->data[] = array(get_string('lesson_theme', 'praxe') . ":", format_text($schedule->lestheme));
     return "<h3>" . get_string('lessondetail', 'praxe') . "</h3>" . html_writer::table($tab2);
 }
 public function show_schedule($schedules, $boolReturn = true, $editlinks = array())
 {
     global $CFG, $OUTPUT;
     if (!$schedules) {
         $ret = get_string('no_schedule_items', 'praxe');
         if ($boolReturn) {
             return $ret;
         } else {
             $this->content .= $ret;
             return true;
         }
     }
     $table = new html_table();
     $table->head = array(get_string('date'), get_string('lesson_number', 'praxe'), get_string('time'), get_string('yearclass', 'praxe'), get_string('schoolroom', 'praxe'), get_string('subject', 'praxe'), get_string('lesson_theme', 'praxe'), get_string('edit'), get_string('inspection', 'praxe'));
     $table->align = array('left', 'center', 'center', 'center', 'center', 'left', 'left', 'center', 'center');
     $editable = praxe_has_capability('editstudentschedule') || praxe_has_capability('manageallincourse');
     $params = $editlinks;
     $delparams = array('praxeaction' => 'deleteschedule');
     foreach ($schedules as $item) {
         if (is_null($item->lesnumber)) {
             $item->lesnumber = "---";
         } else {
             $item->lesnumber .= ".";
         }
         $row = array(userdate((int) $item->timestart, get_string('strftimedateshort')), $item->lesnumber, userdate((int) $item->timestart, "%H:%M") . ' - ' . userdate((int) $item->timeend, "%H:%M"), praxe_get_yearclass($item->yearclass), s($item->schoolroom), s($item->lessubject), format_text($item->lestheme));
         if ($editable && $item->timestart - PRAXE_TIME_TO_EDIT_SCHEDULE > time()) {
             $params['scheduleid'] = $item->id;
             $delparams['scheduleid'] = $item->id;
             $row[] = $OUTPUT->action_icon(praxe_get_base_url($params), new pix_icon('t/edit', get_string('edit'))) . $OUTPUT->action_icon(praxe_get_base_url($delparams), new pix_icon('t/delete', get_string('delete')));
         } else {
             $row[] = "---";
         }
         if (count($item->inspectors)) {
             $ins = "";
             foreach ($item->inspectors as $insp) {
                 $ins .= "<div class=\"inspector right\">" . $OUTPUT->render(new pix_icon('icon_inspect', get_string('inspection', 'praxe'), 'praxe')) . "&nbsp;" . praxe_get_user_fullname($insp) . "</div>";
             }
             $row[] = $ins;
         } else {
             $row[] = "&nbsp;";
         }
         $table->data[] = $row;
     }
     if ($boolReturn) {
         return html_writer::table($table);
     } else {
         $this->content .= html_writer::table($table);
         return true;
     }
 }