Example #1
0
File: Show.php Project: vih/vih.dk
 function getSubContent()
 {
     $nyhed = new VIH_News($this->name());
     $pictures = $nyhed->getPictures();
     $pic_html = '';
     foreach ($pictures as $pic) {
         $file = new VIH_FileHandler($pic['file_id']);
         if ($file->get('id')) {
             $file->loadInstance('filgallerithumb');
         } else {
             continue;
         }
         $pic_uri = $file->getImageHtml();
         $file->loadInstance('medium');
         $pic_html .= '<p><a href="' . htmlspecialchars($file->get('file_uri')) . '" rel="lightbox">' . $pic_uri . '</a></p>';
     }
     return $pic_html;
 }
Example #2
0
 function renderHtml()
 {
     $nyhed = new VIH_News($this->name());
     if (is_numeric($this->query('sletbillede'))) {
         $nyhed->deletePicture($this->query('sletbillede'));
     }
     $pictures = $nyhed->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'] . '">Slet</a></div>';
     }
     $this->document->setTitle('Nyhed: ' . $nyhed->get('overskrift'));
     $this->document->addOption('Ret', $this->url('edit'));
     // $tpl->set('title', 'Nyhed');
     return '<div>' . autoop($nyhed->get('tekst')) . '</div> ' . $this->getForm()->toHTML() . $pic_html . $nyhed->get('date_updated');
 }