protected function initInternal() { AdminIndex::initInternal(); $this->id = SiteApplication::initVar('id'); if (is_numeric($this->id)) { $this->id = intval($this->id); } $this->initCredit(); $this->initInquisition(); $this->ui->loadFromXML($this->getUiXml()); $local_ui = new SwatUI(); $local_ui->loadFromXML($this->getCreditDetailsViewXml()); $provider_titles = array(); foreach ($this->credit->front_matter->providers as $provider) { $provider_titles[] = $provider->credit_title_plural; } $local_ui->getWidget('details_view')->getField('hour')->title = SwatString::toList($provider_titles); $view = $this->ui->getWidget('details_view'); foreach ($local_ui->getWidget('details_view')->getFields() as $field) { $view->appendField($field); } }
protected function displayContent() { $this->ui->getWidget('content')->display(); }
private function displayPhotoGrid(PinholePhotoWrapper $photos, $tag_list, array $box) { $ui = new SwatUI(); $ui->loadFromXml(dirname(__FILE__) . '/map-tile.xml'); $store = new SwatTableStore(); foreach ($photos as $photo) { $ds = new SwatDetailsStore(); $ds->photo = $photo; $ds->root_path = $this->app->config->pinhole->path; $ds->path = 'photo/' . $photo->id; if ($tag_list !== null) { $ds->path .= '?' . $tag_list; } $ds->display_title = $this->app->config->pinhole->browser_index_titles; $store->add($ds); } $ui->getWidget('photo_view')->model = $store; $locale = SwatI18NLocale::get(); $h3_tag = new SwatHtmlTag('h3'); $h3_tag->setContent(sprintf(Pinhole::_('%s Photos, Displaying %s to %s'), $locale->formatNumber($this->photo_count), $locale->formatNumber(1), $locale->formatNumber(count($photos)))); $h3_tag->display(); if (count($photos) > 3) { echo '<div class="fixed-width-marker">'; $ui->display(); echo '</div>'; } else { $ui->display(); } if (count($photos) < $this->photo_count) { $a_tag = new SwatHtmlTag('a'); $a_tag->class = 'more-photos-link'; $a_tag->setContent(sprintf(Pinhole::_('View All %s Photos'), $locale->formatNumber($this->photo_count))); if ($box['min_latitude'] == $box['max_latitude'] && $box['min_longitude'] == $box['max_longitude']) { $a_tag->href = sprintf('tag?gps.latitude=%s/gps.longitude=%s', $box['min_latitude'], $box['min_longitude']); } else { $a_tag->href = sprintf('tag?gps.box=%sx%s|%sx%s', $box['max_latitude'], $box['min_longitude'], $box['min_latitude'], $box['max_longitude']); } if ($tag_list !== null) { $a_tag->href .= '/' . $tag_list; } $a_tag->display(); } }