public function renderForm() { $_customers = WishList::getCustomers(); foreach ($_customers as $c) { $_customers[$c['id_customer']]['id_customer'] = $c['id_customer']; $_customers[$c['id_customer']]['name'] = $c['firstname'] . ' ' . $c['lastname']; } $fields_form = array('form' => array('legend' => array('title' => $this->l('Listing'), 'icon' => 'icon-cogs'), 'input' => array(array('type' => 'select', 'label' => $this->l('Customers :'), 'name' => 'id_customer', 'options' => array('default' => array('value' => 0, 'label' => $this->l('Choose customer')), 'query' => $_customers, 'id' => 'id_customer', 'name' => 'name'))))); if ($id_customer = Tools::getValue('id_customer')) { $wishlists = WishList::getByIdCustomer($id_customer); $fields_form['form']['input'][] = array('type' => 'select', 'label' => $this->l('Wishlist :'), 'name' => 'id_wishlist', 'options' => array('default' => array('value' => 0, 'label' => $this->l('Choose wishlist')), 'query' => $wishlists, 'id' => 'id_wishlist', 'name' => 'name')); } $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; $helper->identifier = $this->identifier; $helper->submit_action = 'submitModule'; $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id); return $helper->generateForm(array($fields_form)); }