/** Retrieve a person's online accounts * @access public * @param integer $id */ public function OnlineAccountHtml($id) { $accts = new OnlineAccounts(); $data = $accts->getAccounts($id); if (count($data)) { return $this->buildHtml($data); } }
/** Profile page * @access public * @return void * @throws Pas_Exception_Param */ public function profileAction() { if ($this->getParam('id', false)) { $id = $this->getParam('id'); $staffs = new Contacts(); $this->view->persons = $staffs->getPersonDetails($id); $this->view->findstotals = $this->getFinds()->getFindsFloQuarter($id); $this->view->periodtotals = $this->getFinds()->getFindsFloPeriod($id); $accts = new OnlineAccounts(); $this->view->accts = $accts->getAccounts($id); } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }
/** Query slideshare for slideshare objects * * @param unknown_type $userid * @uses Zend_Service_SlideShare */ public function Slideshare($userid = NULL) { if (isset($userid)) { $online = new OnlineAccounts(); $ssid = $online->getSlideshare($userid); if (count($ssid)) { $ssidno = $ssid['0']['account']; $ss = new Zend_Service_SlideShare($this->_key, $this->_secret, $this->_username, $this->_password); $starting_offset = 0; $limit = 4; $ss_user = $ss->getSlideShowsByUserName($ssidno, $starting_offset, $limit); return $this->buildHtml($ss_user); } } }
/** Delete an account from social media * @access public * @return void */ public function deleteAction() { if ($this->_request->isPost()) { $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $where = array(); $where[] = $this->_accounts->getAdapter()->quoteInto('id = ?', $this->getParam('id')); $where[] = $this->_accounts->getAdapter()->quoteInto('userID = ?', $this->getIdentityForForms()); $this->_accounts->delete($where); } $this->redirect('/users/social'); $this->getFlash()->addMessage('Social profile deleted!'); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $this->view->service = $this->_accounts->fetchRow('id=' . $id); } } }
/** Get the data array from slideshare's api * @access public * @return array $shows */ public function getSlideshareData() { $shows = array(); $online = new OnlineAccounts(); $ssid = $online->getSlideshare($this->getUserID()); if (!empty($ssid)) { $ssidno = $ssid['0']['account']; $slideshare = new Zend_Service_SlideShare($this->getKey(), $this->getSecret(), $this->getUsername(), $this->getPassword()); $data = $slideshare->getSlideShowsByUserName($ssidno, $this->getOffset(), $this->getLimit()); foreach ($data as $slideshow) { $shows[] = array('title' => $slideshow->getTitle(), 'permalink' => $slideshow->getPermalink(), 'thumbnail' => $slideshow->getThumbnailUrl(), 'views' => $slideshow->getNumViews()); } } return $shows; }
/** Get account data * @access public * @param int $id * @return string */ public function getAccounts($id) { $accts = new OnlineAccounts(); return $accts->getAllAccounts($id); }
/** Display the accounts as foaf * * @param integer $id */ public function OnlineAccount($id) { $accts = new OnlineAccounts(); $data = $accts->getAccounts($id); return $this->view->partialLoop('partials/xml/foafAccts.phtml', $data); }