예제 #1
0
 function renderHtml()
 {
     $kursus = new VIH_Model_LangtKursus((int) $this->name());
     if (is_numeric($this->query('sletbillede'))) {
         $kursus->deletePicture($this->query('sletbillede'));
     }
     $pictures = $kursus->getPictures();
     $pic_html = '';
     foreach ($pictures as $pic) {
         $file = new VIH_FileHandler($pic['file_id']);
         if ($file->get('id')) {
             $file->loadInstance('small');
         }
         $pic_html .= '<div>' . $file->getImageHtml() . '<br /><a href="' . $this->url() . '?sletbillede=' . $pic['file_id'] . '&amp;id=' . $kursus->get('id') . '">Slet</a></div>';
     }
     $this->document->setTitle($kursus->getKursusNavn());
     $this->document->addOption('Kurser', $this->url('../'));
     $this->document->addOption('Ret', $this->url('edit'));
     $this->document->addOption('Lav en kopi', $this->url('copy'));
     $this->document->addOption('Slet', $this->url('delete'));
     $this->document->addOption('Rater', $this->url('rater'));
     $this->document->addOption('Perioder', $this->url('periode'));
     $this->document->addOption('Ministerium', $this->url('ministeriumliste'));
     $this->document->addOption('Elevuger', $this->url('elevuger'));
     $this->document->addOption('Tilmeldinger', $this->url('tilmeldinger'));
     $this->document->addOption('Holdlister', $this->url('../holdliste'));
     $data = array('kursus' => $kursus, 'subjects' => $this->getSubjects());
     $tpl = $this->template->create('langekurser/show');
     return $tpl->render($this, $data) . $this->getForm()->toHTML() . $pic_html;
 }
예제 #2
0
 function renderHtml()
 {
     $kursus = new VIH_Model_LangtKursus($this->context->name());
     $tilmeldinger = $kursus->getTilmeldinger();
     $this->document->setTitle('Tilmeldinger til ' . $kursus->getKursusNavn());
     $this->document->addOption('Alle kurser', $this->url('/langekurser'));
     $data = array('tilmeldinger' => $tilmeldinger, 'caption' => 'Tilmeldinger');
     $tpl = $this->template->create('langekurser/tilmeldinger');
     return $tpl->render($this, $data);
 }
예제 #3
0
파일: Show.php 프로젝트: vih/vih.dk
 function renderHtml()
 {
     $kursus = new VIH_Model_LangtKursus($this->name());
     $ansat = new VIH_Model_Ansat($kursus->get('ansat_id'));
     if ($ansat->get('id')) {
         $sprg_link = '<a href="' . $this->url('/underviser/' . $kursus->get('ansat_id')) . '">' . $ansat->get('navn') . ' svarer på spørgsmål</a>';
     } else {
         $sprg_link = '<a href="' . $this->url('/kontakt/') . '">Kontoret</a> svarer gerne på spørgsmål om kurset';
     }
     $pictures = $kursus->getPictures();
     $pic_html = '';
     if (count($pictures) > 0) {
         $pic_html .= '<div style="clear: both;">';
         foreach ($pictures as $pic) {
             $file = new VIH_FileHandler($pic['file_id']);
             if ($file->get('id')) {
                 $file->loadInstance('small');
             } else {
                 continue;
             }
             $pic_uri = $file->getImageHtml();
             $file->loadInstance('medium');
             $pic_html .= '<a href="' . htmlspecialchars($file->get('file_uri')) . '" rel="lightbox">' . $pic_uri . '</a>';
         }
         $pic_html .= '</div>';
     }
     if ($kursus->get('title')) {
         $title = $kursus->get('title') . ' ' . $kursus->get('aar');
     } else {
         $title = $kursus->get('kursusnavn');
     }
     $meta['description'] = $kursus->get('description');
     $meta['keywords'] = $kursus->get('keywords');
     $this->document->setTitle($kursus->getKursusNavn());
     $this->document->meta = $meta;
     $data = array('kursus' => $kursus, 'f*g' => $this->getSubjectsTable());
     $tpl = $this->template->create('LangtKursus/kursus');
     $content = array('content' => $tpl->render($this, $data) . $this->getInformationAboutCourse($kursus), 'content_sub' => $this->getSubContent($sprg_link));
     $tpl = $this->template->create('sidebar-wrapper');
     return $tpl->render($this, $content);
 }