protected function getContent() { $content = '<ol class="breadcrumb"> <li><a href="' . ROOT_DIR . 'admin/courseadmin">' . I18n::t('courseoverview.title') . '</a></li> <li class="active">' . $this->course->getName(I18n::getLang()) . '</li> </ol>'; $content .= '<table class="table table-hover"> <thead> <tr> <th>' . I18n::t('admin.lessonadmin.lessonnr') . '</th> <th>Name EN</th> <th>Name DE</th> <th>' . I18n::t('admin.lessonadmin.points') . '</th> <th>' . I18n::t('admin.lessonadmin.added') . '</th> <th colspan="2">' . I18n::t('text.edit') . '</th> </tr> </thead> <tbody>'; foreach ((array) Lesson::getMultipleLessons($this->course->getId(), 50, 0) as $lesson) { $content .= '<tr> <td>' . $lesson->getLessonNr() . '</td> <td>' . $lesson->getName('en') . '</td> <td>' . $lesson->getName('de') . '</td> <td>' . $lesson->getPoints() . '</td> <td>' . $lesson->timestampAdded() . '</td> <td><a class="btn btn-default btn-sm" href="' . ROOT_DIR . 'admin/tutorialadmin/' . $lesson->getId() . '">Tutorial</a></td> <td><a class="btn btn-default btn-sm" href="' . ROOT_DIR . 'admin/exerciseadmin/' . $lesson->getId() . '">' . I18n::t('exercises.title') . '</a></td> <td><form method="post"> <input type="hidden" name="action" value="deleteLesson" /> <input type="hidden" name="lessonId" value="' . $lesson->getId() . '" /> <input type="submit" class="btn btn-default btn-sm" value="' . I18n::t('button.delete') . '" /> </form></td> </tr>'; } $content .= '</tbody> </table>'; return $content; }
?> </li> </ol> <h1><?php echo $course->getName(I18n::getLang()); ?> </h1> <p> <?php echo I18n::t('course.text'); ?> </p> <?php $lessons = Lesson::getMultipleLessons($courseId, 20, 0); foreach ($lessons as $lesson) { $percentage = Exercise::getPercentageCorrect($_SESSION['user']->getEmail(), $lesson->getId()); $width = $percentage > 3 ? $percentage : 3; echo '<a href="' . ROOT_DIR . 'lesson/' . $lesson->getId() . '"> <div class="jumbotron course"> ' . $lesson->getLessonNr() . ') ' . $lesson->getName(I18n::getLang()) . ' <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="' . $percentage . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $width . '%;"> ' . $percentage . '% </div> </div> </div> </a>'; }