Esempio n. 1
0
 public function getSubscriptions($userId)
 {
     $rowSet = $this->fetchAll(array('user_id = ?' => $userId));
     $feeds = array();
     foreach ($rowSet as $row) {
         $feeds[] = $this->feeds->get($row->feed_id);
     }
     return $feeds;
 }
 public function viewAction()
 {
     if (!$this->_request->id) {
         $this->_helper->getHelper('Redirector')->goto('view', 'portal');
         return;
     }
     $this->view->id = $this->_request->id;
     $this->view->feed = $this->feeds->get($this->view->id);
     $this->view->group = $this->feeds->getGroup($this->view->feed['group_id']);
 }
 /**
  * The default action - show the home page
  */
 public function groupAction()
 {
     $user = $this->authenticate();
     // group view
     $feedId = (int) $this->getRequest()->getParam('feedId');
     if (!$feedId) {
         $feedId = Feeds::ROOT_GROUP_ID;
     }
     $currentFeed = $this->feeds->get($feedId);
     // get predessecors
     $this->view->parents = $this->feeds->listParents($feedId);
     if ($this->view->parents === null) {
         $this->view->parents = array();
         // XXX error!
     }
     $this->view->feed = $currentFeed;
     $visibleFeeds = $this->getSubscriptions($user['id'], $currentFeed);
     $this->view->feeds = $visibleFeeds;
     $this->view->user = $user;
 }