Jump to content

[SOLVED] Module with multilingual inputs


clemenlg

Recommended Posts

Hi,

I'm trying to do a new module for prestashop 1.5.x, but i have a problem, because i want to do a multilingual text, and i can't see the language flags.

I read a lot of posts, but i can't solve this issue, i can't show this flags...

	public function displayForm()
	{
		$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');

		$fields_form[0]['form'] = array(
			'legend' => array(
				'title' => $this->l('Settings'),
				'image' => '../sample/image.gif'
			),
			'input' => array(
				array(
					'type' => 'textarea',
					'label' => $this->l('Your text'),
					'lang' => true,
					'rows' => 10,
					'cols' => 100,
					'name' => 'example1',
					'desc' => $this->l('Example:').' bla, bla, bla...',
					'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->languages = Language::getLanguages();
		$helper->default_form_language = $default_lang;
		$helper->allow_employee_form_lang = $default_lang;
		$helper->title = $this->displayName;
		$helper->show_toolbar = true;
		$helper->toolbar_scroll = true;
		$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')
			)
		);

		$example1 = (array)Configuration::getInt('EXAMPLE1');
		foreach ($example1 as $lang => $value) {
			$helper->fields_value['example1'][$lang] = $value;
		}

		return $helper->generateForm($fields_form);
	}

codigo1.png: html result, without language flags

resultado_codigo1.png: result view

cosigo2.png: html result, with language flags (Prestashop CMS module)

 

Can anyone help me? I can't fix it

 

Regards

 

 

P.S.: Sorry for my english :S

post-620633-0-05560400-1403108490_thumb.png

post-620633-0-21882000-1403108491_thumb.png

post-620633-0-71625300-1403108491_thumb.png

Edited by clemenlg (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...