/** * Attaches files to the header. * * @since 1.0 * @access public * @param string The path to the javascript file * @return */ public function attach($path = null) { // Import joomla's filesystem library. jimport('joomla.filesystem.file'); // Keep original file value if (!is_null($path)) { $_file = $this->file; $this->file = FD::resolve($path . '.' . $this->extension); if (!$this->file) { $this->file = FD::resolve($path); } } // Keep current value $_scriptTag = $this->scriptTag; $_CDATA = $this->CDATA; // Reset to false $this->scriptTag = false; $this->CDATA = false; $output = $this->parse(); FD::page()->addInlineScript($output); // Restore current value $this->scriptTag = $_scriptTag; $this->CDATA = $_CDATA; // Restore original file value if (!is_null($path)) { $this->file = $_file; } }
protected function getInput() { FD::language()->loadAdmin(); FD::language()->loadSite(); FD::page()->start(); JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css'); $theme = FD::themes(); $label = (string) $this->element['label']; $name = (string) $this->name; if ($this->value) { $category = FD::table('EventCategory'); $category->load($this->value); $label = $category->get('title'); } $theme->set('name', $name); $theme->set('id', $this->id); $theme->set('value', $this->value); $theme->set('label', $label); $output = $theme->output('admin/jfields/eventcategory'); // We do not want to process stylesheets on Joomla 2.5 and below. $options = array(); if (FD::version()->getVersion() < 3) { $options['processStylesheets'] = false; } FD::page()->end($options); return $output; }
/** * 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'); }
/** * 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'); }
/** * 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'); }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { // Load the language file. FD::language()->loadAdmin(); // Render the headers FD::page()->start(); // Attach dialog's css file. JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css'); $theme = FD::themes(); $label = (string) $this->element['label']; $name = (string) $this->name; $title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_BADGE'); if ($this->value) { $badge = FD::table('Badge'); $badge->load($this->value); $title = $badge->get('title'); } $theme->set('name', $name); $theme->set('id', $this->id); $theme->set('value', $this->value); $theme->set('label', $label); $theme->set('title', $title); $output = $theme->output('admin/jfields/badge'); // We do not want to process stylesheets on Joomla 2.5 and below. $options = array(); if (FD::version()->getVersion() < 3) { $options['processStylesheets'] = false; } FD::page()->end($options); return $output; }
/** * 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'); }
/** * 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'); }
/** * 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'); }
protected function getInput() { FD::language()->loadAdmin(); FD::language()->loadSite(); FD::page()->start(); JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css'); $theme = FD::themes(); $label = (string) $this->element['label']; $name = (string) $this->name; $title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_EVENT'); if ($this->value) { $id = explode(':', $this->value); $id = $id[0]; $group = FD::group($id); $title = $group->getName(); } $theme->set('name', $name); $theme->set('id', $this->id); $theme->set('value', $this->value); $theme->set('label', $label); $theme->set('title', $title); $output = $theme->output('admin/jfields/event'); // We do not want to process stylesheets on Joomla 2.5 and below. $options = array(); if (FD::version()->getVersion() < 3) { $options['processStylesheets'] = false; } FD::page()->end($options); return $output; }
public function display() { // Get the configuration objects $config = FD::config(); $jConfig = FD::config('joomla'); // Get the stream library $stream = FD::stream(); $stream->get(); // Get the result in an array form $result = $stream->toArray(); // Set the document properties $doc = JFactory::getDocument(); $doc->link = FRoute::dashboard(); FD::page()->title(JText::_('COM_EASYSOCIAL_STREAM_FEED_TITLE')); $doc->setDescription(JText::sprintf('COM_EASYSOCIAL_STREAM_FEED_DESC', $jConfig->getValue('sitename'))); if ($result) { $useEmail = $jConfig->getValue('feed_email'); foreach ($result as $row) { $item = new JFeedItem(); $item->title = $row->title; $item->link = FRoute::stream(array('id' => $row->uid)); $item->description = $row->content; $item->date = $row->created->toMySQL(); $item->author = $row->actor->getName(); if ($useEmail != 'none') { $item->authorEmail = $jConfig->getValue('mailfrom'); if ($useEmail == 'author') { $item->authorEmail = $row->actor->email; } } $doc->addItem($item); } } }
protected function getInput() { // Load the language file. FD::language()->loadAdmin(); // Render the headers FD::page()->start(); $theme = FD::themes(); $label = (string) $this->element['label']; $name = (string) $this->name; $title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_PROFILE'); if ($this->value) { $profile = FD::table('Profile'); $profile->load($this->value); $title = $profile->get('title'); } $theme->set('name', $name); $theme->set('id', $this->id); $theme->set('value', $this->value); $theme->set('label', $label); $theme->set('title', $title); $output = $theme->output('admin/jfields/profile'); // We do not want to process stylesheets on Joomla 2.5 and below. $options = array(); if (FD::version()->getVersion() < 3) { $options['processStylesheets'] = false; } FD::page()->end($options); return $output; }
/** * 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'); }
/** * Responsible to display the generic login form. * * @since 1.0 * @access public */ public function display($tpl = null) { $my = FD::user(); // If user is already logged in, they should not see this page. if ($my->id > 0) { return $this->redirect(FRoute::dashboard(array(), false)); } // Add page title FD::page()->title(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_TITLE')); // Add breadcrumb FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_BREADCRUMB')); // Facebook codes. $facebook = FD::oauth('Facebook'); $config = FD::config(); $loginMenu = $config->get('general.site.login'); // Get any callback urls. $return = FD::getCallback(); // If return value is empty, always redirect back to the dashboard if (!$return) { // Determine if there's a login redirection $urlFromCaller = FD::input()->getVar('return', ''); if ($urlFromCaller) { $return = $urlFromCaller; } else { if ($loginMenu != 'null') { $return = FRoute::getMenuLink($loginMenu); } else { $return = FRoute::dashboard(array(), false); } $return = base64_encode($return); } } else { $return = base64_encode($return); } if ($config->get('registrations.enabled')) { $profileId = $config->get('registrations.mini.profile', 'default'); if ($profileId === 'default') { $profileId = Foundry::model('profiles')->getDefaultProfile()->id; } $options = array('visible' => SOCIAL_PROFILES_VIEW_MINI_REGISTRATION, 'profile_id' => $profileId); $fieldsModel = Foundry::model('fields'); $fields = $fieldsModel->getCustomFields($options); if (!empty($fields)) { FD::language()->loadAdmin(); $fieldsLib = FD::fields(); $session = JFactory::getSession(); $registration = FD::table('Registration'); $registration->load($session->getId()); $data = $registration->getValues(); $args = array(&$data, &$registration); $fieldsLib->trigger('onRegisterMini', SOCIAL_FIELDS_GROUP_USER, $fields, $args); $this->set('fields', $fields); } } $this->set('return', $return); $this->set('facebook', $facebook); return parent::display('site/login/default'); }
public function __construct($params) { $this->params = $params; // Process scripts $page = FD::page(); $page->processScripts(); // Process styling $doc = FD::document(); $doc->init(); }
public function setBreadcrumbs($layout) { // Set the link to the groups FD::page()->breadcrumb($this->group->getName(), FRoute::groups(array('layout' => 'item', 'id' => $this->group->getAlias()))); if ($layout == 'item') { FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink()); } // Set the albums breadcrumb FD::page()->breadcrumb($this->getPageTitle($layout, false)); }
public function setBreadcrumbs($layout) { if ($layout == 'item') { FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALBUMS'), FRoute::albums()); FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink()); FD::page()->breadcrumb($this->photo->get('title')); } if ($layout == 'form') { FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALBUMS'), FRoute::albums()); FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink()); FD::page()->breadcrumb($this->photo->get('title'), $this->photo->getPermalink()); FD::page()->breadcrumb(JText::_('Editing photo')); } }
/** * Default display method for leader board * * @since 1.0 * @access public * @param string * @return */ function display($tpl = null) { // Check for user profile completeness FD::checkCompleteProfile(); $config = FD::config(); $limit = $config->get('layout.leaderboard.limit'); $model = FD::model('Leaderboard'); // Should we exclude admin here $excludeAdmin = !$config->get('leaderboard.listings.admin'); $options = array('ordering' => 'points', 'limit' => $limit, 'excludeAdmin' => $excludeAdmin); $users = $model->getLadder($options, false); // Set the page title FD::page()->title(JText::_('COM_EASYSOCIAL_PAGE_TITLE_LEADERBOARD')); $this->set('users', $users); echo parent::display('site/leaderboard/default'); }
/** * 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'); }
/** * Displays the apps on the site. * * @since 1.0 * @access public * @param string * @return */ public function display($tpl = null) { // Check for user profile completeness FD::checkCompleteProfile(); // Require user to be logged in FD::requireLogin(); // Get current logged in user. $my = FD::user(); // Get model. $model = FD::model('Apps'); $sort = JRequest::getVar('sort', 'alphabetical'); $order = JRequest::getWord('order', 'asc'); $options = array('type' => SOCIAL_APPS_TYPE_APPS, 'installable' => true, 'sort' => $sort, 'order' => $order, 'group' => SOCIAL_APPS_GROUP_USER); $modelFunc = 'getApps'; switch ($sort) { case 'recent': $options['sort'] = 'a.created'; $options['order'] = 'desc'; break; case 'alphabetical': $options['sort'] = 'a.title'; $options['order'] = 'asc'; break; case 'trending': // need a separate logic to get trending based on apps_map $modelFunc = 'getTrendingApps'; break; } // Get the current filter $filter = JRequest::getWord('filter', 'browse'); $title = JText::_('COM_EASYSOCIAL_PAGE_TITLE_BROWSE_APPS'); if ($filter == 'mine') { $options['uid'] = $my->id; $options['key'] = SOCIAL_TYPE_USER; $title = JText::_('COM_EASYSOCIAL_PAGE_TITLE_YOUR_APPS'); } // Set the page title FD::page()->title($title); // Try to fetch the apps now. $apps = $model->{$modelFunc}($options); $this->set('filter', $filter); $this->set('sort', $sort); $this->set('apps', $apps); parent::display('site/apps/default'); }
/** * 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'); }
/** * 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'); }
/** * Displays a single profile item layout * * @since 4.0 * @access public * @param string * @return */ public function item() { $id = $this->input->get('id', 0, 'int'); // Get the profile object $profile = FD::table('Profile'); $profile->load($id); if (!$id || !$profile->id) { return JError::raiseError(404, JText::_('COM_EASYSOCIAL_404_PROFILE_NOT_FOUND')); } $model = FD::model('Profiles'); $randomMembers = array(); // if this profile is a ESAD profile, we do not show the random members if ($profile->community_access) { $randomMembers = $model->getMembers($profile->id, array('randomize' => true, 'limit' => 20)); } $totalUsers = $profile->getMembersCount(); // Get statistics of user registration for this profile type $stats = $model->getRegistrationStats($profile->id); $stats = $stats->profiles[0]->items; // Get the stream for this profile $startlimit = JRequest::getInt('limitstart', 0); $stream = FD::stream(); $options = array('profileId' => $profile->id); if ($startlimit) { $options['startlimit'] = $startlimit; } $stream->get($options); // Set the page title to this category FD::page()->title($profile->get('title')); // Set the breadcrumbs FD::page()->breadcrumb($profile->get('title')); // Get a list of random albums from this profile $albums = $model->getRandomAlbums(array('core' => false, 'withCovers' => true)); $this->set('albums', $albums); $this->set('stream', $stream); $this->set('stats', $stats); $this->set('randomMembers', $randomMembers); $this->set('totalUsers', $totalUsers); $this->set('profile', $profile); echo parent::display('site/profiles/item'); }
/** * 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'); }
/** * Displays a list of notifications a user has. * * @since 1.0 * @access public */ public function display($tpl = null) { // Unauthorized users should not be allowed to access this page. FD::requireLogin(); // Check for user profile completeness FD::checkCompleteProfile(); // Get the current logged in user. $user = FD::user(); // Set the page title FD::page()->title(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALL_NOTIFICATIONS')); // Set breadcrumbs FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALL_NOTIFICATIONS')); $config = FD::config(); $paginationLimit = $config->get('notifications.general.pagination'); // Get notifications model. $options = array('target_id' => $user->id, 'target_type' => SOCIAL_TYPE_USER, 'group' => SOCIAL_NOTIFICATION_GROUP_ITEMS, 'limit' => $paginationLimit); $lib = FD::notification(); $items = $lib->getItems($options); $this->set('items', $items); $this->set('startlimit', $paginationLimit); parent::display('site/notifications/default'); }
public function attach($path = null) { // Keep current value $_styleTag = $this->styleTag; $_CDATA = $this->CDATA; // Keep original file value if (!is_null($path)) { $_file = $this->file; $this->file = FD::resolve($path . '.' . $this->extension); } // Reset to false $this->styleTag = false; $this->CDATA = false; $output = $this->parse(); FD::page()->addInlineStylesheet($output); // Restore current value $this->styleTag = $_styleTag; $this->CDATA = $_CDATA; // Restore original file value if (!is_null($path)) { $this->file = $_file; } }
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(); // Load the milestone $id = JRequest::getInt('milestoneId'); $milestone = FD::table('Milestone'); $milestone->load($id); // Set the page title FD::page()->title($milestone->title); // Get a list of members from the group $eventModel = FD::model('Events'); $members = $eventModel->getMembers($event->id); // Get a list of tasks for this milestone $model = FD::model('Tasks'); $openTasks = $model->getTasks($milestone->id, array('open' => true)); // Get a list of closed tasks $closedTasks = $model->getTasks($milestone->id, array('closed' => true)); // Get total open tasks $totalOpen = $model->getTotalTasks($milestone->id, array('open' => true)); $totalClosed = $model->getTotalTasks($milestone->id, array('closed' => true)); $this->set('totalOpen', $totalOpen); $this->set('totalClosed', $totalClosed); $this->set('openTasks', $openTasks); $this->set('closedTasks', $closedTasks); $this->set('members', $members); $this->set('milestone', $milestone); $this->set('params', $params); $this->set('event', $event); echo parent::display('views/item'); }
public function setBreadcrumbs($layout) { // Set the breadcrumbs FD::page()->breadcrumb($this->getPageTitle($layout)); }
/** * Default method to display the registration page. * * @since 1.0 * @access public * @author Mark Lee <*****@*****.**> */ function item($tpl = null) { $this->checkFeature(); // Check for user profile completeness FD::checkCompleteProfile(); $id = JRequest::getInt('id'); $point = FD::table('Points'); $point->load($id); if (!$id || !$point->id) { FD::info()->set(null, JText::_('The points id provided is not a valid id.'), SOCIAL_MSG_ERROR); return $this->redirect(FRoute::dashboard(array(), false)); } $point->loadLanguage(); // Load language file. JFactory::getLanguage()->load('com_easysocial', JPATH_ROOT . '/administrator'); // Set the page title FD::page()->title($point->get('title')); // Set the page breadcrumb FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_POINTS'), FRoute::points()); FD::page()->breadcrumb($point->get('title')); // Get list of point achievers. $achievers = $point->getAchievers(); $this->set('achievers', $achievers); $this->set('point', $point); parent::display('site/points/default.item'); }
/** * Loads required assets * * @since 1.0 * @access public * @param string * @return */ public function loadAssets() { if (!$this->exists()) { return false; } $document = JFactory::getDocument(); if ($document->getType() == 'html') { // We also need to render the styling from EasySocial. FD::document()->init(); $page = FD::page(); $page->processScripts(); $css = rtrim(JURI::root(), '/') . '/plugins/content/easysocial/assets/style.css'; $document->addStylesheet($css); } }