Example #1
0
 function display($tpl = null)
 {
     if (!FSS_Permission::auth("fss.view", "com_fss.glossary")) {
         return FSS_Helper::NoPerm();
     }
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $aparams = FSS_Settings::GetViewSettingsObj('glossary');
     $this->use_letter_bar = $aparams->get('use_letter_bar', 0);
     $this->long_desc = $aparams->get('long_desc', 0);
     if ($this->use_letter_bar) {
         $this->letters = array();
         if (FSS_Settings::get('glossary_all_letters')) {
             $letters = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
             foreach ($letters as $letter) {
                 $this->letters[$letter] = 0;
             }
         }
         $qry = "SELECT UPPER(SUBSTR(word,1,1)) as letter FROM #__fss_glossary";
         $where = array();
         $where[] = "published = 1";
         $where[] = 'language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')';
         $user = JFactory::getUser();
         $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')';
         if (count($where) > 0) {
             $qry .= " WHERE " . implode(" AND ", $where);
         }
         $qry .= " GROUP BY letter ORDER BY letter";
         $db->setQuery($qry);
         $letters = $db->loadObjectList();
         foreach ($letters as $letter) {
             $this->letters[$letter->letter] = 1;
         }
         if (count($this->letters) == 0) {
             return parent::display("empty");
         }
     }
     $this->curletter = "";
     // if we are showing on a per letter basis only
     if ($this->use_letter_bar == 2) {
         reset($this->letters);
         $this->curletter = FSS_Input::getString('letter', key($this->letters));
     }
     if (FSS_Input::getCmd('layout') == "word") {
         return $this->showWord();
     }
     $where = array();
     $where[] = "published = 1";
     $query = "SELECT * FROM #__fss_glossary";
     if ($this->curletter) {
         $where[] = "SUBSTR(word,1,1) = '" . FSSJ3Helper::getEscaped($db, $this->curletter) . "'";
     }
     $where[] = 'language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')';
     $user = JFactory::getUser();
     $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')';
     if (count($where) > 0) {
         $query .= " WHERE " . implode(" AND ", $where);
     }
     $query .= " ORDER BY word";
     $db->setQuery($query);
     $this->rows = $db->loadObjectList();
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'glossary'))) {
         $pathway->addItem("Glossary");
     }
     if (FSS_Settings::get('glossary_use_content_plugins')) {
         // apply plugins to article body
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('content');
         $art = new stdClass();
         $this->params = $mainframe->getParams('com_fss');
         foreach ($this->rows as &$row) {
             if ($row->description) {
                 $art->text = $row->description;
                 $art->noglossary = 1;
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fss.glossary', &$art, &$this->params, 0));
                 $row->description = $art->text;
             }
             if ($row->longdesc) {
                 $art->text = $row->longdesc;
                 $art->noglossary = 1;
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fss.glossary.long', &$art, &$this->params, 0));
                 $row->longdesc = $art->text;
             }
         }
     }
     FSS_Helper::IncludeModal();
     parent::display($tpl);
 }
Example #2
0
 function searchArticles()
 {
     $mainframe = JFactory::getApplication();
     $aparams = FSS_Settings::GetViewSettingsObj('kb');
     $search = FSS_Input::getString('kbsearch', '');
     $prodid = FSS_Input::getInt('prodid');
     $catid = FSS_Input::getInt('catid');
     $this->assign('cat_art_pages', $aparams->get('cat_art_pages', 0));
     $search = FSS_Input::getString('kbsearch');
     $this->assign('view_mode', $aparams->get('cat_cat_arts'));
     $document = JFactory::getDocument();
     $document->setTitle(JText::_("KNOWLEDGE_BASE") . ' - ' . JText::_("SEARCH_RESULTS"));
     $pagination = $this->get('ArtPaginationSearch');
     $this->pagination = $pagination;
     $this->assign('limit', $this->get("ArtLimit"));
     $this->product = $this->get("Product");
     $this->cat = $this->get("Cat");
     $this->results = $this->get("ArtsWhat");
     $this->search = $search;
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'kb'))) {
         $pathway->addItem(JText::_('KNOWLEDGE_BASE'), FSSRoute::_('index.php?option=com_fss&view=kb'));
     }
     $pathway->addItem(JText::_("SEARCH_RESULTS"));
     FSS_Helper::AllowCache();
     parent::display("kbsearch");
 }
Example #3
0
 function displayAllProducts()
 {
     $this->products = $this->get('Products');
     if (!is_array($this->products)) {
         $this->products = array();
     }
     FSS_Translate_Helper::Tr($this->products);
     $this->showresult = 1;
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'test'))) {
         $pathway->addItem(JText::_('TESTIMONIALS'), FSSRoute::_('index.php?option=com_fss&view=test'));
     }
     if (FSS_Settings::get('test_allow_no_product')) {
         $noproduct = array();
         $noproduct['id'] = 0;
         $noproduct['title'] = JText::_('GENERAL_TESTIMONIALS');
         $noproduct['description'] = '';
         $noproduct['image'] = '/components/com_fss/assets/images/generaltests.png';
         $this->products = array_merge(array($noproduct), $this->products);
     }
     if ($this->test_show_prod_mode != "list") {
         $idlist = array();
         if (count($this->products) > 0) {
             foreach ($this->products as &$prod) {
                 $prod['comments'] = array();
                 $idlist[] = $prod['id'];
             }
         }
         // not in normal list mode, get comments for each product
         $this->comments->itemid = $idlist;
         $this->comments->GetComments();
         foreach ($this->comments->_data as &$data) {
             if ($data['itemid'] > 0) {
                 $this->products[$data['itemid']]['comments'][] = $data;
             }
         }
     }
     parent::display();
 }
Example #4
0
 function DisplayGroupList()
 {
     $this->groups = $this->get('Groups');
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'groups'))) {
         $pathway->addItem(JText::_('TICKET_GROUPS'), FSSRoute::_('index.php?option=com_fss&view=admin_groups'));
     }
     FSS_Helper::IncludeModal();
     parent::display();
 }
Example #5
0
 function display($tpl = null)
 {
     if (!FSS_Permission::auth("fss.view", "com_fss.faq")) {
         return FSS_Helper::NoPerm();
     }
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'content' . DS . 'faqs.php';
     $this->content = new FSS_ContentEdit_FAQs();
     $this->content->Init();
     $model = $this->getModel();
     $model->content = $this->content;
     $mainframe = JFactory::getApplication();
     $faqid = FSS_Input::getInt('faqid');
     $aparams = FSS_Settings::GetViewSettingsObj('faqs');
     if ($faqid > 0) {
         $tmpl = FSS_Input::getCmd('tmpl');
         $this->tmpl = $tmpl;
         $this->setLayout("faq");
         $faq = $this->get("Faq");
         $this->faq = $faq;
         if (!$this->faq) {
             return JError::raiseWarning(404, JText::_('FAQ NOT FOUND'));
         }
         $pathway = $mainframe->getPathway();
         if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'faq'))) {
             $pathway->addItem(JText::_('FREQUENTLY_ASKED_QUESTIONS'), FSSRoute::_('index.php?option=com_fss&view=faq'));
         }
         $pathway->addItem($faq['title'], FSSRoute::_('&limitstart=&layout=&faqid=&catid=' . $faq['faq_cat_id']));
         // FIX LINK
         $pathway->addItem($faq['question']);
         if (FSS_Settings::get('faq_use_content_plugins')) {
             // apply plugins to article body
             $dispatcher =& JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             $art->text = $faq['answer'];
             $art->noglossary = 1;
             $this->params = $mainframe->getParams('com_fss');
             $results = $dispatcher->trigger('onContentPrepare', array('com_fss.faq', &$art, &$this->params, 0));
             $faq['answer'] = $art->text;
         }
         // load tags
         $db = JFactory::getDBO();
         $qry = "SELECT * FROM #__fss_faq_tags WHERE faq_id IN (" . FSSJ3Helper::getEscaped($db, $faqid) . ") GROUP BY tag ORDER BY tag";
         $db->setQuery($qry);
         $rows = $db->loadObjectList();
         $this->tags = array();
         foreach ($rows as &$row) {
             $id = $row->faq_id;
             $this->tags[] = "<a href='" . FSSRoute::_('index.php?option=com_fss&view=faq&tag=' . urlencode($row->tag) . '&Itemid=' . FSS_Input::getInt('Itemid')) . "'>{$row->tag}</a>";
         }
         //$document = JFactory::getDocument();
         //$document->setTitle(JText::_("FAQS") . ' - ' . $faq['title']);
         if (FSS_Input::getCmd('tmpl') == "component") {
             return parent::display("popup");
         }
         parent::display();
         return;
     }
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'faq'))) {
         $pathway->addItem(JText::_('FREQUENTLY_ASKED_QUESTIONS'), FSSRoute::_('index.php?option=com_fss&view=faq'));
     }
     $hide_allfaqs = $aparams->get('hide_allfaqs', 0);
     $show_featured = $aparams->get('show_featured', 0);
     $hide_tags = $aparams->get('hide_tags', 0);
     $hide_search = $aparams->get('hide_search', 0);
     $view_mode = $aparams->get('view_mode', 'questionwithpopup');
     $view_mode_cat = $aparams->get('view_mode_cat', 'list');
     $view_mode_incat = $aparams->get('view_mode_incat', 'list');
     $enable_pages = $aparams->get('enable_pages', 1);
     $num_cat_colums = $aparams->get('num_cat_colums', 1);
     if ($num_cat_colums < 1 && !$num_cat_colums) {
         $num_cat_colums = 1;
     }
     if ($view_mode_cat != "list") {
         $num_cat_colums = 1;
     }
     $catlist = $this->get("CatList");
     $search = $this->get("Search");
     $curcatdesc = $this->get("CurCatDesc");
     $curcatimage = $this->get("CurCatImage");
     $curcattitle = $this->get("CurCatTitle");
     $curcatid = $this->get("CurCatID");
     // Get data from the model
     if ($curcatid == -4) {
         return $this->listTags();
     }
     if ($curcatid == -5) {
         $curcattitle = "Featured FAQs";
         $curcatimage = "/components/com_fss/assets/images/featured.png";
     }
     $pagination = $this->get('Pagination');
     $model = $this->getModel();
     $search = $model->_search;
     if ($search || $curcatid > 0 || FSS_Input::getInt('catid') != "" || FSS_Input::getString('tag') != "") {
         $view_mode_cat = "";
     }
     if ($search) {
         FSS_Helper::AllowCache();
     }
     $items = array();
     if ($view_mode_cat == "inline" || $view_mode_cat == "accordian") {
         //echo "Getting all data!<br>";
         $alldata = $this->get("AllData");
         if (FSS_Settings::get('faq_use_content_plugins_list')) {
             // apply plugins to article body
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             foreach ($alldata as &$item) {
                 $art->text = $item['answer'];
                 $art->noglossary = 1;
                 $this->params = $mainframe->getParams('com_fss');
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fss.faq', &$art, &$this->params, 0));
                 $item['answer'] = $art->text;
             }
         }
         foreach ($catlist as &$cat) {
             $catid = $cat['id'];
             foreach ($alldata as $faq) {
                 if ($faq['faq_cat_id'] == $catid) {
                     $cat['faqs'][] = $faq;
                 }
             }
         }
         // inline mode, so if we have featured faqs listed, load the data for those
         $this->featured_faqs = $this->get('FeaturedFaqs');
     } else {
         $items = $this->get('Data');
         if (FSS_Settings::get('faq_use_content_plugins_list')) {
             // apply plugins to article body
             $dispatcher =& JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             foreach ($items as &$item) {
                 $art->text = $item['answer'];
                 $art->noglossary = 1;
                 $this->params =& $mainframe->getParams('com_fss');
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fss.faq', &$art, &$this->params, 0));
                 $item['answer'] = $art->text;
             }
         }
     }
     $showfaqs = true;
     $showcats = true;
     if (FSS_Input::getString('tag') != "") {
         // got tag selected
         $showfaqs = true;
         $showcats = false;
         $curcatid = -2;
         $pathway = $mainframe->getPathway();
         $pathway->addItem(JText::_("TAGS"), FSSRoute::_('index.php?option=com_fss&view=faq&catid=-4&Itemid=' . FSS_Input::getInt('Itemid')));
         $pathway->addItem(FSS_Input::getString('tag'));
         $curcattitle = FSS_Input::getString('tag');
         // do we have a category specified???
     } else {
         if (FSS_Input::getInt('catid', '') == '' && FSS_Input::getInt('search', '') == '') {
             // no cat specified
             $showfaqs = false;
             $curcatid = -2;
         } else {
             // got a cat specced
             $pathway = $mainframe->getPathway();
             $pathway->addItem($curcattitle);
             $showcats = false;
         }
     }
     // load tags
     $faqids = array();
     if ($items && is_array($items)) {
         foreach ($items as &$item) {
             $faqids[] = FSSJ3Helper::getEscaped($db, $item['id']);
         }
     }
     $db = JFactory::getDBO();
     $this->tags = array();
     if (count($faqids) > 0) {
         $qry = "SELECT * FROM #__fss_faq_tags WHERE faq_id IN (" . implode(", ", $faqids) . ") GROUP BY tag ORDER BY tag";
         $db->setQuery($qry);
         $rows = $db->loadObjectList();
         foreach ($rows as $row) {
             $id = $row->faq_id;
             if (!array_key_exists($id, $this->tags)) {
                 $this->tags[$id] = array();
             }
             $this->tags[$id][] = "<a href='" . FSSRoute::_('index.php?option=com_fss&view=faq&tag=' . urlencode($row->tag) . '&Itemid=' . FSS_Input::getInt('Itemid')) . "'>{$row->tag}</a>";
         }
     }
     // hide tags if none have been set
     $qry = "SELECT count(*) as cnt FROM #__fss_faq_tags";
     $db->setQuery($qry);
     $row = $db->loadObject();
     if ($row->cnt == 0) {
         $hide_tags = true;
     }
     $this->catlist = $catlist;
     $this->search = $search;
     $this->curcattitle = $curcattitle;
     $this->curcatimage = $curcatimage;
     $this->curcatdesc = $curcatdesc;
     // push data into the template
     $this->pagination = $pagination;
     $this->items = $items;
     $this->assign('curcatid', $curcatid);
     $this->assign('showcats', $showcats);
     $this->assign('showfaqs', $showfaqs);
     $this->assign('hide_allfaqs', $hide_allfaqs);
     $this->assign('show_featured', $show_featured);
     $this->assign('hide_tags', $hide_tags);
     $this->assign('hide_search', $hide_search);
     $this->assign('view_mode', $view_mode);
     $this->assign('num_cat_colums', $num_cat_colums);
     $this->assign('view_mode_cat', $view_mode_cat);
     $this->assign('view_mode_incat', $view_mode_incat);
     $this->assign('enable_pages', $enable_pages);
     $db = JFactory::getDBO();
     $qry = "SELECT tag FROM #__fss_faq_tags ";
     $qry .= ' WHERE language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')';
     $qry .= "GROUP BY tag ORDER BY tag";
     $db->setQuery($qry);
     $this->all_tags = $db->loadObjectList();
     FSS_Helper::IncludeModal();
     parent::display($tpl);
 }
Example #6
0
 function display($tpl = null)
 {
     if (!FSS_Permission::auth("fss.view", "com_fss.announce")) {
         return FSS_Helper::NoPerm();
     }
     $mainframe = JFactory::getApplication();
     $aparams = $mainframe->getPageParameters('com_fss');
     $announceid = FSS_Input::getInt('announceid');
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'content' . DS . 'announce.php';
     $this->content = new FSS_ContentEdit_Announce();
     $this->content->Init();
     $model = $this->getModel();
     $model->content = $this->content;
     if ($announceid) {
         $tmpl = FSS_Input::getCmd('tmpl');
         $this->tmpl = $tmpl;
         $this->setLayout("announce");
         $this->announce = $this->get("Announce");
         if (!$this->announce) {
             $mainframe->redirect(FSSRoute::_("index.php?option=com_fss&view=announce", false));
         }
         $pathway = $mainframe->getPathway();
         if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'announce'))) {
             $pathway->addItem(JText::_("ANNOUNCEMENTS"), FSSRoute::_('&limitstart=announceid='));
         }
         // FIX LINK
         $pathway->addItem($this->announce['title']);
         $this->comments = new FSS_Comments('announce', $announceid);
         $this->comments->PerPage(FSS_Settings::Get('announce_comments_per_page'));
         if ($this->comments->Process()) {
             return;
         }
         if (FSS_Settings::get('announce_use_content_plugins')) {
             // apply plugins to article body
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             $art->text = $this->announce['body'];
             $art->noglossary = 1;
             $this->params = $mainframe->getParams('com_fss');
             $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce', &$art, &$this->params, 0));
             $this->announce['body'] = $art->text;
             if ($this->announce['fulltext']) {
                 $art->text = $this->announce['fulltext'];
                 $art->noglossary = 1;
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce.fulltext', &$art, &$this->params, 0));
                 $this->announce['fulltext'] = $art->text;
             }
         }
         $this->parser = new FSSParser();
         $type = FSS_Settings::Get('announcesingle_use_custom') ? 2 : 3;
         $this->parser->Load("announcesingle", $type);
         parent::display($tpl);
         return;
     }
     $pathway = $mainframe->getPathway();
     if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'announce'))) {
         $pathway->addItem(JText::_("ANNOUNCEMENTS"));
     }
     $this->announces = $this->get('Announces');
     $this->pagination = $this->get('Pagination');
     if (FSS_Settings::get('announce_use_content_plugins_list')) {
         // apply plugins to article body
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('content');
         $art = new stdClass();
         foreach ($this->announces as &$item) {
             $art->text = $item['body'];
             $art->noglossary = 1;
             $this->params = $mainframe->getParams('com_fss');
             $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce', &$art, &$this->params, 0));
             $item['body'] = $art->text;
         }
     }
     $this->comments = new FSS_Comments('announce', null, $this->announces);
     $this->parser = new FSSParser();
     $type = FSS_Settings::Get('announce_use_custom') ? 2 : 3;
     $this->parser->Load("announce", $type);
     if (FSS_Input::getCmd('feed') == "rss") {
         //header("Content-Type: text/xml");
         header("Content-Type: application/xml; charset=UTF-8");
         parent::display("rss");
         exit;
     } else {
         parent::display($tpl);
     }
 }