[*] BO : #PSFV-94 - added AdminReferrersController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10046 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -76,6 +76,9 @@ class AdminControllerCore extends Controller
|
||||
public $tpl_option_vars = array();
|
||||
public $tpl_view_vars = array();
|
||||
|
||||
/** @var bool if you want more fieldsets in the form */
|
||||
public $multiple_fieldsets = false;
|
||||
|
||||
public $fields_value = false;
|
||||
|
||||
/** @var array Errors displayed after post processing */
|
||||
@@ -1358,8 +1361,12 @@ class AdminControllerCore extends Controller
|
||||
$this->content .= $this->context->smarty->fetch($this->context->smarty->template_dir[0].'form_submit_ajax.tpl');
|
||||
if ($this->fields_form && is_array($this->fields_form))
|
||||
{
|
||||
if (!$this->multiple_fieldsets)
|
||||
$this->fields_form = array(array('form' => $this->fields_form));
|
||||
|
||||
if (empty($this->toolbar_title))
|
||||
$this->initToolbarTitle();
|
||||
|
||||
$this->getlanguages();
|
||||
$helper = new HelperForm($this);
|
||||
$helper->override_folder = $this->tpl_folder;
|
||||
@@ -1368,6 +1375,7 @@ class AdminControllerCore extends Controller
|
||||
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
||||
$helper->fields_value = $this->getFieldsValue($this->object);
|
||||
$helper->tpl_vars = $this->tpl_form_vars;
|
||||
$helper->multiple_fieldsets = $this->multiple_fieldsets;
|
||||
if ($this->tabAccess['view'])
|
||||
{
|
||||
if (Tools::getValue('back'))
|
||||
@@ -1852,14 +1860,16 @@ class AdminControllerCore extends Controller
|
||||
|
||||
public function getFieldsValue($obj)
|
||||
{
|
||||
if (isset($this->fields_form['input']))
|
||||
foreach ($this->fields_form['input'] as $input)
|
||||
if (empty($this->fields_value[$input['name']]))
|
||||
if (isset($input['lang']) && $input['lang'])
|
||||
foreach ($this->_languages as $language)
|
||||
$this->fields_value[$input['name']][$language['id_lang']] = $this->getFieldValue($obj, $input['name'], $language['id_lang']);
|
||||
else
|
||||
$this->fields_value[$input['name']] = $this->getFieldValue($obj, $input['name']);
|
||||
info($this->fields_form);
|
||||
foreach ($this->fields_form as $fieldset)
|
||||
if (isset($fieldset['form']['input']))
|
||||
foreach ($fieldset['form']['input'] as $input)
|
||||
if (empty($this->fields_value[$input['name']]))
|
||||
if (isset($input['lang']) && $input['lang'])
|
||||
foreach ($this->_languages as $language)
|
||||
$this->fields_value[$input['name']][$language['id_lang']] = $this->getFieldValue($obj, $input['name'], $language['id_lang']);
|
||||
else
|
||||
$this->fields_value[$input['name']] = $this->getFieldValue($obj, $input['name']);
|
||||
|
||||
return $this->fields_value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user