コード例 #1
0
 /**
  * Returns an array of all blog entries.
  * 
  * @return mixed
  * Returns an array of all blog entries, or null if there are no
  * blog entries.
  */
 public function getAllBlogEntries()
 {
     $blogEntries = new Datasource_Cms_Connect_BlogEntries();
     return $blogEntries->getAll();
 }
コード例 #2
0
 /**
  * Controls the Connect blog summary page.
  */
 public function blogAction()
 {
     $this->view->currentPage = 'connect';
     $blogEntries = new Datasource_Cms_Connect_BlogEntries();
     $blogEntriesArray = $blogEntries->getAll();
     $mainBlogEntry = array();
     $summaryBlogEntries = array();
     $poolBlogEntries = array();
     foreach ($blogEntriesArray as $currentBlogEntry) {
         if ($currentBlogEntry['status'] == 1) {
             $mainBlogEntry[] = $currentBlogEntry;
         } else {
             if ($currentBlogEntry['status'] == 2) {
                 $summaryBlogEntries[] = $currentBlogEntry;
             } else {
                 $poolBlogEntries[] = $currentBlogEntry;
             }
         }
     }
     $this->view->connectBlogMain = $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $mainBlogEntry);
     $this->view->connectBlogSummary = $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $summaryBlogEntries);
     $this->view->connectBlogPool = $this->view->partialLoop('partials/connect-blog-entry-row.phtml', $poolBlogEntries);
     $passThrough = $this->_helper->getHelper('FlashMessenger')->getMessages();
     if (count($passThrough) > 0) {
         if (isset($passThrough[0]['saved'])) {
             if ($passThrough[0]['saved'] == true) {
                 $this->view->saved = true;
             }
         }
         if (isset($passThrough[0]['deleted'])) {
             if ($passThrough[0]['deleted'] == true) {
                 $this->view->deleted = true;
             }
         }
         if (isset($passThrough[0]['statusChanged'])) {
             if ($passThrough[0]['statusChanged'] == true) {
                 $this->view->statusChanged = true;
             }
         }
         if (isset($passThrough[0]['errorMessage'])) {
             $this->view->errorMessage = $passThrough[0]['errorMessage'];
         }
     }
 }