Croonical Posted April 24, 2013 Posted April 24, 2013 (edited) Bonjour à tous, J'ai un gros problème avec le helperForm utilisé dans le displayForm de mon module. J'essaye en sorte de faire apparaître des radioButton avec seulement deux choix possibles, mais l'affichage qui en résulte pose véritablement problème : Voici mon code : public function displayForm() { $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Settings'), ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('Apikey'), 'name' => 'APIKEY', 'size' => 20, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Pin Code'), 'name' => 'PINCODE', 'size' => 20, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('URL'), 'name' => 'URL', 'size' => 20, 'required' => true ), array( 'type' => 'radio', 'label' => $this->l('Site'), 'name' => 'checkboxURL', 'values' => array( array( 'id' => 'prod', 'value' => 1, 'label' => $this->l('Production') ), array( 'id' => 'test', 'value' => 0, 'label' => $this->l('Test') ) ), 'is_bool' => true, 'required' => true ) ), 'submit' => array( 'title' => $this->l('Save'), 'class' => 'button' ) ); $helper = new HelperForm(); $helper->module = $this; $helper->name_controller = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; $helper->title = $this->displayName; $helper->show_toolbar = true; // false -> remove toolbar $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. $helper->submit_action = 'submit'.$this->name; $helper->toolbar_btn = array( 'save' => array( 'desc' => $this->l('Save'), 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. '&token='.Tools::getAdminTokenLite('AdminModules'), ), 'back' => array( 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Back to list') ) ); return $helper->generateForm($fields_form); } Savez-vous comment résoudre mon problème ? Merci d'avance ! PS : Whoops, i didn't see i was on the english forum. Edited April 24, 2013 by Croonical (see edit history) Share this post Link to post Share on other sites More sharing options...
Paul C Posted April 24, 2013 Posted April 24, 2013 Try: array( 'type' => 'radio', 'label' => $this->l('Site'), 'name' => 'checkboxURL', 'class' => 't', 'values' => array( array( 'id' => 'prod', 'value' => 1, 'label' => $this->l('Production') ), array( 'id' => 'test', 'value' => 0, 'label' => $this->l('Test') ) ), 'is_bool' => true, 'required' => true ) 2 Share this post Link to post Share on other sites More sharing options...
Croonical Posted April 24, 2013 Posted April 24, 2013 Wow it works ! Thanks ! Even if I don't know where did you find that Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now