Пример #1
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     $aparams = FSS_Settings::GetViewSettingsObj('kb');
     $this->_enable_prod_pages = $aparams->get('main_prod_pages', 0);
     if ($this->_enable_prod_pages == 1) {
         $limit = $mainframe->getUserStateFromRequest('global.list.limit_prod', 'limit', FSS_Settings::Get('kb_prod_per_page'), 'int');
         $limitstart = FSS_Input::getInt('limitstart');
         // In case limit has been changed, adjust it
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit_prod', $limit);
         $this->setState('limitstart', $limitstart);
     }
     $this->_enable_art_pages = $aparams->get('cat_art_pages', 0);
     if ($this->_enable_art_pages == 1) {
         $limit = $mainframe->getUserStateFromRequest('global.list.limit_art', 'limit', FSS_Settings::Get('kb_art_per_page'), 'int');
         $limitstart = FSS_Input::getInt('limitstart');
         // In case limit has been changed, adjust it
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit_art', $limit);
         $this->setState('limitstart', $limitstart);
     }
     //$aparams = new stdClass();
 }
Пример #2
0
 function display($tpl = null)
 {
     FSS_Helper::StylesAndJS(array('accordion'));
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $userid = $user->id;
     $db = JFactory::getDBO();
     $this->params = FSS_Settings::GetViewSettingsObj('test');
     $this->test_show_prod_mode = $this->params->get('test_show_prod_mode', 'accordian');
     $this->test_always_prod_select = $this->params->get('test_always_prod_select', '0');
     $layout = FSS_Input::getCmd('layout');
     $this->prodid = FSS_Input::getInt('prodid');
     if ($this->prodid == "") {
         $this->prodid = -1;
     }
     $this->products = $this->get('Products');
     //print_p($this->products);
     if (count($this->products) == 0) {
         $this->prodid = 0;
     }
     $this->comments = new FSS_Comments("test", $this->prodid);
     if ($this->prodid == -1) {
         $this->comments->opt_show_posted_message_only = 1;
     }
     $onlyprodid = FSS_Input::getCmd('onlyprodid', 'x');
     if ($onlyprodid != 'x' && $onlyprodid != -1) {
         $this->comments->itemid = (int) $onlyprodid;
         $this->comments->show_item_select = false;
     }
     if ($this->params->get('hide_add', 0)) {
         $this->comments->can_add = 0;
     }
     if ($layout == "create") {
         $this->setupCommentsCreate();
     }
     if ($this->comments->Process()) {
         return;
     }
     if ($layout == "create") {
         return $this->displayCreate();
     }
     if ($this->prodid != -1) {
         return $this->displaySingleProduct();
     }
     return $this->displayAllProducts();
 }
Пример #3
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     // Get pagination request variables
     $aparams = FSS_Settings::GetViewSettingsObj('faqs');
     $this->_enable_pages = $aparams->get('enable_pages', 1);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSS_Settings::Get('faq_per_page'), 'int');
     if ($this->_enable_pages == 0) {
         $limit = 999999;
     }
     $limitstart = FSS_Input::getInt('limitstart', 0);
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
     $this->_curcatid = FSS_Input::getInt('catid', '');
     $this->_search = FSS_Input::getString('search', '');
     $this->_catlist = $this->_getCatList();
     if ($this->_search != "") {
         $this->_curcattitle = JText::_("SEARCH_RESULTS");
         $this->_curcatid = -1;
         $this->_curcatimage = "/components/com_fss/assets/images/search.png";
     } else {
         if ($this->_curcatid == "0") {
             $this->_curcattitle = JText::_("ALL_FAQS");
             $this->_curcatimage = "/components/com_fss/assets/images/allfaqs.png";
         } else {
             foreach ($this->_catlist as $cat) {
                 if ($cat['id'] == $this->_curcatid) {
                     $this->_curcattitle = $cat['title'];
                     $this->_curcatimage = $cat['image'];
                     $this->_curcatdesc = $cat['description'];
                 }
             }
         }
     }
 }
Пример #4
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);
 }
Пример #5
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");
 }
Пример #6
0
 function listTags()
 {
     $mainframe = JFactory::getApplication();
     $aparams = FSS_Settings::GetViewSettingsObj('faqs');
     $pathway = $mainframe->getPathway();
     $pathway->addItem(JText::_("TAGS"));
     $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->tags = $db->loadObjectList();
     parent::display("tags");
 }