Example #1
0
 public function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $model = $this->getModel('Acl');
     $document = JFactory::getDocument();
     $cid = JRequest::getVar('cid', null, 'REQUEST');
     $type = JRequest::getVar('type', '', 'REQUEST');
     $add = JRequest::getVar('add', '', 'REQUEST');
     if ((is_null($cid) || empty($type)) && empty($add)) {
         $mainframe->redirect('index.php?option=com_easydiscuss&view=acls', JText::_('Invalid Id or acl type. Please try again.'), 'error');
     }
     $rulesets = $model->getRuleSet($type, $cid, $add);
     if ($type == 'assigned') {
         $document->setTitle(JText::_("COM_EASYDISCUSS_ACL_ASSIGN_USER"));
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_ACL_ASSIGN_USER'), 'acl');
     } else {
         $document->setTitle(JText::_("COM_EASYDISCUSS_ACL_JOOMLA_USER_GROUP"));
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_ACL_JOOMLA_USER_GROUP'), 'acl');
     }
     $joomlaVersion = DiscussHelper::getJoomlaVersion();
     $this->assignRef('joomlaversion', $joomlaVersion);
     $this->assignRef('rulesets', $rulesets);
     $this->assignRef('type', $type);
     $this->assignRef('add', $add);
     parent::display($tpl);
 }
Example #2
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.spools', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.spools.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.spools.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.spools.filter_order', 'filter_order', 'created', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.spools.filter_order_Dir', 'filter_order_Dir', 'asc', 'word');
     $mails = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->assign('mails', $mails);
     $this->assign('pagination', $pagination);
     $this->assign('state', JHTML::_('grid.state', $filter_state, JText::_('COM_EASYDISCUSS_SENT'), JText::_('COM_EASYDISCUSS_PENDING')));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
Example #3
0
 public function display($tpl = null)
 {
     $id = JRequest::getInt('id', 0);
     $badge = DiscussHelper::getTable('Badges');
     $badge->load($id);
     if (!$badge->created) {
         $date = DiscussHelper::getHelper('Date')->dateWithOffset(DiscussHelper::getDate()->toMySQL());
         $badge->created = $date->toMySQL();
     }
     // There could be some errors here.
     if (JRequest::getMethod() == 'POST') {
         $badge->bind(JRequest::get('post'));
         // Description might contain html codes
         $description = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $badge->description = $description;
     }
     $jConfig = DiscussHelper::getJConfig();
     $editor = JFactory::getEditor($jConfig->get('editor'));
     $model = $this->getModel('Badges');
     $rules = $model->getRules();
     $badges = $this->getBadges();
     $this->assign('editor', $editor);
     $this->assign('badges', $badges);
     $this->assign('rules', $rules);
     $this->assign('badge', $badge);
     parent::display($tpl);
 }
Example #4
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.tags', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.tags.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.tags.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.tags.filter_order', 'filter_order', 'id', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.tags.filter_order_Dir', 'filter_order_Dir', '', 'word');
     // Get data from the model
     $tags = $this->get('Data');
     $model = $this->getModel('tags');
     for ($i = 0; $i < count($tags); $i++) {
         $tag = $tags[$i];
         $tag->count = $model->getUsedCount($tag->id);
         $tag->title = JString::trim($tag->title);
         $tag->alias = JString::trim($tag->alias);
     }
     $pagination = $this->get('Pagination');
     $this->assignRef('tags', $tags);
     $this->assignRef('pagination', $pagination);
     $this->assign('state', JHTML::_('grid.state', $filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
Example #5
0
 public function display($tpl = null)
 {
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $tagId = JRequest::getVar('tagid', '');
     $tag = JTable::getInstance('Tags', 'Discuss');
     $tag->load($tagId);
     $tag->title = JString::trim($tag->title);
     $tag->alias = JString::trim($tag->alias);
     $this->tag = $tag;
     // Generate All tags for merging selections
     $tagsModel = $this->getModel('Tags');
     $tags = $tagsModel->getData(false);
     $tagList = array();
     array_push($tagList, JHTML::_('select.option', 0, 'Select tag', 'value', 'text', false));
     if (!empty($tags)) {
         foreach ($tags as $item) {
             if ($item->id != $tagId) {
                 $tagList[] = JHtml::_('select.option', $item->id, $item->title);
             }
         }
     }
     // Set default values for new entries.
     if (empty($tag->created)) {
         $date = DiscussHelper::getDate();
         $date->setOffSet($mainframe->getCfg('offset'));
         $tag->created = $date->toFormat();
         $tag->published = true;
     }
     $this->assignRef('tag', $tag);
     $this->assignRef('tagList', $tagList);
     parent::display($tpl);
 }
Example #6
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.settings', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $config = DiscussHelper::getConfig();
     $jconfig = DiscussHelper::getJConfig();
     $defaultSAId = DiscussHelper::getDefaultSAIds();
     $joomlaVersion = DiscussHelper::getJoomlaVersion();
     $joomlaGroups = DiscussHelper::getJoomlaUserGroups();
     $this->assignRef('config', $config);
     $this->assignRef('jconfig', $jconfig);
     $this->assignRef('defaultSAId', $defaultSAId);
     $this->assignRef('defaultLength', $defaultLength);
     $this->assignRef('joomlaversion', $joomlaVersion);
     $this->assignRef('joomlaGroups', $joomlaGroups);
     if ($this->getLayout() == 'default') {
         $app = JFactory::getApplication();
         $app->redirect('index.php?option=com_easydiscuss&view=settings&layout=default_main_workflow&child=general');
     }
     parent::display($tpl);
 }
Example #7
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.replies', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.replies.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.replies.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.replies.filter_order', 'filter_order', 'a.id', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.replies.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $postModel = $this->getModel('Replies');
     $posts = $postModel->getPosts();
     $pagination = $postModel->getPagination();
     $this->assignRef('posts', $posts);
     $this->assignRef('pagination', $pagination);
     $this->assign('state', $this->getFilterState($filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
Example #8
0
 public function reasons()
 {
     $id = JRequest::getVar('id', '');
     $reportModel = $this->getModel('reports');
     $reasons = $reportModel->getReasons($id);
     $this->assignRef('reasons', $reasons);
     parent::display();
 }
Example #9
0
 public function form()
 {
     $id = JRequest::getInt('id');
     $postTypes = DiscussHelper::getTable('Post_types');
     if (!empty($id)) {
         $postTypes->load($id);
     }
     $this->assign('postTypes', $postTypes);
     // This will go to form.php
     parent::display();
 }
Example #10
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.ranks', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     $model = $this->getModel('Ranks');
     $ranks = $model->getRanks();
     $config = DiscussHelper::getConfig();
     $this->assign('ranks', $ranks);
     $this->assign('config', $config);
     parent::display($tpl);
 }
Example #11
0
 public function display($tpl = null)
 {
     // Initialise variables
     $doc = JFactory::getDocument();
     $doc->addScript(JURI::root() . 'administrator/components/com_easydiscuss/assets/js/admin.js');
     // Load front end language file.
     JFactory::getLanguage()->load('com_easydiscuss', JPATH_ROOT);
     $postId = JRequest::getInt('id', 0);
     $parentId = JRequest::getString('pid', '');
     $source = JRequest::getVar('source', 'posts');
     $post = JTable::getInstance('Posts', 'Discuss');
     $post->load($postId);
     $post->content_raw = $post->content;
     // Get post's tags
     $postModel = $this->getModel('Posts');
     $post->tags = $postModel->getPostTags($post->id);
     $post->content = EasyDiscussParser::html2bbcode($post->content);
     // Select top 20 tags.
     $tagmodel = $this->getModel('Tags');
     $populartags = $tagmodel->getTagCloud('20', 'post_count', 'DESC');
     $repliesCnt = $postModel->getPostRepliesCount($post->id);
     $nestedCategories = DiscussHelper::populateCategories('', '', 'select', 'category_id', $post->category_id, true, true);
     $config = DiscussHelper::getConfig();
     // Get's the creator's name
     $creatorName = $post->poster_name;
     if ($post->user_id) {
         $author = DiscussHelper::getTable('Profile');
         $author->load($post->user_id);
         $creatorName = $author->getName();
     }
     require_once DISCUSS_CLASSES . '/composer.php';
     $composer = new DiscussComposer("creating", $post);
     $this->assignRef('creatorName', $creatorName);
     $this->assignRef('config', $config);
     $this->assignRef('post', $post);
     $this->assignRef('populartags', $populartags);
     $this->assignRef('repliesCnt', $repliesCnt);
     $this->assignRef('source', $source);
     $this->assignRef('parentId', $parentId);
     $this->assignRef('nestedCategories', $nestedCategories);
     $this->assignRef('composer', $composer);
     $this->assign('joomlaversion', DiscussHelper::getJoomlaVersion());
     //load require javascript string
     DiscussHelper::loadString(JRequest::getVar('view'));
     parent::display($tpl);
 }
Example #12
0
 public function display($tpl = null)
 {
     // Initialise variables
     $config = DiscussHelper::getConfig();
     $catId = JRequest::getVar('catid', '');
     $cat = JTable::getInstance('Category', 'Discuss');
     $cat->load($catId);
     $this->cat = $cat;
     $this->addPathway('Home', 'index.php?option=com_easydiscuss');
     $this->addPathway(JText::_('Categories'), 'index.php?option=com_easydiscuss&view=categories');
     if ($catId) {
         $this->addPathway('Edit Category');
     } else {
         $this->addPathway('New Category');
     }
     // Set default values for new entries.
     if (empty($cat->created)) {
         $date = DiscussDateHelper::getDate();
         $now = DiscussDateHelper::toFormat($date);
         $cat->created = $now;
         $cat->published = true;
     }
     $catRuleItems = JTable::getInstance('CategoryAclItem', 'Discuss');
     $categoryRules = $catRuleItems->getAllRuleItems();
     $assignedGroupACL = $cat->getAssignedACL('group');
     $assignedUserACL = $cat->getAssignedACL('user');
     $assignedGroupMod = $cat->getAssignedModerator('group');
     $assignedUserMod = $cat->getAssignedModerator('user');
     $joomlaGroups = DiscussHelper::getJoomlaUserGroups();
     $parentList = DiscussHelper::populateCategories('', '', 'select', 'parent_id', $cat->parent_id);
     $jConfig = DiscussHelper::getJConfig();
     $editor = JFactory::getEditor($jConfig->get('editor'));
     $this->assignRef('editor', $editor);
     $this->assignRef('cat', $cat);
     $this->assignRef('config', $config);
     $this->assignRef('acl', $acl);
     $this->assignRef('parentList', $parentList);
     $this->assignRef('categoryRules', $categoryRules);
     $this->assignRef('assignedGroupACL', $assignedGroupACL);
     $this->assignRef('assignedUserACL', $assignedUserACL);
     $this->assignRef('assignedGroupMod', $assignedGroupMod);
     $this->assignRef('assignedUserMod', $assignedUserMod);
     $this->assignRef('joomlaGroups', $joomlaGroups);
     parent::display($tpl);
 }
Example #13
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.posts', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.posts.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.posts.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.posts.filter_order', 'filter_order', 'a.id', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.posts.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $parentId = JRequest::getString('pid', '');
     $parentTitle = '';
     $this->addPathway(JText::_('COM_EASYDISCUSS_BREADCRUMB_HOME'), 'index.php?option=com_easydiscuss');
     if (!empty($parentId)) {
         $post = JTable::getInstance('Posts', 'Discuss');
         $post->load($parentId);
         $parentTitle = $post->title;
         $this->addPathway(JText::_('COM_EASYDISCUSS_BREADCRUMB_DISCUSSIONS'), 'index.php?option=com_easydiscuss&view=posts');
         $this->addPathway(JText::sprintf('COM_EASYDISCUSS_BREADCRUMB_VIEWING_REPLIES', $parentTitle), '');
     } else {
         $this->addPathway(JText::_('COM_EASYDISCUSS_BREADCRUMB_DISCUSSIONS'), '');
     }
     $postModel = $this->getModel('Threaded');
     $filterCategory = JRequest::getInt('category_id');
     $categoryFilter = DiscussHelper::populateCategories('', '', 'select', 'category_id', $filterCategory, true, false, true, true, 'inputbox');
     $posts = $postModel->getPosts();
     $pagination = $postModel->getPagination();
     $this->assignRef('posts', $posts);
     $this->assignRef('pagination', $pagination);
     $this->assign('categoryFilter', $categoryFilter);
     $this->assign('state', $this->getFilterState($filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     $this->assign('parentId', $parentId);
     $this->assign('parentTitle', $parentTitle);
     parent::display($tpl);
 }
Example #14
0
 public function diplayLabel()
 {
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $labelId = JRequest::getVar('label_id', '');
     $label = DiscussHelper::getTable('Label');
     $label->load($labelId);
     $label->title = JString::trim($label->title);
     $this->label = $label;
     // Set default values for new entries.
     if (empty($label->created)) {
         $date = DiscussHelper::getDate();
         $date->setOffSet($mainframe->getCfg('offset'));
         $label->created = $date->toFormat();
         $label->published = true;
     }
     $this->assignRef('label', $label);
     parent::display('edit');
 }
Example #15
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.categories', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.categories.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.categories.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.categories.filter_order', 'filter_order', 'lft', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.categories.filter_order_Dir', 'filter_order_Dir', 'asc', 'word');
     // Get data from the model
     $model = $this->getModel('Categories');
     $categories = $model->getData();
     $ordering = array();
     JTable::addIncludePath(DISCUSS_TABLES);
     $category = JTable::getInstance('Category', 'Discuss');
     for ($i = 0; $i < count($categories); $i++) {
         $category = $categories[$i];
         $category->count = $model->getUsedCount($category->id, false, true);
         $category->child_count = $model->getChildCount($category->id);
         // Preprocess the list of items to find ordering divisions.
         $ordering[$category->parent_id][] = $category->id;
     }
     $pagination = $this->get('Pagination');
     $this->addPathway('Home', 'index.php?option=com_easydiscuss');
     $this->addPathway(JText::_('COM_EASYDISCUSS_BREADCRUMBS_CATEGORIES'));
     $this->assignRef('categories', $categories);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('ordering', $ordering);
     $this->assign('state', JHTML::_('grid.state', $filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
Example #16
0
 public function display($tpl = null)
 {
     $task = JRequest::getCmd('task');
     // Set the panel title
     $this->setPanelTitle(JText::_('COM_EASYDISCUSS_DASHBOARD'));
     $categoryModel = $this->getModel('Categories');
     $rows = $categoryModel->getAllCategories();
     $categories = array();
     foreach ($rows as &$row) {
         $category = DiscussHelper::getTable('Category');
         $category->load($row->id);
         $categories[] = $category;
     }
     $this->assign('categories', $categories);
     $config = DiscussHelper::getConfig();
     $this->assign('config', $config);
     $this->addPathway('Home', '');
     $this->setLayout('default');
     parent::display($tpl);
 }
Example #17
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.badges', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     if ($this->getLayout() == 'install') {
         return $this->installLayout();
     }
     if ($this->getLayout() == 'managerules') {
         return $this->manageRules();
     }
     $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.badges.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easydiscuss.badges.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easydiscuss.badges.filter_order', 'filter_order', 'a.id', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.badges.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $exclusion = JRequest::getVar('exclude', '');
     $model = $this->getModel('Badges');
     $badges = $model->getBadges($exclusion);
     $pagination = $this->get('Pagination');
     // Determines if the current request is shown in a modal window.
     $browse = JRequest::getInt('browse', 0);
     $browseFunction = JRequest::getVar('browseFunction', '');
     $this->assign('browseFunction', $browseFunction);
     $this->assign('browse', $browse);
     $this->assign('badges', $badges);
     $this->assign('pagination', $pagination);
     $this->assign('state', $this->getFilterState($filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
Example #18
0
 public function display($tpl = null)
 {
     // Initialise variables
     $config = DiscussHelper::getConfig();
     $id = JRequest::getInt('id');
     $profile = JTable::getInstance('Profile', 'Discuss');
     $profile->load($id);
     $userparams = DiscussHelper::getRegistry($profile->get('params'));
     $siteDetails = DiscussHelper::getRegistry($profile->get('site'));
     $avatarIntegration = $config->get('layout_avatarIntegration', 'default');
     $user = JFactory::getUser($id);
     $isNew = $user->id == 0 ? true : false;
     $badges = $profile->getBadges();
     $model = $this->getModel('Badges');
     $history = $model->getBadgesHistory($profile->id);
     $params = $user->getParameters(true);
     // Badge id's that are assigned to the user.
     $badgeIds = '';
     for ($i = 0; $i < count($badges); $i++) {
         $badgeIds .= $badges[$i]->id;
         if (next($badges) !== false) {
             $badgeIds .= ',';
         }
         $badgeUser = DiscussHelper::getTable('BadgesUsers');
         $badgeUser->loadByUser($id, $badges[$i]->id);
         $badges[$i]->reference_id = $badgeUser->id;
         $badges[$i]->custom = $badgeUser->custom;
     }
     $this->assign('badgeIds', $badgeIds);
     $this->assignRef('badges', $badges);
     $this->assignRef('history', $history);
     $this->assignRef('config', $config);
     $this->assignRef('profile', $profile);
     $this->assignRef('user', $user);
     $this->assignRef('isNew', $isNew);
     $this->assignRef('params', $params);
     $this->assignRef('avatarIntegration', $avatarIntegration);
     $this->assignRef('userparams', $userparams);
     $this->assignRef('siteDetails', $siteDetails);
     parent::display($tpl);
 }
Example #19
0
 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.acls', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $document = JFactory::getDocument();
     $mainframe = JFactory::getApplication();
     $model = $this->getModel('Acl');
     $config = DiscussHelper::getConfig();
     $type = $mainframe->getUserStateFromRequest('com_easydiscuss.acls.filter_type', 'filter_type', 'group', 'word');
     // Filtering
     $filter = new stdClass();
     $filter->type = $this->getFilterType($type);
     $filter->search = $mainframe->getUserStateFromRequest('com_easydiscuss.acls.search', 'search', '', 'string');
     // Sorting
     $sort = new stdClass();
     $sort->order = $mainframe->getUserStateFromRequest('com_easydiscuss.acls.filter_order', 'filter_order', 'a.`id`', 'cmd');
     $sort->orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.acls.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $rulesets = $model->getRuleSets($type);
     $pagination = $model->getPagination($type);
     if ($type == 'assigned') {
         $document->setTitle(JText::_("COM_EASYDISCUSS_ACL_ASSIGN_USER"));
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_ACL_ASSIGN_USER'), 'acl');
     } else {
         $document->setTitle(JText::_("COM_EASYDISCUSS_ACL_JOOMLA_USER_GROUP"));
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_ACL_JOOMLA_USER_GROUP'), 'acl');
     }
     $this->assignRef('config', $config);
     $this->assignRef('rulesets', $rulesets);
     $this->assignRef('filter', $filter);
     $this->assignRef('sort', $sort);
     $this->assignRef('type', $type);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Example #20
0
 public function form()
 {
     $id = JRequest::getInt('id', 0);
     $this->addPathway('Home', 'index.php?option=com_easydiscuss');
     $this->addPathway('Points', 'index.php?option=com_easydiscuss&view=points');
     $point = DiscussHelper::getTable('Points');
     $point->load($id);
     if ($point->id) {
         $this->addPathway(JText::_('COM_EASYDISCUSS_PATHWAY_EDIT_POINT'));
     } else {
         $this->addPathway(JText::_('COM_EASYDISCUSS_PATHWAY_NEW_POINT'));
     }
     if (!$point->created) {
         $date = DiscussHelper::getHelper('Date')->dateWithOffset(DiscussHelper::getDate()->toMySQL());
         $point->created = $date->toMySQL();
     }
     $model = $this->getModel('Points');
     $rules = $model->getRules();
     $this->assign('rules', $rules);
     $this->assign('point', $point);
     parent::display();
 }
Example #21
0
 public function twitter($tpl = null)
 {
     $step = JRequest::getVar('step');
     $config = DiscussHelper::getConfig();
     $callback = DiscussRouter::getRoutedURL('index.php?option=com_easydiscuss&view=autoposting', false, true);
     $oauth = DiscussHelper::getHelper('OAuth')->getConsumer('twitter', $config->get('main_autopost_twitter_id'), $config->get('main_autopost_twitter_secret'), $callback);
     $oauth = DiscussHelper::getTable('OAuth');
     $oauth->loadByType('twitter');
     $associated = (bool) $oauth->id;
     if ($step == '3') {
         //this mean we completed the final steps. reset step to empty.
         $mainframe =& JFactory::getApplication();
         $mainframe->redirect('index.php?option=com_easydiscuss&view=autoposting&layout=form&type=twitter');
         $mainframe->close();
     }
     $this->assignRef('associated', $associated);
     $this->assignRef('config', $config);
     $this->assignRef('step', $step);
     parent::display($tpl);
 }
Example #22
0
 public function browse()
 {
     $app = JFactory::getApplication();
     $filter_state = $app->getUserStateFromRequest('com_easydiscuss.users.filter_state', 'filter_state', '*', 'word');
     $search = $app->getUserStateFromRequest('com_easydiscuss.users.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $app->getUserStateFromRequest('com_easydiscuss.users.filter_order', 'filter_order', 'id', 'cmd');
     $orderDirection = $app->getUserStateFromRequest('com_easydiscuss.users.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $userModel = DiscussHelper::getModel('Users');
     $users = $userModel->getUsers();
     if (DiscussHelper::getJoomlaVersion() >= '1.6' && count($users) > 0) {
         for ($i = 0; $i < count($users); $i++) {
             $joomlaUser = JFactory::getUser($users[$i]->id);
             $userGroupsKeys = array_keys($joomlaUser->groups);
             $userGroups = implode(', ', $userGroupsKeys);
             $users[$i]->usergroups = $userGroups;
         }
     }
     $pagination = $userModel->getPagination();
     $state = JHTML::_('grid.state', $filter_state);
     $this->assign('users', $users);
     $this->assign('pagination', $pagination);
     $this->assign('search', $search);
     $this->assign('state', $state);
     $this->assign('orderDirection', $orderDirection);
     $this->assign('order', $order);
     $this->assign('pagination', $pagination);
     parent::display('users');
 }
Example #23
0
 public function communitypolls()
 {
     $this->set('installed', $this->communityPollsExists());
     parent::display('communitypolls');
 }
Example #24
0
 public function installLayout($tpl)
 {
     return parent::display($tpl);
 }
Example #25
0
 public function diplayRole()
 {
     // Initialise variables
     $mainframe = JFactory::getApplication();
     $roleId = JRequest::getVar('role_id', '');
     $role = DiscussHelper::getTable('Role');
     $role->load($roleId);
     $role->title = JString::trim($role->title);
     $this->role = $role;
     // Set default values for new entries.
     if (empty($role->created_time)) {
         $date = DiscussHelper::getHelper('Date')->dateWithOffSet();
         $role->created_time = $date->toFormat();
         $role->published = true;
     }
     $groups = DiscussHelper::getJoomlaUserGroups();
     // Remove the selected usergroups
     $db = DiscussHelper::getDbo();
     $query = 'SELECT `usergroup_id` FROM `#__discuss_roles`';
     $db->setQuery($query);
     $result = $db->loadResultArray();
     if (!empty($result)) {
         foreach ($groups as $key => $group) {
             if (in_array($group->id, $result) && $group->id != $role->usergroup_id) {
                 unset($groups[$key]);
             }
         }
     }
     $usergroupList = JHTML::_('select.genericlist', $groups, 'usergroup_id', 'class="full-width"', 'id', 'name', $role->usergroup_id);
     $this->assignRef('role', $role);
     $this->assignRef('usergroupList', $usergroupList);
     $colors = array();
     $colors[] = JHTML::_('select.option', 'success', JText::_('COM_EASYDISCUSS_LABEL_COLORCODE_SUCCESS'));
     $colors[] = JHTML::_('select.option', 'warning', JText::_('COM_EASYDISCUSS_LABEL_COLORCODE_WARNING'));
     $colors[] = JHTML::_('select.option', 'important', JText::_('COM_EASYDISCUSS_LABEL_COLORCODE_IMPORTANT'));
     $colors[] = JHTML::_('select.option', 'info', JText::_('COM_EASYDISCUSS_LABEL_COLORCODE_INFO'));
     $colors[] = JHTML::_('select.option', 'inverse', JText::_('COM_EASYDISCUSS_LABEL_COLORCODE_INVERSE'));
     $colorList = JHTML::_('select.genericlist', $colors, 'colorcode', 'class="full-width"', 'value', 'text', $role->colorcode);
     $this->assignRef('colorList', $colorList);
     parent::display('edit');
 }
Example #26
0
 public function discussions()
 {
     parent::display('discussions');
 }
Example #27
0
 public function form()
 {
     $app = JFactory::getApplication();
     $id = JRequest::getInt('id', '');
     $field = DiscussHelper::getTable('CustomFields');
     $field->load($id);
     $this->addPathway('Home', 'index.php?option=com_easydiscuss');
     $this->addPathway('Custom Fields', 'index.php?option=com_easydiscuss&view=customfields');
     $field->title = JString::trim($field->title);
     $this->id = $field;
     if (!$field) {
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_ADD_NEW_CUSTOMFIELDS'), 'customs');
         $this->addPathway('New Field', '');
     } else {
         JToolBarHelper::title(JText::_('COM_EASYDISCUSS_EDITING_CUSTOMFIELDS'), 'customs');
         $this->addPathway('Editing Field', '');
     }
     JHTML::_('behavior.modal');
     // Set default values for new entries.
     if (empty($field->created_time)) {
         $date = DiscussHelper::getHelper('Date')->dateWithOffSet();
         $field->created_time = $date->toFormat();
         $field->published = true;
     }
     $customAclItems = JTable::getInstance('CustomFieldsACL', 'Discuss');
     $customFieldsAcl = $customAclItems->getCustomFieldsACL();
     $assignedGroupACL = $field->getAssignedACL('group');
     $assignedUserACL = $field->getAssignedACL('user');
     $joomlaGroups = DiscussHelper::getJoomlaUserGroups();
     $this->assignRef('field', $field);
     $this->assignRef('assignedGroupACL', $assignedGroupACL);
     $this->assignRef('assignedUserACL', $assignedUserACL);
     $this->assignRef('customFieldsAcl', $customFieldsAcl);
     $this->assignRef('joomlaGroups', $joomlaGroups);
     parent::display();
 }