Ejemplo n.º 1
0
 public function display($tpl = null)
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_STREAM');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_STREAM');
     // Check if this is from after execution
     $success = JRequest::getInt('success');
     $model = FD::model('stream', array('initState' => true));
     $items = $model->getItemsWithState();
     $ordering = $model->getState('ordering');
     $direction = $model->getState('direction');
     $limit = $model->getState('limit');
     $state = $model->getState('state');
     $pagination = $model->getPagination();
     // Add button
     $this->toolbar($state);
     // set variable into themes.
     $this->set('pagination', $pagination);
     $this->set('ordering', $ordering);
     $this->set('direction', $direction);
     $this->set('limit', $limit);
     $this->set('state', $state);
     $this->set('items', $items);
     // var_dump($state);
     echo parent::display('admin/stream/default');
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     // Check access
     if (!$this->authorise('easysocial.access.stream')) {
         $this->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     // Set page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_STREAM'));
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_STREAM'));
     // Set page icon
     $this->setIcon('ies-database');
     // Check if this is from after execution
     $success = JRequest::getInt('success');
     $model = FD::model('stream', array('initState' => true));
     $items = $model->getItemsWithState();
     $ordering = $model->getState('ordering');
     $direction = $model->getState('direction');
     $limit = $model->getState('limit');
     $state = $model->getState('state');
     $pagination = $model->getPagination();
     // Add button
     $this->toolbar($state);
     // set variable into themes.
     $this->set('pagination', $pagination);
     $this->set('ordering', $ordering);
     $this->set('direction', $direction);
     $this->set('limit', $limit);
     $this->set('state', $state);
     $this->set('items', $items);
     // var_dump($state);
     echo parent::display('admin/stream/default');
 }
Ejemplo n.º 3
0
 /**
  * Default user listings page.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function display($tpl = null)
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_ALBUMS');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_ALBUMS');
     // Get the model
     $model = FD::model('Albums', array('initState' => true));
     // Get filter states.
     $ordering = JRequest::getVar('ordering', $model->getState('ordering'));
     $direction = JRequest::getVar('direction', $model->getState('direction'));
     $limit = $model->getState('limit');
     $published = $model->getState('published');
     $search = JRequest::getVar('search', $model->getState('search'));
     // Add Joomla buttons
     JToolbarHelper::deleteList();
     // Get albums
     $albums = $model->getDataWithState();
     // Load frontend language files
     FD::language()->loadSite();
     // Get pagination from model
     $pagination = $model->getPagination();
     $callback = JRequest::getVar('callback', '');
     $this->set('ordering', $ordering);
     $this->set('limit', $limit);
     $this->set('direction', $direction);
     $this->set('callback', $callback);
     $this->set('search', $search);
     $this->set('published', $published);
     $this->set('pagination', $pagination);
     $this->set('albums', $albums);
     echo parent::display('admin/albums/default');
 }
Ejemplo n.º 4
0
 /**
  * Discover languages from our server
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function discover()
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_LANGUAGES');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_LANGUAGES');
     // Get the stored settings
     $key = $this->config->get('general.key');
     $this->set('key', $key);
     return parent::display('admin/languages/initialize');
 }
Ejemplo n.º 5
0
 public function install($tpl = null)
 {
     // Add heading here.
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_INSTALL_ACCESS'));
     // Set page icon
     $this->setIcon('icon-jar jar-imac_up');
     // Add description here.
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_INSTALL_ACCESS'));
     echo parent::display('admin/access/install');
 }
Ejemplo n.º 6
0
 public function database($tpl = null)
 {
     // Check access
     if (!$this->authorise('easysocial.access.maintenance')) {
         $this->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     $this->setHeading('COM_EASYSOCIAL_HEADING_MAINTENANCE_DATABASE');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_MAINTENANCE_DATABASE');
     $model = FD::model('maintenance');
     echo parent::display('admin/maintenance/database');
 }
Ejemplo n.º 7
0
 public function reindex($tpl = null)
 {
     // redirect to main page.
     $mainframe = JFactory::getApplication();
     $mainframe->redirect('index.php?option=com_easysocial');
     return;
     // Set page heading
     $this->setHeading(JText::_('Index'));
     // Set page icon
     $this->setIcon('icon-jar jar-store');
     // Set page description
     $this->setDescription(JText::_('Re-indexing your EasySocial items into search indexer.'));
     parent::display('admin/indexer/reindex');
 }
Ejemplo n.º 8
0
 /**
  * Main method to display the dashboard view.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function display($tpl = null)
 {
     // Add heading here.
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_DASHBOARD'));
     // Set page icon.
     $this->setIconUrl(rtrim(JURI::root(), '/') . '/media/com_easysocial/images/icons/logo/large.png', false);
     // Add description here.
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_DASHBOARD'));
     // Get users model
     $usersModel = FD::model('Users');
     // Get total albums
     $photosModel = FD::model('Albums');
     $totalAlbums = $photosModel->getTotalAlbums();
     // Get mailer model
     $mailerModel = FD::model('Mailer');
     $mailStats = $mailerModel->getDeliveryStats();
     // profiles signup data
     $profilesModel = FD::model('Profiles');
     $signupData = $profilesModel->getRegistrationStats();
     $xAxes = array();
     foreach ($signupData->dates as $date) {
         $xAxes[] = FD::date($date)->format(JText::_('COM_EASYSOCIAL_DATE_DM'));
     }
     // Add translation on the profile title
     foreach ($signupData->profiles as $profile) {
         $profile->title = JText::_($profile->title);
     }
     $pendingUsers = $usersModel->getPendingUsers();
     $totalPending = count($pendingUsers);
     // Get total number of groups
     $groupsModel = FD::model('Groups');
     $totalGroups = $groupsModel->getTotalGroups();
     $this->set('mailStats', $mailStats);
     $this->set('axes', $xAxes);
     $this->set('signupData', $signupData);
     $this->set('totalPending', $totalPending);
     $this->set('pendingUsers', $pendingUsers);
     $this->set('totalUsers', $usersModel->getTotalUsers());
     $this->set('totalOnline', $usersModel->getTotalOnlineUsers());
     $this->set('totalGroups', $totalGroups);
     $this->set('totalAlbums', $totalAlbums);
     // Add Joomla button
     if (FD::user()->authorise('core.admin', 'com_easysocial')) {
         JToolbarHelper::preferences('com_easysocial');
     }
     // Add clear cache button here.
     JToolbarHelper::custom('clearCache', 'trash', '', JText::_('COM_EASYSOCIAL_TOOLBAR_BUTTON_PURGE_CACHE'), false);
     echo parent::display('admin/easysocial/default');
 }
Ejemplo n.º 9
0
 /**
  * Default user listings page.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function display($tpl = null)
 {
     // Set page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_EMAIL_ACTIVITIES'));
     // Set page icon
     $this->setIcon('icon-jar jar-email_envelope');
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_EMAIL_ACTIVITIES'));
     // Add buttons
     JToolbarHelper::publishList('publish', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_MARK_SENT'));
     JToolbarHelper::unpublishList('unpublish', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_MARK_PENDING'));
     JToolbarHelper::divider();
     JToolbarHelper::trash('purgeSent', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_PURGE_SENT'), false);
     JToolbarHelper::trash('purgePending', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_PURGE_PENDING'), false);
     JToolbarHelper::trash('purgeAll', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_PURGE_ALL'), false);
     // Get the model
     $model = FD::model('Mailer', array('initState' => true));
     // Load site's language file
     FD::language()->loadSite();
     $emails = $model->getItemsWithState();
     $pagination = $model->getPagination();
     $state = $model->getState('published');
     $limit = $model->getState('limit');
     $search = $model->getState('search');
     $ordering = $model->getState('ordering');
     $direction = $model->getState('direction');
     if ($state != 'all') {
         $state = (int) $state;
     }
     $lib = FD::mailer();
     // Need to do some processing on the emails
     foreach ($emails as $mail) {
         // Load necessary language required by the mail
         $mail->loadLanguage();
         // Translate the title with necessary parameters
         $mail->title = $lib->translate($mail->title, $mail->params);
     }
     $this->set('ordering', $ordering);
     $this->set('direction', $direction);
     $this->set('search', $search);
     $this->set('limit', $limit);
     $this->set('published', $state);
     $this->set('emails', $emails);
     $this->set('pagination', $pagination);
     echo parent::display('admin/mailer/default');
 }
Ejemplo n.º 10
0
 /**
  * Default user listings page.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function display($tpl = null)
 {
     // Disallow access
     if (!$this->authorise('easysocial.access.albums')) {
         $this->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     // Set page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_ALBUMS'));
     // Set page icon
     $this->setIcon('ies-pictures');
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_ALBUMS'));
     // Get the model
     $model = FD::model('Albums', array('initState' => true));
     // Get filter states.
     $ordering = JRequest::getVar('ordering', $model->getState('ordering'));
     $direction = JRequest::getVar('direction', $model->getState('direction'));
     $limit = $model->getState('limit');
     $published = $model->getState('published');
     $search = JRequest::getVar('search', $model->getState('search'));
     // Add Joomla buttons
     JToolbarHelper::deleteList();
     // Get albums
     $albums = $model->getDataWithState();
     // Load frontend language files
     FD::language()->loadSite();
     // Get pagination from model
     $pagination = $model->getPagination();
     $callback = JRequest::getVar('callback', '');
     $this->set('ordering', $ordering);
     $this->set('limit', $limit);
     $this->set('direction', $direction);
     $this->set('callback', $callback);
     $this->set('search', $search);
     $this->set('published', $published);
     $this->set('pagination', $pagination);
     $this->set('albums', $albums);
     echo parent::display('admin/albums/default');
 }
Ejemplo n.º 11
0
 public function install($tpl = null)
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_INSTALL_ALERTS');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_INSTALL_ALERTS');
     echo parent::display('admin/alerts/install');
 }
Ejemplo n.º 12
0
 /**
  * Displays the edit form of user
  *
  * @since	1.0
  * @access	public
  * @param	int 	The id of the user that is being edited.
  */
 public function editForm($id, $errors = null)
 {
     // Get the user object
     $user = FD::user($id);
     // Get the user's profile
     $profile = $user->getProfile();
     $this->setHeading($user->getName() . ' (' . $profile->get('title') . ')');
     $this->setIconUrl($user->getAvatar(SOCIAL_AVATAR_LARGE));
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_EDIT_USER'));
     // Load up language file from the front end.
     FD::language()->loadSite();
     // Get a list of access rules that are defined for this
     $accessModel = FD::model('Access');
     // Get user's privacy
     $privacyLib = FD::get('Privacy', $user->id);
     $privacyData = $privacyLib->getData();
     $privacy = array();
     // Update the privacy data with proper properties.
     if ($privacyData) {
         foreach ($privacyData as $group => $items) {
             // We do not want to show field privacy rules here because it does not make sense for user to set a default value
             // Most of the fields only have 1 and it is set in Edit Profile page
             if ($group === 'field') {
                 continue;
             }
             foreach ($items as &$item) {
                 $rule = strtoupper(JString::str_ireplace('.', '_', $item->rule));
                 $groupKey = strtoupper($group);
                 $item->groupKey = $groupKey;
                 $item->label = JText::_('COM_EASYSOCIAL_PRIVACY_LABEL_' . $groupKey . '_' . $rule);
                 $item->tips = JText::_('COM_EASYSOCIAL_PRIVACY_TIPS_' . $groupKey . '_' . $rule);
             }
             $privacy[$group] = $items;
         }
     }
     // Get the steps model
     $stepsModel = FD::model('Steps');
     $steps = $stepsModel->getSteps($user->profile_id, SOCIAL_TYPE_PROFILES);
     // Get custom fields model.
     $fieldsModel = FD::model('Fields');
     // Get custom fields library.
     $fields = FD::fields();
     // Manually set the user here because admin edit might be editing a different user
     $fields->setUser($user);
     // Get the custom fields for each of the steps.
     foreach ($steps as &$step) {
         $step->fields = $fieldsModel->getCustomFields(array('step_id' => $step->id, 'data' => true, 'dataId' => $user->id, 'dataType' => SOCIAL_TYPE_USER));
         // Trigger onEdit for custom fields.
         if (!empty($step->fields)) {
             $post = JRequest::get('post');
             $args = array(&$post, &$user, $errors);
             $fields->trigger('onAdminEdit', SOCIAL_FIELDS_GROUP_USER, $step->fields, $args);
         }
     }
     // Get user badges
     $badges = $user->getBadges();
     // Get the user notification settings
     $alertLib = FD::alert();
     $alerts = $alertLib->getUserSettings($user->id);
     // Get stats
     $stats = $this->getStats($user);
     // Get user points history
     $pointsModel = FD::model('Points');
     $pointsHistory = $pointsModel->getHistory($user->id, array('limit' => 20));
     $pointsPagination = $pointsModel->getPagination();
     // Get user's groups
     $userGroups = array_keys($user->groups);
     // We need to hide the guest user group that is defined in com_users options.
     // Public group should also be hidden.
     $userOptions = JComponentHelper::getComponent('com_users')->params;
     $defaultRegistrationGroup = $userOptions->get('new_usertype');
     $guestGroup = array(1, $userOptions->get('guest_usergroup'));
     $this->set('userGroups', $userGroups);
     $this->set('guestGroup', $guestGroup);
     $this->set('stats', $stats);
     $this->set('pointsHistory', $pointsHistory);
     $this->set('alerts', $alerts);
     $this->set('privacy', $privacy);
     $this->set('badges', $badges);
     $this->set('steps', $steps);
     $this->set('user', $user);
     return parent::display('admin/users/form');
 }
Ejemplo n.º 13
0
 /**
  * This is to return a list of users in an iframe / html.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function getUsers()
 {
     // @task: Obtain the profile id from query string.
     $id = JRequest::getInt('profile_id');
     // @task: Obtain search from query string
     $search = JRequest::getVar('search');
     // @task: Get the profiles model.
     $model = FD::get('Model', 'Profiles');
     // @task: Get the users that are already part of this profile so that we can exclude them.
     $exclusion = $model->getMembers($id);
     // @task: Now, we need to get the final result of users.
     $userModel = FD::get('Model', 'User');
     $users = $userModel->getItems(array('exclusion' => array('a.id' => $exclusion)));
     $pagination = $userModel->getPagination();
     // @task: Initialize the user objects.
     $users = FD::user($users);
     $this->set('search', $search);
     $this->set('pagination', $pagination);
     $this->set('users', $users);
     parent::display('admin.profiles.users');
 }
Ejemplo n.º 14
0
 /**
  * Displays the discover layout for points.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function discover($tpl = null)
 {
     // Add heading here.
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_DISCOVER_POINTS'));
     // Set page icon
     $this->setIcon('icon-jar jar-cloud_up');
     // Add description here.
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_INSTALL_POINTS'));
     echo parent::display('admin/points/discover');
 }
Ejemplo n.º 15
0
 /**
  * Displays the discover layout for points.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Sam <*****@*****.**>
  */
 public function discover($tpl = null)
 {
     // Add heading here.
     $this->setHeading('COM_EASYSOCIAL_HEADING_DISCOVER_PRIVACY');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_INSTALL_PRIVACY');
     echo parent::display('admin/privacy/discover');
 }
Ejemplo n.º 16
0
 /**
  * Displays the theme's installation page
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function install()
 {
     JToolbarHelper::cancel('cancel', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_CANCEL'));
     // Set the page heading
     $this->setHeading('COM_EASYSOCIAL_TOOLBAR_TITLE_THEMES_INSTALL');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_THEMES_INSTALL');
     parent::display('admin/themes/install');
 }
Ejemplo n.º 17
0
 /**
  * Discover languages from our server
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function discover()
 {
     // Set page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_LANGUAGES'));
     // Set page icon.
     $this->setIcon('icon-jar jar-directions');
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_LANGUAGES'));
     // Get the stored settings
     $key = $this->config->get('general.key');
     $this->set('key', $key);
     return parent::display('admin/languages/initialize');
 }
Ejemplo n.º 18
0
 /**
  * Responsible to update the socialize settings for oauth authentications
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function closeOauthDialog()
 {
     echo parent::display('admin/settings/forms/socialize.dialog.close');
 }
Ejemplo n.º 19
0
 /**
  * Displays the theme's installation page
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function install()
 {
     // Disallow access
     if (!$this->authorise('easysocial.access.themes')) {
         $this->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     JToolbarHelper::cancel('cancel', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_CANCEL'));
     // Set the page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_THEMES_INSTALL'));
     $this->setIcon('ies-upload');
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_THEMES_INSTALL'));
     parent::display('admin/themes/install');
 }
Ejemplo n.º 20
0
 public function errors($response)
 {
     $this->set('response', $response);
     parent::display('admin.installer.errors');
 }
Ejemplo n.º 21
0
 /**
  * Post action after approving an event to redirect back to the pending listing.
  * @author Jason Rey <*****@*****.**>
  * @since  1.3
  * @access public
  */
 public function approve()
 {
     $ids = $this->input->getVar('cid');
     $ids = FD::makeArray($ids);
     $schedules = array();
     $postdatas = array();
     $eventids = array();
     foreach ($ids as $id) {
         $event = FD::event($id);
         $params = $event->getParams();
         if ($params->exists('recurringData')) {
             $schedule = FD::model('Events')->getRecurringSchedule(array('eventStart' => $event->getEventStart(), 'end' => $params->get('recurringData')->end, 'type' => $params->get('recurringData')->type, 'daily' => $params->get('recurringData')->daily));
             if (!empty($schedule)) {
                 $eventids[] = $event->id;
                 $schedules[$event->id] = $schedule;
                 $postdatas[$event->id] = FD::makeObject($params->get('postdata'));
             }
         }
     }
     if (empty($schedules)) {
         FD::info()->set($this->getMessage());
         return $this->redirect(FRoute::url(array('view' => 'events', 'layout' => 'pending')));
     }
     $this->setHeading(JText::_('COM_EASYSOCIAL_EVENTS_APPLYING_RECURRING_EVENT_CHANGES'));
     $this->setDescription(JText::_('COM_EASYSOCIAL_EVENTS_APPLYING_RECURRING_EVENT_CHANGES_DESCRIPTION'));
     $json = FD::json();
     $this->set('schedules', $json->encode($schedules));
     $this->set('postdatas', $json->encode($postdatas));
     $this->set('eventids', $json->encode($eventids));
     echo parent::display('admin/events/approve.recurring');
 }
Ejemplo n.º 22
0
 /**
  * Displays the discover layout for points.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function discover($tpl = null)
 {
     // Add heading here.
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_DISCOVER_BADGES'));
     // Set page icon
     $this->setIcon('ies-upload-2');
     // Add description here.
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_DISCOVER_BADGES'));
     echo parent::display('admin/badges/discover');
 }
Ejemplo n.º 23
0
 /**
  * Displays the discover layout for points.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function discover($tpl = null)
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_DISCOVER_BADGES');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_DISCOVER_BADGES');
     echo parent::display('admin/badges/discover');
 }
Ejemplo n.º 24
0
 /**
  * Displays the Kunena migration form
  *
  * @since	1.1
  * @access	public
  */
 public function kunena()
 {
     // Set page heading
     $this->setHeading(JText::_('COM_EASYSOCIAL_HEADING_MIGRATORS_KUNENA'));
     // Set page icon
     $this->setIcon('icon-jar jar-imac');
     // Set page description
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_MIGRATORS_KUNENA'));
     // Get the migrator library
     $migrator = FD::migrators(__FUNCTION__);
     $installed = $migrator->isInstalled();
     // $version 	= $migrator->getVersion();
     $this->set('installed', $installed);
     // $this->set( 'version'		, $version );
     parent::display('admin/migrators/kunena');
 }
Ejemplo n.º 25
0
 /**
  * Displays the discover layout for points.
  *
  * @since	1.0
  * @access	public
  * @return	null
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function discover($tpl = null)
 {
     $this->setHeading('COM_EASYSOCIAL_HEADING_DISCOVER_POINTS');
     $this->setDescription('COM_EASYSOCIAL_DESCRIPTION_INSTALL_POINTS');
     echo parent::display('admin/points/discover');
 }
Ejemplo n.º 26
0
 /**
  * This is to return a list of users in an iframe / html.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function getUsers()
 {
     $id = $this->input->get('profile_id', 0, 'int');
     $search = $this->input->get('search', '', 'default');
     // @task: Get the profiles model.
     $model = FD::model('Profiles');
     $exclusion = $model->getMembers($id);
     // @task: Now, we need to get the final result of users.
     $userModel = FD::model('User');
     $users = $userModel->getItems(array('exclusion' => array('a.id' => $exclusion)));
     $pagination = $userModel->getPagination();
     // Initialize the user objects.
     $users = FD::user($users);
     $this->set('search', $search);
     $this->set('pagination', $pagination);
     $this->set('users', $users);
     parent::display('admin.profiles.users');
 }
Ejemplo n.º 27
0
 /**
  * Displays the category form for groups
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function categoryForm($tpl = null)
 {
     // Perhaps this is an edited category
     $id = JRequest::getInt('id');
     $category = FD::table('GroupCategory');
     $category->load($id);
     // Set the structure heading here.
     if ($category->id) {
         $this->setHeading($category->get('title'));
         $this->setDescription(JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_EDIT_GROUP_CATEGORY_DESC'));
     } else {
         $this->setHeading(JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_CREATE_GROUP_CATEGORY'));
         $this->setDescription(JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_CREATE_GROUP_CATEGORY_DESC'));
         // By default the published state should be published.
         $category->state = SOCIAL_STATE_PUBLISHED;
     }
     // Set page icon.
     $this->setIcon('ies-folder-3');
     // Load front end's language file
     Foundry::language()->loadSite();
     JToolbarHelper::apply('applyCategory', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE'), false, false);
     JToolbarHelper::save('saveCategory', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE_AND_CLOSE'));
     JToolbarHelper::save2new('saveCategoryNew', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE_AND_NEW'));
     JToolbarHelper::divider();
     JToolbarHelper::cancel('cancel', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_CANCEL'));
     $activeTab = JRequest::getWord('activeTab', 'settings');
     $createAccess = '';
     // Set properties for the template.
     $this->set('activeTab', $activeTab);
     $this->set('category', $category);
     if ($category->id) {
         $options = array('type' => SOCIAL_APPS_TYPE_FIELDS, 'group' => SOCIAL_TYPE_GROUP, 'state' => SOCIAL_STATE_PUBLISHED);
         // Get the available custom fields for groups
         $appsModel = FD::model('Apps');
         $defaultApps = $appsModel->getApps($options);
         // Get the steps for this id
         $stepsModel = FD::model('Steps');
         $steps = $stepsModel->getSteps($category->id, SOCIAL_TYPE_CLUSTERS);
         // Get the fields for this id
         $fieldsModel = FD::model('Fields');
         $fields = $fieldsModel->getCustomFields(array('uid' => $category->id, 'state' => 'all', 'group' => SOCIAL_TYPE_GROUP));
         // Empty array to pass to the trigger.
         $data = array();
         // Get the fields sample output
         $lib = FD::fields();
         $lib->trigger('onSample', SOCIAL_TYPE_GROUP, $fields, $data, array($lib->getHandler(), 'getOutput'));
         // Create a temporary storage
         $tmpFields = array();
         // Group the fields to each workflow properly
         if ($steps) {
             foreach ($steps as $step) {
                 $step->fields = array();
                 if (!empty($fields)) {
                     foreach ($fields as $field) {
                         if ($field->step_id == $step->id) {
                             $step->fields[] = $field;
                         }
                         $tmpFields[$field->app_id] = $field;
                     }
                 }
             }
         }
         // We need to know the amount of core apps and used core apps
         // 1.3 Update, we split out unique apps as well
         $coreAppsCount = 0;
         $usedCoreAppsCount = 0;
         $uniqueAppsCount = 0;
         $usedUniqueAppsCount = 0;
         // hide the apps if it is a core app and it is used in the field
         if ($defaultApps) {
             foreach ($defaultApps as $app) {
                 $app->hidden = false;
                 // If app is core, increase the coreAppsCount counter
                 if ($app->core) {
                     $coreAppsCount++;
                 }
                 // If app is NOT core and unique, increase the coreAppsCount counter
                 // This is because core apps are definitely unique, so we do not want to include core apps here
                 if (!$app->core && $app->unique) {
                     $uniqueAppsCount++;
                 }
                 // Test if this app has already been assigned to the $tmpFields
                 if (isset($tmpFields[$app->id]) && $app->core) {
                     $usedCoreAppsCount++;
                     $app->hidden = true;
                 }
                 // Test if this app is NOT core and unique and has already been assigned
                 // This is because core apps are definitely unique, so we do not want to include core apps here
                 if (isset($tmpFields[$app->id]) && !$app->core && $app->unique) {
                     $usedUniqueAppsCount++;
                     $app->hidden = true;
                 }
             }
         }
         unset($tmpFields);
         // Get the creation access
         $createAccess = $category->getAccess('create');
         // We need to know if there are any core apps remain
         $coreAppsRemain = $usedCoreAppsCount < $coreAppsCount;
         // We need to know if there are any unique apps remain
         $uniqueAppsRemain = $usedUniqueAppsCount < $uniqueAppsCount;
         // Set the profiles allowed to create groups
         $this->set('createAccess', $createAccess);
         // Set the flag of coreAppsRemain
         $this->set('coreAppsRemain', $coreAppsRemain);
         // Set the flag of uniqueAppsRemain
         $this->set('uniqueAppsRemain', $uniqueAppsRemain);
         // Set the default apps to the template.
         $this->set('defaultApps', $defaultApps);
         // Set the steps for the template.
         $this->set('steps', $steps);
         // Set the fields to the template
         $this->set('fields', $fields);
         // Set the field group type to the template
         $this->set('fieldGroup', SOCIAL_FIELDS_GROUP_GROUP);
         // Render the access form.
         $accessModel = FD::model('Access');
         $accessForm = $accessModel->getForm($category->id, SOCIAL_TYPE_CLUSTERS, 'access');
         $this->set('accessForm', $accessForm);
     }
     // Set the profiles allowed to create groups
     $this->set('createAccess', $createAccess);
     echo parent::display('admin/groups/form.category');
 }
Ejemplo n.º 28
0
 public function form()
 {
     // Check access
     if (!$this->authorise('easysocial.access.regions')) {
         $this->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     $id = $this->input->get('id', 0, 'int');
     $region = FD::table('Region');
     $region->load($id);
     if (empty($region->id)) {
         $this->setHeading('COM_EASYSOCIAL_REGIONS_NEW_REGION_TITLE');
         $this->setDescription('COM_EASYSOCIAL_REGIONS_NEW_REGION_DESCRIPTION');
     } else {
         $this->setHeading(JText::sprintf('COM_EASYSOCIAL_REGIONS_EDIT_REGION_TITLE', $region->name));
         $this->setDescription(JText::sprintf('COM_EASYSOCIAL_REGIONS_EDIT_REGION_DESCRIPTION', $region->name));
     }
     JToolbarHelper::apply('apply', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE'), false, false);
     JToolbarHelper::save('save', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE_AND_CLOSE'));
     JToolbarHelper::save2new('savenew', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_SAVE_AND_NEW'));
     JToolbarHelper::divider();
     JToolbarHelper::cancel('cancel', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_CANCEL'));
     if (!empty($region->parent_type)) {
         $parents = FD::model('Regions')->getRegions(array('type' => $region->parent_type));
         $this->set('parents', $parents);
     }
     $this->set('isNew', empty($region->id));
     $this->set('region', $region);
     echo parent::display('admin/regions/form');
 }
Ejemplo n.º 29
-1
 /**
  * Display a list of items that are reported on the site.
  *
  * @access	public
  * @return	null
  *
  */
 public function display($tpl = null)
 {
     // Apply buttons
     JToolbarHelper::custom('purge', 'trash', '', JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_BUTTON_PURGE_REPORTS'), false);
     JToolbarHelper::deleteList();
     // Set the structure heading here.
     $this->setHeading(JText::_('COM_EASYSOCIAL_TOOLBAR_TITLE_REPORTS'));
     // Set the page icon here.
     $this->setIcon('icon-jar jar-warning_cleanup');
     // Set the structure description here.
     $this->setDescription(JText::_('COM_EASYSOCIAL_DESCRIPTION_REPORTS'));
     $model = FD::model('Reports', array('initState' => true));
     $search = $model->getState('search');
     $limit = $model->getState('limit');
     $ordering = $model->getState('ordering');
     $direction = $model->getState('direction');
     // Get list of reports
     $reports = $model->getReports();
     // Get pagination
     $pagination = $model->getPagination();
     $this->set('ordering', $ordering);
     $this->set('direction', $direction);
     $this->set('search', $search);
     $this->set('limit', $limit);
     $this->set('pagination', $pagination);
     $this->set('reports', $reports);
     return parent::display('admin/reports/default');
 }