예제 #1
0
 function renderHtml()
 {
     $facilitet = new VIH_Model_Facilitet($this->name());
     if (is_numeric($this->query('sletbillede'))) {
         if (!$facilitet->deletePicture($this->query('sletbillede'))) {
             throw new Exception('Kan ikke slette billedet');
         }
         $facilitet->load();
     }
     $file = new VIH_FileHandler($facilitet->get('pic_id'));
     $extra_html = '';
     if ($file->get('id') > 0) {
         $file->loadInstance('small');
         $extra_html = $file->getImageHtml();
         if (!empty($extra_html)) {
             $extra_html .= ' <br /><a href="' . $this->url('/faciliteter/' . $this->name(), array('sletbillede' => $facilitet->get('pic_id'))) . '">slet billede</a>';
         }
     }
     if (empty($extra_html)) {
         $extra_html = $this->getForm()->toHTML();
     }
     $this->document->setTitle($facilitet->get('navn'));
     $this->document->addOption('Ret', $this->url('edit'));
     return '<div>' . nl2br($facilitet->get('beskrivelse')) . '</div>   ' . $extra_html;
 }
예제 #2
0
 function renderHtml()
 {
     $this->document->setTitle('Rediger Facilitet');
     if ($this->context->name()) {
         $facilitet = new VIH_Model_Facilitet($this->context->name());
         $this->getForm()->setDefaults(array('navn' => $facilitet->get('navn'), 'kategori_id' => $facilitet->get('kategori_id'), 'beskrivelse' => $facilitet->get('beskrivelse'), 'title' => $facilitet->get('title'), 'keywords' => $facilitet->get('keywords'), 'description' => $facilitet->get('description'), 'identifier' => $facilitet->get('identifier'), 'published' => $facilitet->get('published')));
     } else {
         $facilitet = new VIH_Model_Facilitet();
     }
     return $this->getForm()->toHTML();
 }
예제 #3
0
파일: Show.php 프로젝트: vih/vih.dk
 function GET()
 {
     $id = strip_tags($this->name());
     $facilitet = new VIH_Model_Facilitet($id);
     $file = new VIH_FileHandler($facilitet->get('pic_id'));
     $file->loadInstance('medium');
     $html = $file->getImageHtml();
     $title = $facilitet->get('navn');
     $meta['description'] = $facilitet->get('description');
     $meta['keywords'] = '';
     $this->document->setTitle($title);
     $this->document->meta = $meta;
     $this->document->theme = 'faciliteter';
     $data = array('content' => '
         <h1>' . $facilitet->get('navn') . '</h1>
         ' . $html . '
         <div>' . autoop($facilitet->get('beskrivelse')) . '</div>', 'content_sub' => $this->getFaciliteterList());
     $tpl = $this->template->create('sidebar-wrapper');
     return $tpl->render($this, $data);
 }