示例#1
0
 protected function buildSiteLinks()
 {
     $replicator = $this->ui->getWidget('site_link_field');
     foreach ($this->getDimensions() as $dimension) {
         if ($dimension->shortname == 'original') {
             $image = $this->photo->getTitle(true);
             $link = $this->photo->getUri('original');
         } else {
             $image = $this->photo->getImgTag($dimension->shortname);
             $image->src = $this->app->getFrontendBaseHref() . $image->src;
             $link = 'photo/' . $this->photo->id;
         }
         $code = sprintf('<a href="%s%s">%s</a>', $this->app->getFrontendBaseHref(), $link, $image);
         $replicator->getWidget('site_link_code', $dimension->id)->value = $code;
     }
 }
 protected function displayPhoto()
 {
     $width = $this->photo->getWidth($this->dimension->shortname);
     $height = $this->photo->getHeight($this->dimension->shortname);
     $panorama = $width > $this->dimension->max_width || $height > $this->dimension->max_height;
     $next_prev = $this->tag_list->getNextPrevPhotos($this->photo);
     if ($next_prev['next'] !== null) {
         $href = sprintf('%sphoto/%s', $this->app->config->pinhole->path, $next_prev['next']->id);
         if (count($this->tag_list) > 0) {
             $href .= '?' . $this->tag_list->__toString();
         }
         $a_tag = new SwatHtmlTag('a');
         $a_tag->href = $href;
         $a_tag->title = Pinhole::_('View next image');
         $a_tag->open();
     }
     $img_tag = $this->photo->getImgTag($this->dimension->shortname);
     $img_tag->class = 'pinhole-photo pinhole-photo-primary';
     $img_tag->display();
     if ($next_prev['next'] !== null) {
         $a_tag->close();
     }
 }
示例#3
0
 protected function getPhotoContent(PinholePhoto $photo, PinholeImageDimension $dimension)
 {
     ob_start();
     $div_tag = new SwatHtmlTag('div');
     $div_tag->open();
     $img = $photo->getImgTag($dimension->shortname);
     $img->src = $this->app->getBaseHref() . $img->src;
     $img->display();
     if ($photo->description !== null) {
         $div_tag = new SwatHtmlTag('div');
         $div_tag->setContent($photo->description, 'text/xml');
         $div_tag->display();
     }
     $div_tag->close();
     return ob_get_clean();
 }
 private function displaySinglePhoto(PinholePhoto $photo, $tag_list)
 {
     $a_tag = new SwatHtmlTag('a');
     $a_tag->href = sprintf('%sphoto/%s', $this->app->config->pinhole->path, $photo->id);
     if ($tag_list !== null) {
         $a_tag->href .= '?' . $tag_list;
     }
     $a_tag->open();
     echo $photo->getImgTag('small')->__toString();
     if ($photo->getTitle() != '') {
         $h2_tag = new SwatHtmlTag('div');
         $h2_tag->setContent($photo->getTitle());
         $h2_tag->display();
     }
     $a_tag->close();
 }