Jump to content

Saving text as HTML and lang='true' in Configuration table


federico.domizi3

Recommended Posts

Hello, I have a problem with the inclusion of a text with html and Multilingual active.

$fields_form = array(
			'form' => array(
				'legend' => array(
					'title' => $this->l('Settings'),
					'icon' => 'icon-cogs'
				),
				'input' => array(
					array(
						'type' => 'textarea',
						'label' => $this->l('DESC'),
						'name' => 'DESC',
						'class' => 'rte',
						'autoload_rte' => true,
                                                'lang' => true,
					),
				),
				'submit' => array(
					'title' => $this->l('Save')
				)
			),
		);
$this->context->controller->getLanguages();
			foreach ($fields as $field){
                            $array = array();
                            foreach ($this->context->controller->_languages as $language){
                                $array[$language['id_lang']] = Tools::getValue($field . '_'.(int)$language['id_lang']);
                            }
                            Configuration::updateValue($field, $array);
                        }

so the text is saved in multiple languages but no html, if active saving html

                            Configuration::updateValue($field, $array, true);

html is saved but the translation is saved for both languages the same text, the primary language.

Where am I wrong?

Edited by federico.domizi3 (see edit history)
Link to comment
Share on other sites

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...