示例#1
0
 public function vignetteIndividu($individu, $label = null, $urlOptions = array())
 {
     if (!$individu) {
         return;
     }
     $urlOptions = array_merge(array('controller' => 'individus', 'action' => 'fiche', 'individu' => $individu->slug), $urlOptions);
     $this->view->document->addStyleComponents('vignette');
     $label = $label ? $label : $individu->getFullname();
     $item = new Wtk_Container();
     $section = $item->addSection()->addFlags('wrapper');
     if ($this->view->assert(null, $individu, 'voir-avatar') && ($src = $individu->getCheminImage())) {
         $section->addImage($src, $individu->getFullname(), $individu->getFullname());
     } else {
         $section->addParagraph("Pas de photo")->addFlags('empty', 'image');
     }
     $item->addParagraph($label)->addFlags('label');
     if ($individu->slug) {
         $url = $this->view->url($urlOptions, true, true);
     } else {
         $url = null;
     }
     $link = new Wtk_Link($url, $label, $item);
     $link->addFlags('vignette', 'individu', 'avatar');
     return $link;
 }
示例#2
0
 public function vignettePhoto($photo, $label = null, $urlOptions = array())
 {
     if (!$photo) {
         return;
     }
     $urlOptions = array_merge(array('controller' => 'photos', 'action' => 'voir', 'photo' => $photo->slug), $urlOptions);
     $this->view->document->addStyleComponents('vignette');
     $label = $label ? $label : $photo;
     $page = Zend_Registry::get('page');
     $item = new Wtk_Container();
     $item->addSection()->addFlags('wrapper')->addImage($photo->getCheminVignette(), $photo->titre . ' ' . $page->metas->get('DC.Subject'), $photo->titre);
     $item->addParagraph($label)->addFlags('label');
     $link = new Wtk_Link($this->view->url($urlOptions, true, true) . '#document', $label, $item);
     $link->addFlags('vignette', 'photo', 'photo-' . $photo->slug);
     return $link;
 }
示例#3
0
 public function vignetteAlbum($album, $label = null, $urlOptions = array())
 {
     if (!$album) {
         return;
     }
     $this->view->document->addStyleComponents('vignette');
     $urlOptions = array_merge(array('controller' => 'photos', 'action' => 'consulter', 'album' => $album->slug), $urlOptions);
     $photo = $album->getPhotoAleatoire();
     $label = $label ? $label : $album->getIntituleCourt();
     $item = new Wtk_Container();
     $w = $item->addSection()->addFlags('wrapper');
     $item->addParagraph($label)->addFlags('label');
     $link = new Wtk_Link($this->view->url($urlOptions, true, true), $label, $item);
     $link->addFlags('vignette', 'album', 'album-' . $album->slug);
     if ($photo) {
         $w->addImage($photo->getCheminVignette(), $photo->titre, $album->getIntituleComplet());
     } else {
         $w->addParagraph("Pas d'image !")->addFlags('empty', 'image');
         $link->addFlags('empty');
     }
     return $link;
 }