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(); }
public function finalize() { parent::finalize(); $this->layout->addHtmlHeadEntrySet($this->ui->getRoot()->getHtmlHeadEntrySet()); if (count($this->tag_list) > 0) { $this->layout->data->feed_link = 'feed?' . $this->tag_list->__toString(); } }
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); } }
return $path . '/' . $tag->shortname; } // }}} // {{{ public static function getAuthorRelativeUri() public static function getAuthorRelativeUri(SiteApplication $app, BlorgAuthor $author) { $path = $app->config->blorg->path . 'author'; return $path . '/' . $author->shortname; } // }}} // {{{ public static function getCommentRelativeUri() public static function getCommentRelativeUri(SiteApplication $app, SiteComment $comment) { return Blorg::getPostRelativeUri($app, $comment->post) . '#comment' . $comment->id; } // }}} // {{{ private function __construct() /** * Prevent instantiation of this static class */ private function __construct() { } } Blorg::setupGettext(); SwatUI::mapClassPrefixToPath('Blorg', 'Blorg'); SiteViewFactory::addPath('Blorg/views'); SiteViewFactory::registerView('post', 'BlorgPostView'); SiteViewFactory::registerView('post-comment', 'BlorgCommentView'); SiteViewFactory::registerView('author', 'BlorgAuthorView'); SiteGadgetFactory::addPath('Blorg/gadgets');
public static function setupGettext() { $path = '@DATA-DIR@/Building/locale'; if (substr($path, 0, 1) === '@') { $path = __DIR__ . '/../locale'; } bindtextdomain(self::GETTEXT_DOMAIN, $path); bind_textdomain_codeset(self::GETTEXT_DOMAIN, 'UTF-8'); } // }}} // {{{ private function __construct() /** * Don't allow instantiation of the Building object * * This class contains only static methods and should not be instantiated. */ private function __construct() { } } Building::setupGettext(); SiteViewFactory::addPath('Building/views'); SiteViewFactory::registerView('building-block-audio', 'BuildingBlockAudioView'); SiteViewFactory::registerView('building-block-video', 'BuildingBlockVideoView'); SiteViewFactory::registerView('building-block-image', 'BuildingBlockImageView'); SiteViewFactory::registerView('building-block-xhtml', 'BuildingBlockXHTMLView'); SiteViewFactory::registerView('building-block-attachment', 'BuildingBlockAttachmentView'); SiteViewFactory::registerView('building-block', 'BuildingBlockCompositeView'); SiteViewFactory::registerView('building-block-admin', 'BuildingBlockAdminCompositeView'); SwatUI::mapClassPrefixToPath('Building', 'Building');
// {{{ public static function setupGettext() public static function setupGettext() { $path = '@DATA-DIR@/Deliverance/locale'; if (substr($path, 0, 1) === '@') { $path = dirname(__FILE__) . '/../locale'; } bindtextdomain(Deliverance::GETTEXT_DOMAIN, $path); bind_textdomain_codeset(Deliverance::GETTEXT_DOMAIN, 'UTF-8'); } // }}} // {{{ public static function getConfigDefinitions() /** * Gets configuration definitions used by the Deliverance package * * Applications should add these definitions to their config module before * loading the application configuration. * * @return array the configuration definitions used by the Deliverance * package. * * @see SiteConfigModule::addDefinitions() */ public static function getConfigDefinitions() { return array('deliverance.list_connection_timeout' => 1, 'deliverance.list_admin_connection_timeout' => 5, 'deliverance.list_script_connection_timeout' => 300, 'deliverance.campaign_from_name' => null, 'deliverance.campaign_from_address' => null, 'deliverance.segment_include_addresses' => null, 'deliverance.campaign_cdn_base' => null, 'deliverance.automatic_analytics_tagging' => false, 'deliverance.analytics_utm_source' => null, 'deliverance.analytics_utm_medium' => 'email', 'deliverance.analytics_utm_campaign' => '%s', 'mail_chimp.double_opt_in' => false, 'mail_chimp.api_key' => null, 'mail_chimp.user_id' => null, 'mail_chimp.default_list' => null, 'mail_chimp.default_folder' => null, 'mail_chimp.preview_url' => 'http://%s.campaign-archive.com/?u=%s&id=%s', 'mail_chimp.list_title' => null, 'mail_chimp.source' => null); } } Deliverance::setupGettext(); SwatUI::mapClassPrefixToPath('Deliverance', 'Deliverance'); SwatDBClassMap::addPath('Deliverance/dataobjects');
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(); } }