Example #1
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     $group = FD::group($groupId);
     // Render the rss model
     $model = FD::model('RSS');
     $result = $model->getItems($group->id, SOCIAL_TYPE_GROUP);
     // If there are tasks, we need to bind them with the table.
     $feeds = array();
     if ($result) {
         foreach ($result as $row) {
             // Bind the result back to the note object.
             $rss = FD::table('Rss');
             $rss->bind($row);
             // Initialize the parser.
             $parser = @JFactory::getFeedParser($rss->url);
             $rss->parser = $parser;
             $rss->total = @$parser->get_item_quantity();
             $rss->items = @$parser->get_items();
             $feeds[] = $rss;
         }
     }
     // Get the app params
     $params = $this->app->getParams();
     $limit = $params->get('total', 5);
     $this->set('totalDisplayed', $limit);
     $this->set('appId', $this->app->id);
     $this->set('group', $group);
     $this->set('feeds', $feeds);
     echo parent::display('views/default');
 }
Example #2
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.3
  * @access   public
  * @param    int        The event id
  */
 public function display($id = null, $docType = null)
 {
     // Load up the event
     $event = FD::event($id);
     // Check if the viewer is really allowed to view news
     if ($event->isInviteOnly() && $event->isClosed() && !$event->getGuest()->isGuest() && !$this->my->isSiteAdmin()) {
         FD::info()->set(false, JText::_('COM_EASYSOCIAL_EVENTS_ONLY_GUEST_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($event->getPermalink(false));
     }
     $params = $this->app->getParams();
     // Set the max length of the item
     $options = array('limit' => (int) $params->get('total', 10));
     $model = FD::model('Clusters');
     $items = $model->getNews($event->id, $options);
     $pagination = $model->getPagination();
     // Format the item's content.
     $this->format($items, $params);
     $pagination->setVar('option', 'com_easysocial');
     $pagination->setVar('view', 'events');
     $pagination->setVar('layout', 'item');
     $pagination->setVar('id', $event->getAlias());
     $pagination->setVar('appId', $this->app->getAlias());
     $this->set('params', $params);
     $this->set('pagination', $pagination);
     $this->set('event', $event);
     $this->set('items', $items);
     echo parent::display('canvas/default');
 }
Example #3
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($eventId = null, $docType = null)
 {
     $event = FD::event($eventId);
     // Check if the viewer is allowed here.
     if (!$event->canViewItem()) {
         return $this->redirect($event->getPermalink(false));
     }
     // Get app params
     $params = $this->app->getParams();
     $model = FD::model('Discussions');
     $options = array('limit' => $params->get('total', 10));
     $discussions = $model->getDiscussions($event->id, SOCIAL_TYPE_EVENT, $options);
     $pagination = $model->getPagination();
     $pagination->setVar('option', 'com_easysocial');
     $pagination->setVar('view', 'events');
     $pagination->setVar('layout', 'item');
     $pagination->setVar('id', $event->getAlias());
     $pagination->setVar('appId', $this->app->getAlias());
     $this->set('app', $this->app);
     $this->set('params', $params);
     $this->set('pagination', $pagination);
     $this->set('event', $event);
     $this->set('discussions', $discussions);
     echo parent::display('events/default');
 }
Example #4
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $event = FD::event($uid);
     $editor = JFactory::getEditor();
     $guest = $event->getGuest();
     // Only allow group admin to create or edit news
     if (!$guest->isAdmin() && !$this->my->isSiteAdmin()) {
         FD::info()->set(false, JText::_('COM_EASYSOCIAL_EVENTS_ONLY_GUEST_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($event->getPermalink(false));
     }
     // Determines if this item is being edited
     $id = $this->input->get('newsId', 0, 'int');
     $news = FD::table('EventNews');
     $news->load($id);
     FD::page()->title(JText::_('APP_EVENT_NEWS_FORM_UPDATE_PAGE_TITLE'));
     // Determine if this is a new record or not
     if (!$id) {
         $news->comments = true;
         FD::page()->title(JText::_('APP_EVENT_NEWS_FORM_CREATE_PAGE_TITLE'));
     }
     // Get app params
     $params = $this->app->getParams();
     $this->set('params', $params);
     $this->set('news', $news);
     $this->set('editor', $editor);
     $this->set('event', $event);
     echo parent::display('canvas/form');
 }
Example #5
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $group = FD::group($uid);
     $editor = JFactory::getEditor();
     // Only allow group admin to create or edit news
     if (!$group->isAdmin() && !$this->my->isSiteAdmin()) {
         FD::info()->set(false, JText::_('COM_EASYSOCIAL_GROUPS_ONLY_MEMBER_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($group->getPermalink(false));
     }
     $id = JRequest::getInt('newsId');
     $news = FD::table('GroupNews');
     $news->load($id);
     FD::page()->title(JText::_('APP_GROUP_NEWS_FORM_UPDATE_PAGE_TITLE'));
     // Determine if this is a new record or not
     if (!$id) {
         $news->comments = true;
         FD::page()->title(JText::_('APP_GROUP_NEWS_FORM_CREATE_PAGE_TITLE'));
     }
     // Get app params
     $params = $this->app->getParams();
     $this->set('params', $params);
     $this->set('news', $news);
     $this->set('editor', $editor);
     $this->set('group', $group);
     echo parent::display('canvas/form');
 }
Example #6
0
 /**
  * Displays the application output in the canvas.
  *
  * @since   1.3
  * @access  public
  * @param   integer $uid    The event id.
  */
 public function display($uid = null, $docType = null)
 {
     $event = FD::event($uid);
     // Check if the viewer is allowed here.
     if (!$event->canViewItem()) {
         return $this->redirect($event->getPermalink(false));
     }
     // Get app params
     $params = $this->app->getParams();
     // Load the milestone
     $id = JRequest::getInt('milestoneId');
     $milestone = FD::table('Milestone');
     $milestone->load($id);
     if (!empty($milestone->id)) {
         FD::page()->title(JText::_('APP_EVENT_TASKS_TITLE_EDITING_MILESTONE'));
     } else {
         FD::page()->title(JText::_('APP_EVENT_TASKS_TITLE_CREATE_MILESTONE'));
     }
     // Get a list of members from the group
     $members = FD::model('Events')->getMembers($event->id);
     $this->set('members', $members);
     $this->set('milestone', $milestone);
     $this->set('params', $params);
     $this->set('event', $event);
     echo parent::display('views/form');
 }
Example #7
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $event = FD::event($uid);
     // Get the article item
     $news = FD::table('EventNews');
     $news->load($this->input->get('newsId', 0, 'int'));
     // Check if the user is really allowed to view this item
     if (!$event->canViewItem()) {
         return $this->redirect($event->getPermalink(false));
     }
     // Get the author of the article
     $author = FD::user($news->created_by);
     // Get the url for the article
     $url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $this->app->getAlias(), 'articleId' => $news->id), false);
     // Apply comments for the article
     $comments = FD::comments($news->id, 'news', 'create', SOCIAL_APPS_GROUP_EVENT, array('url' => $url));
     // Apply likes for the article
     $likes = FD::likes()->get($news->id, 'news', 'create', SOCIAL_APPS_GROUP_EVENT);
     // Set the page title
     FD::page()->title($news->get('title'));
     // Retrieve the params
     $params = $this->app->getParams();
     $this->set('app', $this->app);
     $this->set('params', $params);
     $this->set('event', $event);
     $this->set('likes', $likes);
     $this->set('comments', $comments);
     $this->set('author', $author);
     $this->set('news', $news);
     echo parent::display('canvas/item');
 }
Example #8
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.2
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     $group = FD::group($groupId);
     // Check if the viewer is allowed here.
     if (!$group->canViewItem()) {
         return $this->redirect($group->getPermalink(false));
     }
     // Get app params
     $params = $this->app->getParams();
     // Load the milestone
     $id = JRequest::getInt('milestoneId');
     $milestone = FD::table('Milestone');
     $milestone->load($id);
     FD::page()->title(JText::_('APP_GROUP_TASKS_TITLE_CREATE_MILESTONE'));
     if ($id && $milestone->id) {
         FD::page()->title(JText::_('APP_GROUP_TASKS_TITLE_EDITING_MILESTONE'));
     }
     // Get a list of members from the group
     $groupModel = FD::model('Groups');
     $members = $groupModel->getMembers($group->id);
     $this->set('members', $members);
     $this->set('milestone', $milestone);
     $this->set('params', $params);
     $this->set('group', $group);
     echo parent::display('views/form');
 }
Example #9
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Require user to be logged in
     FD::requireLogin();
     $id = JRequest::getVar('schedule_id');
     // Get the user that's being accessed.
     $user = FD::user($userId);
     $calendar = FD::table('Calendar');
     $calendar->load($id);
     if (!$calendar->id || !$id) {
         FD::info()->set(false, JText::_('APP_CALENDAR_CANVAS_INVALID_SCHEDULE_ID'), SOCIAL_MSG_ERROR);
         return $this->redirect(FD::profile(array('id' => $user->getAlias()), false));
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     $result = $privacy->validate('apps.calendar', $calendar->id, 'view', $user->id);
     if (!$result) {
         FD::info()->set(false, JText::_('APP_CALENDAR_NO_ACCESS'), SOCIAL_MSG_ERROR);
         JFactory::getApplication()->redirect(FRoute::dashboard());
     }
     FD::page()->title($calendar->title);
     // Render the comments and likes
     $likes = FD::likes();
     $likes->get($id, 'calendar', 'create', SOCIAL_APPS_GROUP_USER);
     // Apply comments on the stream
     $comments = FD::comments($id, 'calendar', 'create', SOCIAL_APPS_GROUP_USER, array('url' => FRoute::albums(array('layout' => 'item', 'id' => $id))));
     $params = $this->app->getParams();
     $this->set('params', $params);
     $this->set('likes', $likes);
     $this->set('comments', $comments);
     $this->set('calendar', $calendar);
     $this->set('user', $user);
     echo parent::display('canvas/item/default');
 }
Example #10
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     // Load up the group
     $group = FD::group($groupId);
     // Check if the viewer is really allowed to view news
     if ($group->isInviteOnly() && $group->isClosed() && !$group->isMember() && !$this->my->isSiteAdmin()) {
         return $this->redirect($group->getPermalink(false));
     }
     $params = $this->app->getParams();
     // Set the max length of the item
     $options = array('limit' => (int) $params->get('total', 10));
     $model = FD::model('Groups');
     $items = $model->getNews($group->id, $options);
     $pagination = $model->getPagination();
     // Format the item's content.
     $this->format($items, $params);
     $pagination->setVar('option', 'com_easysocial');
     $pagination->setVar('view', 'groups');
     $pagination->setVar('layout', 'item');
     $pagination->setVar('id', $group->getAlias());
     $pagination->setVar('appId', $this->app->getAlias());
     $this->set('params', $params);
     $this->set('pagination', $pagination);
     $this->set('group', $group);
     $this->set('items', $items);
     echo parent::display('canvas/default');
 }
Example #11
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Require user to be logged in
     FD::requireLogin();
     $model = $this->getModel('Calendar');
     $user = FD::user($userId);
     // Get the events for the calendar
     $result = $model->getItems($user->id);
     $schedules = array();
     if ($user->isViewer()) {
         $title = JText::_('APP_CALENDAR_CANVAS_TITLE_OWNER');
     } else {
         $title = JText::sprintf('APP_CALENDAR_CANVAS_TITLE_VIEWER', $user->getName());
     }
     // Set the page title
     FD::page()->title($title);
     if ($result) {
         foreach ($result as $row) {
             $table = FD::table('Calendar');
             $table->bind($row);
             $schedules[] = $table;
         }
     }
     // Determines if the current page is on RTL mode.
     $doc = JFactory::getDocument();
     $direction = $doc->getDirection();
     $isRTL = $direction == 'rtl' ? true : false;
     // Get application params
     $params = $this->app->getParams();
     $this->set('params', $params);
     $this->set('isRTL', $isRTL);
     $this->set('user', $user);
     $this->set('schedules', $schedules);
     echo parent::display('canvas/calendar/default');
 }
Example #12
0
 /**
  * Displays the application output in the canvas.
  *
  * @param   int   The user id that is currently being viewed.
  * @param   string   layout path
  * @since   1.0
  * @access  public
  */
 public function display($userId = null, $docType = null)
 {
     // Get the user params
     $params = $this->getUserParams($userId);
     // Get the app params
     $appParams = $this->app->getParams();
     // Get the blog model
     $total = (int) $params->get('total', $appParams->get('total', 5));
     $pin_width = (int) $appParams->get('pin_width', 145);
     $pin_padding = (int) $appParams->get('pin_padding', 3);
     // Get list of all products created by the user on the site.
     $input = JFactory::getApplication()->input;
     $storeid = $input->get('storeid', '', 'INT');
     $model = $this->getModel('q2cmyproducts');
     $products = $model->getItems($userId, $total, $storeid);
     $productsCount = $model->getProductsCount($userId, $storeid);
     $user = Foundry::user($userId);
     // Get store list of user
     require_once JPATH_ROOT . '/components/com_quick2cart/helpers/storeHelper.php';
     $storeHelper = new storeHelper();
     $storelist = $storeHelper->getUserStore($userId);
     $this->set('user', $user);
     $this->set('userId', $userId);
     $this->set('total', $total);
     $this->set('pin_width', $pin_width);
     $this->set('pin_padding', $pin_padding);
     $this->set('products', $products);
     $this->set('productsCount', $productsCount);
     $this->set('storelists', $storelist);
     echo parent::display('profile/default');
 }
Example #13
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Get the blog model
     $model = $this->getModel('Feeds');
     // Get the params
     $params = $this->getUserParams($userId);
     // Get the app params
     $appParams = $this->app->getParams();
     $limit = $params->get('total', $appParams->get('total', 5));
     // Get list of blog posts created by the user on the site.
     $result = $model->getItems($userId, $limit);
     $feeds = array();
     // Properly format feed items.
     if ($result) {
         foreach ($result as $row) {
             $feed = $this->getTable('Feed');
             $feed->bind($row);
             // Initialize the parser.
             $parser = $feed->getParser();
             $feed->total = $parser->get_item_quantity();
             $feed->items = $parser->get_items(0, $limit);
             $feeds[] = $feed;
         }
     }
     $this->set('totalDisplayed', $limit);
     $this->set('params', $params);
     $this->set('feeds', $feeds);
     echo parent::display('profile/default');
 }
Example #14
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $group = FD::group($uid);
     $editor = JFactory::getEditor();
     $this->set('editor', $editor);
     $this->set('group', $group);
     echo parent::display('canvas/form');
 }
Example #15
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $event = FD::event($uid);
     $editor = JFactory::getEditor();
     $this->set('editor', $editor);
     $this->set('event', $event);
     echo parent::display('canvas/form');
 }
Example #16
0
 /**
  * Displays a note item.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	string		The html output.
  */
 public function read()
 {
     $id = JRequest::getInt('noteid');
     $note = $this->table('Note');
     $note->load($id);
     $this->set('note', $note);
     return parent::display('read');
 }
Example #17
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     $group = FD::group($groupId);
     $model = FD::model('Groups');
     $users = $model->getMembers($group->id);
     $pagination = $model->getPagination();
     $this->set('group', $group);
     $this->set('users', $users);
     echo parent::display('groups/default');
 }
Example #18
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     $id = JRequest::getInt('cid');
     // Try to load the note.
     $note = $this->getTable('Note');
     $note->load($id);
     if (!$id || !$note->id) {
         return;
     }
     // Perform content fixes here.
     $note->content = nl2br($note->content);
     $this->set('note', $note);
     echo parent::display('default.note');
 }
Example #19
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     $model = $this->getModel('Notes');
     $notes = $model->getItems($userId);
     $user = FD::user($userId);
     // We need to get the comment and likes count.
     $this->format($notes);
     $params = $this->getUserParams($userId);
     $this->set('app', $this->app);
     $this->set('params', $params);
     $this->set('user', $user);
     $this->set('notes', $notes);
     echo parent::display('dashboard/default');
 }
Example #20
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Get the app params
     $params = $this->app->getParams();
     // Get the blog model
     $total = (int) $params->get('total', $params->get('total', 5));
     // Retrieve a list of k2 items
     $model = $this->getModel('Items');
     $items = $model->getItems($userId, $total);
     $user = FD::user($userId);
     $this->format($items, $params);
     $this->set('user', $user);
     $this->set('items', $items);
     echo parent::display('profile/default');
 }
Example #21
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Get the user params
     $params = $this->getUserParams($userId);
     // Get the app params
     $appParams = $this->app->getParams();
     // Get the blog model
     $total = (int) $params->get('total', $appParams->get('total', 5));
     // Get list of blog posts created by the user on the site.
     $model = $this->getModel('Article');
     $articles = $model->getItems($userId, $total);
     $user = FD::user($userId);
     $this->format($articles, $appParams);
     $this->set('user', $user);
     $this->set('articles', $articles);
     echo parent::display('profile/default');
 }
Example #22
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     FD::requireLogin();
     $event = FD::event($uid);
     if (!$event->canViewItem()) {
         return $this->redirect($event->getPermalink(false));
     }
     // Load up the app params
     $params = $this->app->getParams();
     // Get the discussion item
     $id = $this->input->get('discussionId', 0, 'int');
     $discussion = FD::table('Discussion');
     $discussion->load($id);
     // Get the author of the article
     $author = FD::user($discussion->created_by);
     // Get the url for the article
     $url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $this->app->getAlias(), 'discussionId' => $discussion->id), false);
     // Set the page title
     FD::page()->title($discussion->get('title'));
     // Increment the hits for this discussion item
     $discussion->addHit();
     // Get a list of other news
     $model = FD::model('Discussions');
     $replies = $model->getReplies($discussion->id, array('ordering' => 'created'));
     $participants = $model->getParticipants($discussion->id);
     // Get the answer
     $answer = false;
     if ($discussion->answer_id) {
         $answer = FD::table('Discussion');
         $answer->load($discussion->answer_id);
         $answer->author = FD::user($answer->created_by);
     }
     // Determines if we should allow file sharing
     $access = $event->getAccess();
     $files = $access->get('files.enabled', true);
     $this->set('app', $this->app);
     $this->set('files', $files);
     $this->set('params', $params);
     $this->set('answer', $answer);
     $this->set('participants', $participants);
     $this->set('discussion', $discussion);
     $this->set('event', $event);
     $this->set('replies', $replies);
     $this->set('author', $author);
     echo parent::display('canvas/item');
 }
Example #23
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     // Obtain the tasks model.
     $model = FD::model('Tasks');
     // Get the list of items
     $result = $model->getItems($userId);
     // If there are tasks, we need to bind them with the table.
     $tasks = array();
     if ($result) {
         foreach ($result as $row) {
             $task = FD::table('Task');
             $task->bind($row);
             $tasks[] = $task;
         }
     }
     $this->set('tasks', $tasks);
     echo parent::display('dashboard/default');
 }
Example #24
0
 /**
  * Displays the application output in the canvas.
  *
  * @since   1.0
  * @access  public
  * @param   int     The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $group = FD::group($uid);
     if (!$group->isMember() && !$this->my->isSiteAdmin()) {
         FD::info()->set(false, JText::_('COM_EASYSOCIAL_GROUPS_ONLY_MEMBER_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($group->getPermalink(false));
     }
     // Set the page title
     FD::page()->title(JText::_('APP_GROUP_DISCUSSIONS_PAGE_TITLE_CREATE'));
     // Get the discussion item
     $discussion = FD::table('Discussion');
     // Determines if we should allow file sharing
     $access = $group->getAccess();
     $files = $access->get('files.enabled', true);
     $this->set('files', $files);
     $this->set('discussion', $discussion);
     $this->set('group', $group);
     echo parent::display('canvas/form');
 }
Example #25
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($userId = null, $docType = null)
 {
     $model = $this->getModel('Feeds');
     // Get the feeds
     $result = $model->getItems($userId);
     // If there are tasks, we need to bind them with the table.
     $feeds = array();
     if ($result) {
         foreach ($result as $row) {
             // Bind the result back to the note object.
             $feed = $this->getTable('Feed');
             $feed->bind($row);
             $feeds[] = $feed;
         }
     }
     $this->set('app', $this->app);
     $this->set('feeds', $feeds);
     echo parent::display('dashboard/default');
 }
Example #26
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($eventId = null, $docType = null)
 {
     // Load up the event
     $event = FD::event($eventId);
     // Get the event params
     $params = $event->getParams();
     // Load up the events model
     $model = FD::model('Events');
     $type = FD::input()->getString('type', 'going');
     $options = array();
     if ($type === 'going') {
         $options['state'] = SOCIAL_EVENT_GUEST_GOING;
     }
     if ($params->get('allowmaybe') && $type === 'maybe') {
         $options['state'] = SOCIAL_EVENT_GUEST_MAYBE;
     }
     if ($params->get('allownotgoingguest') && $type === 'notgoing') {
         $options['state'] = SOCIAL_EVENT_GUEST_NOT_GOING;
     }
     if ($event->isClosed() && $type === 'pending') {
         $options['state'] = SOCIAL_EVENT_GUEST_PENDING;
     }
     if ($type === 'admin') {
         $options['admin'] = 1;
     }
     $this->set('type', $type);
     $guests = $model->getGuests($event->id, $options);
     $pagination = $model->getPagination();
     $this->set('event', $event);
     $this->set('guests', $guests);
     $eventAlias = $event->getAlias();
     $appAlias = $this->app->getAlias();
     $permalinks = array('going' => '', 'notgoing' => '', 'maybe' => '', 'admin' => '', 'pending' => '');
     // Avoid using $filter because it is a FRoute reserved word
     foreach ($permalinks as $key => &$value) {
         $value = FRoute::events(array('layout' => 'item', 'id' => $eventAlias, 'appId' => $appAlias, 'type' => $key));
     }
     $this->set('permalinks', $permalinks);
     $myGuest = $event->getGuest();
     $this->set('myGuest', $myGuest);
     echo parent::display('events/default');
 }
Example #27
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     $event = FD::event($uid);
     // Check if the user is a member of the group
     if (!$event->getGuest()->isGuest() && !$this->my->isSiteAdmin()) {
         FD::info()->set(false, JText::_('COM_EASYSOCIAL_EVENTS_ONLY_GUEST_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($event->getPermalink(false));
     }
     // Set the page title
     FD::page()->title(JText::_('APP_EVENT_DISCUSSIONS_PAGE_TITLE_CREATE'));
     // Get the discussion item
     $discussion = FD::table('Discussion');
     // Determines if we should allow file sharing
     $access = $event->getAccess();
     $files = $access->get('files.enabled', true);
     $this->set('files', $files);
     $this->set('discussion', $discussion);
     $this->set('event', $event);
     echo parent::display('canvas/form');
 }
Example #28
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.2
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     $group = FD::group($groupId);
     // Check if the viewer is allowed here.
     if (!$group->canViewItem()) {
         return $this->redirect($group->getPermalink(false));
     }
     // Get app params
     $params = $this->app->getParams();
     $options = array();
     // Determines if we should populate completed milestones
     if ($params->get('display_completed_milestones', true)) {
         $options['completed'] = true;
     }
     $model = FD::model('Tasks');
     $milestones = $model->getMilestones($group->id, SOCIAL_TYPE_GROUP, $options);
     $this->set('milestones', $milestones);
     $this->set('params', $params);
     $this->set('group', $group);
     echo parent::display('views/default');
 }
Example #29
0
 /**
  * Displays the application output in the canvas.
  *
  * @since	1.0
  * @access	public
  * @param	int		The user id that is currently being viewed.
  */
 public function display($groupId = null, $docType = null)
 {
     $group = FD::group($groupId);
     // Only allow group members access here.
     if (!$group->isMember()) {
         return $this->redirect($group->getPermalink(false));
     }
     // Load up the explorer library.
     $explorer = FD::explorer($group->id, SOCIAL_TYPE_GROUP);
     // Get total number of files that are already uploaded in the group
     $model = FD::model('Files');
     $total = (int) $model->getTotalFiles($group->id, SOCIAL_TYPE_GROUP);
     $access = $group->getAccess();
     $allowUpload = $access->get('files.max') == 0 || $total < $access->get('files.max') ? true : false;
     $uploadLimit = $access->get('files.maxsize');
     $this->set('uploadLimit', $uploadLimit);
     $this->set('allowUpload', $allowUpload);
     $this->set('explorer', $explorer);
     $this->set('group', $group);
     echo parent::display('groups/default');
 }
Example #30
0
 /**
  * Displays the application output in the canvas.
  *
  * @since    1.0
  * @access    public
  * @param    int        The user id that is currently being viewed.
  */
 public function display($uid = null, $docType = null)
 {
     FD::requireLogin();
     $event = FD::event($uid);
     // Set the page title
     FD::page()->title(JText::_('APP_EVENT_DISCUSSIONS_PAGE_TITLE_EDIT'));
     // Get the discussion item
     $id = $this->input->get('discussionId', 0, 'int');
     $discussion = FD::table('Discussion');
     $discussion->load($id);
     if ($discussion->created_by != $this->my->id && !$event->getGuest()->isAdmin() && !$this->my->isSiteAdmin()) {
         return $this->redirect($event->getPermalink(false));
     }
     // Determines if we should allow file sharing
     $access = $event->getAccess();
     $files = $access->get('files.enabled', true);
     $this->set('files', $files);
     $this->set('discussion', $discussion);
     $this->set('event', $event);
     echo parent::display('canvas/form');
 }