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'] . '&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; }