Пример #1
0
 function renderHtml()
 {
     $f*g = new VIH_Model_Fag($this->name());
     $undervisere = $f*g->getUndervisere();
     $title = $f*g->get('title');
     if (empty($title)) {
         $title = $f*g->get('navn');
     }
     $meta['description'] = $f*g->get('description');
     $meta['keywords'] = $f*g->get('keywords');
     $this->document->setTitle($title);
     $this->document->meta = $meta;
     $this->document->theme = $f*g->get('identifier');
     if ($this->query('show') == 'udvidet') {
         $this->document->body_class = 'widepicture';
         $this->document->sidepicture = $this->getPictureHTML($f*g->get('identifier'));
     } else {
         $this->document->body_class = 'sidepicture';
         $this->document->widepicture = $this->getWidePictureHTML($f*g->get('identifier'));
     }
     $data = array('content' => '
         <div class="fit"><h1>' . $f*g->get('navn') . '</h1>
         ' . autoop($f*g->get('beskrivelse')) . '
         ' . $this->getUdvidetBeskrivelse($f*g) . '</div>', 'content_sub' => $this->getVideo() . '
         <h2>Spørgsmål?</h2>
         ' . $this->getUndervisereHTML($f*g->getUndervisere()) . $this->getSubContent($f*g->get('identifier')));
     $tpl = $this->template->create('sidebar-wrapper');
     return $tpl->render($this, $data);
 }
Пример #2
0
 function renderHtml()
 {
     $f*g = VIH_Model_Fag::getList();
     foreach ($f*g as $f) {
         $faglist[$f->get('id')] = $f->get('navn');
     }
     $f*g = new VIH_Model_Fag($this->context->name());
     $underviser_selected = array();
     $undervisere = $f*g->getUndervisere();
     foreach ($undervisere as $underviser) {
         $underviser_selected[$underviser->get('id')] = true;
     }
     $defaults = array('id' => $f*g->get('id'), 'navn' => $f*g->get('navn'), 'identifier' => $f*g->get('identifier'), 'title' => $f*g->get('title'), 'description' => $f*g->get('description'), 'keywords' => $f*g->get('keywords'), 'beskrivelse' => $f*g->get('beskrivelse'), 'kort_beskrivelse' => $f*g->get('kort_beskrivelse'), 'udvidet_beskrivelse' => $f*g->get('udvidet_beskrivelse'), 'published' => $f*g->get('published'), 'faggruppe_id' => $f*g->get('faggruppe_id'), 'underviser' => $underviser_selected);
     $this->getForm()->setDefaults($defaults);
     $this->document->setTitle('Rediger f*g');
     return $this->getForm()->toHTML();
 }