/** * Service Hook for explorer * * @since 1.2 * @access public * @param string * @return */ public function explorer() { // Check for request forgeries Foundry::checkToken(); // Require the user to be logged in Foundry::requireLogin(); // Get the current view $view = $this->getCurrentView(); // Get the group object $groupId = JRequest::getInt('uid'); $group = Foundry::group($groupId); // Determine if the viewer can really view items if (!$group->canViewItem()) { return $view->call(__FUNCTION__); } // Load up the explorer library $explorer = Foundry::explorer($group->id, SOCIAL_TYPE_GROUP); $hook = JRequest::getCmd('hook'); $result = $explorer->hook($hook); $exception = Foundry::exception('Folder retrieval successful', SOCIAL_MSG_SUCCESS); return $view->call(__FUNCTION__, $exception, $result); }
/** * Service Hook for explorer * * @since 1.3 * @access public * @param string * @return */ public function explorer() { // Check for request forgeries Foundry::checkToken(); // Require the user to be logged in Foundry::requireLogin(); // Get the current view $view = $this->getCurrentView(); // Get the group object $eventId = $this->input->getint('uid'); $event = FD::event($eventId); // Determines if the current user is a guest of this event $guest = $event->getGuest($this->my->id); if (!$this->my->isSiteAdmin() && $event->isInviteOnly() && !$guest->isInvited() && !$guest->isGuest()) { $this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_NO_ACCESS_TO_EVENT'), SOCIAL_MSG_ERROR); return $this->view->call(__FUNCTION__); } // Load up the explorer library $explorer = Foundry::explorer($event->id, SOCIAL_TYPE_EVENT); $hook = JRequest::getCmd('hook'); $result = $explorer->hook($hook); $exception = Foundry::exception('Folder retrieval successful', SOCIAL_MSG_SUCCESS); return $view->call(__FUNCTION__, $exception, $result); }