protected function displayAuthor(BlorgAuthor $author) { $view = SiteViewFactory::get($this->app, 'author'); $view->setPartMode('name', SiteView::MODE_SUMMARY); $view->setPartMode('bodytext', SiteView::MODE_NONE); $view->setPartMode('email', SiteView::MODE_NONE); $view->setPartMode('description', SiteView::MODE_ALL, false); $view->setPartMode('post_count', SiteView::MODE_NONE, false); $view->display($author); }
protected function getView() { $view = SiteViewFactory::get($this->app, 'building-block'); // configure views for display in list $view->getImageView()->setImageDimensionShortname('thumb'); $view->getXHTMLView()->setBodySummaryLength(200); $view->getXHTMLView()->setPartMode('body', SiteView::MODE_SUMMARY); // don't link attachments $view->getAttachmentView()->setPartMode('content', SiteView::MODE_ALL, false); return $view; }
protected function getView() { if ($this->view === null && $this->app !== null) { $this->view = SiteViewFactory::get($this->app, 'post-comment'); $this->view->setPartMode('bodytext', SiteView::MODE_SUMMARY); $this->view->setPartMode('permalink', SiteView::MODE_ALL, false); $this->view->setPartMode('author', SiteView::MODE_ALL, false); $this->view->setPartMode('link', SiteView::MODE_ALL, false); } return $this->view; }
protected function buildInternal() { parent::buildInternal(); $item_list = $this->getItemList('integer'); $blocks = SwatDB::query($this->app->db, sprintf('select * from Block where id in (%s)', $this->getItemList('integer')), SwatDBClassMap::get('BuildingBlockWrapper')); $view = SiteViewFactory::get($this->app, 'building-block'); $view->getImageView()->setImageDimensionShortname('thumb'); ob_start(); $header = new SwatHtmlTag('h1'); $header->setContent('Delete the following content?'); $header->display(); foreach ($blocks as $block) { $view->display($block); } $message = $this->ui->getWidget('confirmation_message'); $message->content = ob_get_clean(); $message->content_type = 'text/xml'; }
protected function displayComments() { if ($this->post->comment_status != SiteCommentStatus::CLOSED) { Blorg::displayAd($this->app, 'post_comments'); $div_tag = new SwatHtmlTag('div'); $div_tag->id = 'comments'; $div_tag->class = 'entry-comments'; $div_tag->open(); $comments = $this->post->getVisibleComments(); $view = SiteViewFactory::get($this->app, 'post-comment'); $count = count($comments); if ($count > 0) { echo '<h3 class="comments-title">', Blorg::_('Comments'), '</h3>'; } // display message for locked comments if ($this->post->comment_status == SiteCommentStatus::LOCKED) { $div_tag = new SwatHtmlTag('div'); $div_tag->class = 'comments-locked-message'; $div_tag->setContent(Blorg::_('Comments are locked. No additional comments may be ' . 'posted.')); $div_tag->display(); } foreach ($comments as $i => $comment) { if ($i == $count - 1) { $div_tag = new SwatHtmlTag('div'); $div_tag->id = 'last_comment'; $div_tag->open(); $view->display($comment); $div_tag->close(); } else { $view->display($comment); } } $div_tag->close(); } }
protected function displayPosts() { $view = SiteViewFactory::get($this->app, 'post'); $view->setPartMode('extended_bodytext', SiteView::MODE_SUMMARY); $first = true; foreach ($this->posts as $post) { if ($first) { $first_div = new SwatHtmlTag('div'); $first_div->class = 'entry-first'; $first_div->open(); $view->display($post); $first_div->close(); $first = false; } else { $view->display($post); } } }
protected function createCompositeViewForType($type) { return SiteViewFactory::get($this->app, $type); }
protected function getPostView() { $view = SiteViewFactory::get($this->app, 'post'); $view->setPathPrefix('../'); $view->setPartLink('author', false); $view->setPartLink('title', false); $view->setPartLink('permalink', false); $view->setPartLink('comment_count', false); $view->setPartLink('extended_bodytext', false); $view->setPartLink('author', false); return $view; }
protected function getView() { return SiteViewFactory::get($this->app, 'photo-comment'); }
protected function displayMonths() { $path = $this->app->config->blorg->path . 'archive'; $view = SiteViewFactory::get($this->app, 'post'); $view->setPartMode('title', SiteView::MODE_SUMMARY); $view->setPartMode('bodytext', SiteView::MODE_NONE); $view->setPartMode('extended_bodytext', SiteView::MODE_NONE); $view->setPartMode('tags', SiteView::MODE_NONE); $view->setPartMode('files', SiteView::MODE_NONE); $ul_tag = new SwatHtmlTag('ul'); $ul_tag->class = 'blorg-archive-months'; $ul_tag->open(); foreach ($this->months as $month => $posts) { $li_tag = new SwatHtmlTag('li'); $li_tag->open(); $heading_tag = new SwatHtmlTag('h4'); $heading_tag->class = 'blorg-archive-month-title'; $heading_tag->open(); $date = new SwatDate(); $date->setDate(2010, $month, 1); $anchor_tag = new SwatHtmlTag('a'); $anchor_tag->href = sprintf('%s/%s/%s', $path, $this->year, BlorgPageFactory::$month_names[$month]); $anchor_tag->setContent($date->getMonthName()); $anchor_tag->display(); $heading_tag->close(); $post_ul_tag = new SwatHtmlTag('ul'); $post_ul_tag->class = 'entries'; $post_ul_tag->open(); foreach ($posts as $post) { $post_li_tag = new SwatHtmlTag('li'); $post_li_tag->open(); $view->display($post); $post_li_tag->close(); } $post_ul_tag->close(); $li_tag->close(); } $ul_tag->close(); }
/** * @param SiteApplication $app the application in which to get the view. * @param BuildingBlock $block the block for which to get the view. The * block determines the view type that is * returned. * * @return BuildingBlockView a block view instance for displaying blocks * of the specified type. * * @see SwatViewFactory::get() * @see BuildingBlockViewFactory::getViewType() */ public static function getBlockView(SiteApplication $app, BuildingBlock $block) { return SiteViewFactory::get($app, self::getViewType($block)); }
/** * Displays search results for a collection of posts * * @param BlorgPostWrapper $posts the posts to display * search results for. */ protected function displayPosts(BlorgPostWrapper $posts) { $view = SiteViewFactory::get($this->app, 'post'); $view->setPartMode('bodytext', SiteView::MODE_SUMMARY); $view->setPartMode('extended_bodytext', SiteView::MODE_NONE); foreach ($posts as $post) { $view->display($post); } }
protected function buildComments() { $global_status = $this->app->config->pinhole->global_comment_status; if ($global_status === null) { $status = $this->photo->comment_status; } elseif ($global_status == true) { // comments are globally turned on $status = $this->app->config->pinhole->default_comment_status; } else { // comments are globally turned off $status = SiteCommentStatus::CLOSED; } if ($status !== SiteCommentStatus::CLOSED) { $comments = $this->photo->getVisibleComments(); if (count($comments) > 0) { $this->ui->getWidget('comments_frame')->visible = true; ob_start(); $div_tag = new SwatHtmlTag('div'); $div_tag->id = 'comments'; $div_tag->class = 'photo-comments'; $div_tag->open(); $view = SiteViewFactory::get($this->app, 'photo-comment'); foreach ($comments as $comment) { $view->display($comment); } $div_tag->close(); $this->ui->getWidget('comments')->content = ob_get_clean(); } ob_start(); $this->comment_ui->display(); $this->ui->getWidget('comments_ui')->content = ob_get_clean(); } }