protected function getOptions() { require_once JPATH_ROOT . '/modules/mod_jak2filter/helper.php'; $options = jaK2GetOrderFields(); $options = array_merge(parent::getOptions(), $options); return $options; }
public function getOrderingList() { $options = array(); $options[] = JHtml::_('select.option', '', JText::_('JDEFAULT')); $activeGroups = null; if (count($this->activeCats)) { $activeGroups = $this->getextraFieldsGroupsByCat($this->activeCats); } $fields = jaK2GetOrderFields($activeGroups); $default = array('date', 'rdate', 'publishUp', 'alpha', 'ralpha', 'order', 'rorder', 'featured', 'hits', 'best', 'modified', 'rand'); $display = $this->params->get('show_order_field', $default); if (empty($display)) { $options2 = $fields; } else { $options2 = array(); $openGroup = false; foreach ($fields as $field) { if (in_array($field->value, $display) || $field->value == '<OPTGROUP>' || $field->value == '</OPTGROUP>') { if ($field->value == '</OPTGROUP>' && $openGroup) { //remove empty group $openGroup = false; array_pop($options2); } else { $openGroup = $field->value == '<OPTGROUP>'; $options2[] = $field; } } } } $options = array_merge($options, $options2); $attribs = array('class' => 'inputbox'); $ordering = JRequest::getVar('ordering', ''); if (!$ordering) { if ($this->params->get('catOrdering', 'inherit') == 'inherit') { $ordering = $this->comParams->get('catOrdering', 'inherit'); } else { $ordering = $this->params->get('catOrdering', 'inherit'); } } $html = JHTML::_('select.genericlist', $options, 'ordering', $attribs, 'value', 'text', $ordering); return $html; }