Example #1
0
 public function readrssAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     if (!isset($this->params['type']) || !isset($this->params['id'])) {
         return;
     }
     $reader = new Oibs_Controller_Plugin_RssReader();
     //$admin = groupadmins->userIsAdmin
     $data = $reader->read($this->params['id'], $this->params['type']);
     $auth = Zend_Auth::getInstance();
     $isAdmin = false;
     if ($auth->hasIdentity()) {
         $isAdmin = $reader->isAdmin($auth->getIdentity()->user_id);
     }
     //echo strlen(json_encode($data));
     //echo strlen($this->view->partial('partials/rssreader.phtml', array("data" => $data)));
     echo $this->view->partial('partials/rssreader.phtml', array("data" => $data, "admin" => $isAdmin, 'link' => $reader->getEditLink()));
 }
Example #2
0
 /**
  * feedsAction
  *
  * @author Mikko Korpinen
  */
 public function feedsAction()
 {
     // User identity, group header and group menu:
     // Group id
     $grpId = $this->_request->getParam('groupid');
     $grpModel = new Default_Model_Groups();
     // Check if group exists
     if (!isset($grpId) || !$grpModel->groupExistsById($grpId)) {
         $target = $this->_urlHelper->url(array('controller' => 'group', 'action' => 'index', 'language' => $this->view->language), 'lang_default', true);
         $this->_redirector->gotoUrl($target);
     }
     // Group data
     $grpData = $this->getGroupData($grpId);
     // Menudata
     $menuData['id_grp'] = $grpId;
     $menuData['grp_action'] = 'feeds';
     $menuData['group_name_grp'] = $grpData['group_name_grp'];
     $menuData['grp_admins'] = $grpData['grp_admins'];
     // Set $this->view->...
     $this->view->grpData = $grpData;
     $this->view->menuData = $menuData;
     // Group feedsAction special stuff:
     // Get feeds
     $feedsModel = new Oibs_Controller_Plugin_RssReader();
     $hasFeeds = $feedsModel->hasFeeds($grpId, "group");
     $feedsData = array();
     $feedsData = $feedsModel->read($grpId, "group");
     $isAdmin = false;
     if ($grpData['user_identity']) {
         $isAdmin = $feedsModel->isAdmin($grpData['user_id']);
     }
     $editLink = $feedsModel->getEditLink();
     // Set $this->view->...
     $this->view->hasFeeds = $hasFeeds;
     $this->view->feeds = $feedsData;
     $this->view->isAdmin = $isAdmin;
     $this->view->editFeedsLink = $editLink;
 }