function GetItemData($itemids = null) { $db = JFactory::getDBO(); $qry = "SELECT {$this->field_id}, {$this->field_title}, translation FROM {$this->table} WHERE intest = 1 AND published = 1"; if ($itemids) { $ids = array(); foreach ($itemids as $id) { $ids[] = FSTJ3Helper::getEscaped($db, $id); } $qry .= " AND {$this->field_id} IN (" . implode(", ", $ids) . ")"; } $db->setQuery($qry); $this->itemdata = $db->loadAssocList($this->field_id); FST_Helper::Tr($this->itemdata); }
function displayAllProducts() { $this->products = $this->get('Products'); if (!is_array($this->products)) { $this->products = array(); } FST_Helper::Tr($this->products); $this->showresult = 1; $mainframe = JFactory::getApplication(); $pathway =& $mainframe->getPathway(); if (FST_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'test'))) { $pathway->addItem(JText::_('TESTIMONIALS'), FSTRoute::x('index.php?option=com_fst&view=test')); } if (FST_Settings::get('test_allow_no_product')) { $noproduct = array(); $noproduct['id'] = 0; $noproduct['title'] = JText::_('GENERAL_TESTIMONIALS'); $noproduct['description'] = ''; $noproduct['image'] = '/components/com_fst/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(); }