Jump to content

Configuration page, tabs with 2 or more forms


gusman126

Recommended Posts

hello, I'm doing a configuration page for my module
On this page there are several main tabs
In each tab add a form
in each form add 3 tabs or more

this need -> but in alls forms

image.png.95228231a0e7f881d10bec4fbdfbd16a.png


This code is what I have in file php --->

public function getContent()
    {
.......
$this->context->smarty->assign('formulariospain', $this->renderFormSpain());
$this->context->smarty->assign('formulariofrance', $this->renderFormFrance());
....

}

.....
protected function renderFormSpain()
{
$helper = new HelperForm();
......
return $helper->generateForm(array($this->getConfigFormMain()));
}

protected function getConfigFormMain()
    {
        return array(
            'form' => array(
			
               
				'tabs' => array(
					
					'config' => $this->l("Configuración principal"),
					'pedidos' => $this->l("Configuración pedidos"),
					'transportes' => $this->l("Configuración Transportes"),
					
					
				
				),
				
                'input' => array(
				array(
					'col' => 3,
					'tab' => 'config',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFSPAIN',
					'label' => $this->l('API Key'),
				),
				array(
					'col' => 3,
					'tab' => 'pedidos',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFSPAIN',
					'label' => $this->l('API Key'),
				),
				array(
					'col' => 3,
					'tab' => 'transportes',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFSPAIN',
					'label' => $this->l('API Key'),
				),
....
}
protected function renderFormFrance()
    {
        $helperfr = new HelperForm();
.....
return $helperfr->generateForm(array($this->getConfigFormMainFrance()));
}

protected function getConfigFormMainFrance()
    {
        return array(
            'form' => array(
              
				'tabs' => array(
					'configfr' => array($this->l("Configuración principal fr"),'name' => 'namm'),
					'pedidosfr' => $this->l("Configuración pedidos fr"),
					'transportesfr' => $this->l("Configuración Transportes fr"),
					
					
				),
				
                'input' => array(
				array(
					'col' => 3,
					'tab' => 'configfr',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFFRANCE',
					'label' => $this->l('API Key'),
				),
				array(
					'col' => 3,
					'tab' => 'pedidosfr',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFFRANCE',
					'label' => $this->l('API Key'),
				),
				array(
					'col' => 3,
					'tab' => 'transportesfr',
					'type' => 'text',
					'prefix' => '<i class="icon icon-key"></i>',
					'desc' => $this->l('Enter API Key'),
					'name' => 'submitMirakl_marketplace_api_API_KEY_CFFRANCE',
					'label' => $this->l('API Key'),
				),
....
}

in the file config.tpl I have

<div class="panel">
	<ul class="nav nav-tabs" id="Tabmirakl" role="tablist">
		<li class="nav-item">
			<a class="nav-link" id="cf_spain" data-toggle="tab" href="#cfspain" role="tab" aria-controls="cfspain" aria-selected="true">{l s='Carrefour España' mod='mirakl_marketplace_api_ecom'}</a>
		</li>
		<li class="nav-item">
			<a class="nav-link" id="cf_france" data-toggle="tab" href="#cffrance" role="tab" aria-controls="cffrance" aria-selected="true">{l s='Carrefour Francia' mod='mirakl_marketplace_api_ecom'}</a>
		</li>
	</ul>
	<div class="tab-content" id="TabmiraklContent">
		<div class="tab-pane fade" id="cfspain" role="tabpanel" aria-labelledby="cfspain-tab">
		{$formulariospain}
		
		</div>
		<div class="tab-pane fade" id="cffrance" role="tabpanel" aria-labelledby="cffrance-tab">
		{$formulariofrance}
		
		</div>
	</div>
	
	
	
</div>

But I can not get it to work

I need 3 or 4 forms, 1 on each tab,

In each form 3 or 4 tabs and form on each tab.

solution????

 

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