コード例 #1
0
 public function renderStats($id)
 {
     $course = $this->courseRegistry->course;
     if (!$this->user->isAllowed('course', 'viewStats')) {
         throw new \Nette\Application\BadRequestException('Forbidden', 403);
     }
     $this->template->course = $course;
     $this->template->reviewStats = $this->courseRepository->getReviewStats($course);
     $this->template->submittedReviews = $this->courseRepository->getSubmittedReviewsStats($course);
     $this->template->problems = $this->courseRepository->getProblemReviewsStats($course);
 }
コード例 #2
0
 public function renderHtml($id, $toFile = FALSE)
 {
     $messages = $this->messageRepository->findLatest($this->courseRepository->find($id));
     $content = '';
     foreach ($messages as $message) {
         $content .= '<div class="message">' . Markdown::defaultTransform('[**' . $message->user->name . '**](' . $this->link('User:default', $message->user->id) . ') ' . $message->text) . '</div>';
     }
     if ($toFile) {
         $this->generatedFilesStorage->save($content, $id, 'html', '/chat/');
         echo $content;
         $this->terminate();
     } else {
         echo $content;
     }
     $this->terminate();
 }
コード例 #3
0
 public function renderDefault()
 {
     $this->deliver(array_reverse($this->courseRepository->findAll()));
 }