/**
  * show the contents of the view
  */
 function render()
 {
     $trackbacks = new Trackbacks();
     // get the trackbacks
     $postTrackbacks = $trackbacks->getArticleTrackbacks($this->_article->getId(), $this->_page, DEFAULT_ITEMS_PER_PAGE);
     $this->notifyEvent(EVENT_TRACKBACKS_LOADED, array("trackbacks" => &$postTrackbacks));
     $this->setValue("trackbacks", $postTrackbacks);
     // and the total number of trackbacks
     $numTrackbacks = $trackbacks->getNumTrackbacksArticle($this->_article->getId());
     // create and export the pager to the view
     $pager = new Pager("?op=editTrackbacks&articleId=" . $this->_article->getId() . "&page=", $this->_page, $numTrackbacks, DEFAULT_ITEMS_PER_PAGE);
     $this->setValue("pager", $pager);
     // pass the common data to the templates
     $this->setValue("post", $this->_article);
     parent::render();
 }
Пример #2
0
 /**
  * Returns an array of Trackback objects, with all the trackbacks that have been received for
  * this article.
  *
  * @return An array of Trackback objects.
  * @see Trackback
  */
 function getTrackbacks()
 {
     if ($this->_trackbacks == null) {
         $trackbacks = new Trackbacks();
         $this->_trackbacks = $trackbacks->getArticleTrackbacks($this->getId());
     }
     return $this->_trackbacks;
 }