/** * Wraps the provided album * * @since 1.0 * @access public */ public function renderItem($options = array()) { // Flag to determine if resize mode was enforced $resizeModeEnforced = !empty($options['resizeMode']); // Normalize render options $options = array_merge($this->renderItemOptions, $options); // If resize mode was not enforced if (!$resizeModeEnforced) { // Automatically determine if we should use cover or contain based on item layout. $options['resizeMode'] = $options['layout'] == 'item' ? 'cover' : 'contain'; } // Build user alias $creator = $this->creator(); $viewer = FD::user($options['viewer']); // Generate photo item template $theme = FD::themes(); // Get the album library $albumLib = $this->album(); $theme->set('lib', $this); $theme->set('tags', $this->data->getTags()); $theme->set('comments', $this->comments()); $theme->set('likes', $this->likes()); $theme->set('shares', $this->reposts()); $theme->set('albumLib', $albumLib); $theme->set('album', $albumLib->data); $theme->set('photo', $this->data); $theme->set('creator', $creator); $theme->set('privacy', $this->privacy()); $theme->set('options', $options); return $theme->output($options['template']); }
/** * Retrieves a list of tag recipients on a photo * * @since 1.2 * @access private */ private function getTagRecipients(&$recipients, SocialTablePhoto &$photo, $exclusion = array()) { // Get a list of tagged users $tags = $photo->getTags(true); if (!$tags) { return; } foreach ($tags as $tag) { if (!in_array($tag->uid, $exclusion)) { $recipients[] = $tag->uid; } } }