public function init()
 {
     parent::init();
     $search_ui = new SwatUI();
     $search_ui->loadFromXML(dirname(__FILE__) . '/browser-search.xml');
     $this->layout->startCapture('search_content');
     $search_ui->display();
     $this->layout->endCapture();
 }
 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();
     }
 }