示例#1
0
 function display($tpl = null)
 {
     $this->form = $this->get('Form');
     // Get data from the model
     $this->item = $this->get('Item');
     // inturn calls getState in parent class and populateState() in model
     $this->state = $this->get('State');
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'zones.php';
     $model = new K2StoreModelZones();
     $countries = $model->getCountries();
     //generate country filter list
     $lists = array();
     $country_options = array();
     $country_options[] = JHTML::_('select.option', '', JText::_('K2STORE_SELECT_COUNTRY'));
     foreach ($countries as $row) {
         $country_options[] = JHTML::_('select.option', $row->country_id, $row->country_name);
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     //add toolbar
     $this->addToolBar();
     $toolbar = new K2StoreToolBar();
     $toolbar->renderLinkbar();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
示例#2
0
 public function getInput()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_k2store/models/zones.php';
     $model = new K2StoreModelZones();
     $countries = $model->getCountries();
     //generate country filter list
     $country_options = array();
     $country_options[] = JHTML::_('select.option', '', JText::_('K2STORE_SELECT_COUNTRY'));
     foreach ($countries as $row) {
         $country_options[] = JHTML::_('select.option', $row->country_id, $row->country_name);
     }
     return JHTML::_('select.genericlist', $country_options, $this->name, 'onchange=', 'value', 'text', $this->value);
 }