private function renderStackNavigationPanel()
 {
     if ($this->stack) {
         return $this->renderer->getStackNavigationPanel($this->stack, $this->photo);
     } else {
         return '';
     }
 }
 protected function workupPhotos(&$photos)
 {
     $renderer = new photosPhotoHtmlRenderer($this->getTheme());
     $photo_model = new photosPhotoModel();
     // parent of current photo (that stacked, i.e. in stack)
     $parent_id = null;
     if ($this->photo_url) {
         $stacked_photo = $photo_model->getByField('url', $this->photo_url);
         if (!$stacked_photo) {
             throw new waException(_w('Page not found', 404));
         }
         $parent_id = $photo_model->getStackParentId($stacked_photo);
     }
     // During going over all photos we also look if some photo is a parent of current stacked photo
     foreach ($photos as &$photo) {
         $photo['stack_nav'] = '';
         $stack = (array) $photo_model->getStack($photo['id'], array('tags' => true));
         if ($stack) {
             foreach ($stack as &$item) {
                 $item['thumb_custom'] = array('url' => photosPhoto::getPhotoUrlTemplate($item));
                 $item['full_url'] = photosFrontendAlbum::getLink($this->album) . $item['url'] . '/';
             }
             unset($item);
             // iterable photo is parent of current stacked photo - replace
             if ($parent_id == $photo['id']) {
                 $photo = $stacked_photo;
                 $photo['full_url'] = photosFrontendAlbum::getLink($this->album) . $photo['url'] . '/';
                 $photo['stack_nav'] = $renderer->getStackNavigationPanel($stack, $photo);
             } else {
                 $photo['stack_nav'] = $renderer->getStackNavigationPanel($stack, $photo);
             }
         }
         $photo['frontend_link'] = photosFrontendPhoto::getLink($photo, array('full_url' => $this->album_url));
     }
     unset($photo);
 }