/** * Get the options * * @return array */ protected function getOptions() { $lists = CmcHelperBasic::getLists(); $input = JFActory::getApplication()->input; $list_options = array(); foreach ($lists as $list) { $list_options[] = JHTML::_('select.option', $list->mc_id, $list->list_name); } if ($input->get('filter_list')) { $this->value = $input->get('filter_list'); } return $list_options; }
/** * Displays the view * * @param string $tpl - custom template * * @return mixed|void */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->state = $this->get('state'); $this->status = $this->get('status'); $this->pagination = $this->get('Pagination'); $lists = CmcHelperBasic::getLists(); $options[] = array('value' => '', 'text' => JText::_('JALL')); foreach ($lists as $list) { $this->listNames[$list->mc_id] = $list->list_name; $options[] = array('value' => $list->mc_id, 'text' => $list->list_name); } $this->lists = JHtml::_('select.genericlist', $options, 'filter_list', 'onchange="this.form.submit()"', 'value', 'text', $this->state->get('filter.list')); array_shift($options); $this->addToList = JHtml::_('select.genericlist', $options, 'addtolist', '', 'value', 'text', $this->state->get('filter.list')); $this->addToolbar(); parent::display($tpl); }