// Improve AdminShopController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10317 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard committed 2011-11-21 09:18:27 +00:00
1 parent 3f97d4ab2b
commit f00892539c
1 file changed
+30 -27
+30 -27
View File
@@ -157,7 +157,7 @@ class AdminShopControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('GroupShop name:'), 'label' => $this->l('Shop name:'),
'name' => 'name', 'name' => 'name',
'required' => true, 'required' => true,
) )
@@ -276,31 +276,32 @@ class AdminShopControllerCore extends AdminController
'store' => $this->l('Stores'), 'store' => $this->l('Stores'),
); );
$this->fields_import_form = array( if (!$this->object->id)
'legend' => array( $this->fields_import_form = array(
'title' => $this->l('Import data from another shop') 'legend' => array(
), 'title' => $this->l('Import data from another shop')
'label' => $this->l('Import data from another shop'), ),
'checkbox' => array( 'label' => $this->l('Import data from another shop'),
'type' => 'checkbox', 'checkbox' => array(
'label' => $this->l('Duplicate data from shop'), 'type' => 'checkbox',
'name' => 'useImportData', 'label' => $this->l('Duplicate data from shop'),
'value' => 1 'name' => 'useImportData',
), 'value' => 1
'select' => array( ),
'type' => 'select', 'select' => array(
'name' => 'importFromShop', 'type' => 'select',
'options' => array( 'name' => 'importFromShop',
'query' => Shop::getTree(), 'options' => array(
'name' => 'name' 'query' => Shop::getTree(),
) 'name' => 'name'
), )
'allcheckbox' => array( ),
'type' => 'checkbox', 'allcheckbox' => array(
'values' => $import_data 'type' => 'checkbox',
), 'values' => $import_data
'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop') ),
); 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop')
);
$this->fields_value = array( $this->fields_value = array(
'id_group_shop' => $obj->id_group_shop 'id_group_shop' => $obj->id_group_shop
@@ -310,9 +311,11 @@ class AdminShopControllerCore extends AdminController
'disabled' => $disabled, 'disabled' => $disabled,
'checked' => (Tools::getValue('addshop') !== false) ? true : false, 'checked' => (Tools::getValue('addshop') !== false) ? true : false,
'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID(), 'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID(),
'form_import' => $this->fields_import_form
); );
if (isset($this->fields_import_form))
$this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form));
return parent::initForm(); return parent::initForm();
} }
} }