/** * renders this view * * @return nothing */ function render() { // if our view is cached, there is not much to do here... if ($this->isCached()) { parent::render(); return true; } // get the next and previous articles, based on the article we're going to show $article = $this->getValue('post'); // notify of certain events $postText = $article->getIntroText(); $postExtendedText = $article->getExtendedText(); $this->_pm->notifyEvent(EVENT_TEXT_FILTER, array('text' => &$postText)); $this->_pm->notifyEvent(EVENT_TEXT_FILTER, array('text' => &$postExtendedText)); $article->setIntroText($postText); $article->setExtendedText($postExtendedText); // and yet one event more $this->_pm->notifyEvent(EVENT_POST_LOADED, array('article' => &$article)); // once ready, put the article back to the context of the view $this->setValue('post', $article); $this->setValue('comments', $article->getComments()); $this->setValue('user', $article->getUser()); $this->setValue('trackbacks', $article->getTrackbacks()); // render the main view parent::render(); }
/** * renders the error message */ function render() { if (!empty($this->_message)) { $this->setValue("message", $this->_message); } parent::render(); }
/** * Renders the view. It simply gets all the parameters we've been adding to it * and puts them in the context of the template renderer so that they can be accessed * as normal parameters from within the template * * @return Returns a rendered template */ function render() { // assign all the values $blogSettings = $this->_blogInfo->getSettings(); $templateSet = $blogSettings->getValue("template"); $this->_template->assign($this->_params->getAsArray()); $ts = new TemplateSets(); $storage = new TemplateSetStorage(); if ($ts->isBlogTemplate($templateSet, $this->_blogInfo->getId())) { $blogTemplate = $storage->getTemplateFolder($templateSet, $this->_blogInfo->getId()); } else { $blogTemplate = $storage->getTemplateFolder($templateSet); } $this->_template->assign("blogtemplate", $blogTemplate); parent::render(); }
/** * This view shows a list of the posts for the blog. * * The blog we are going to show is determined by: * 1) blogId parameter in the $_REQUEST * 2) blogId parameter in the session * 3) default_blog_id parameter from the configuration file */ function render() { // load the contents into the template context $blogSettings = $this->_blogInfo->getSettings(); // we have to keep in mind that the things below only need to be done // in case that the view is not cached, otherwise we will get a warning message // because there are no posts to process! (the action will not load any data if the // view is cached) if (!$this->isCached()) { // check if we have to cut the posts to a determined amount of words and // then show the "show more" link... //if( $blogSettings->getValue( 'show_more_enabled' ) == true && !$this->isCached()) { if ($blogSettings->getValue('show_more_enabled') == true) { $this->_addShowMoreLink(); } } parent::render(); }