diff --git a/admin-dev/tabs/AdminBackup.php b/admin-dev/tabs/AdminBackup.php
index 05c14c845..66871184e 100644
--- a/admin-dev/tabs/AdminBackup.php
+++ b/admin-dev/tabs/AdminBackup.php
@@ -50,14 +50,20 @@ class AdminBackup extends AdminTab
'date' => array('title' => $this->l('Date'), 'type' => 'datetime', 'width' => 120, 'align' => 'right'),
'age' => array('title' => $this->l('Age')),
'filename' => array('title' => $this->l('File name'), 'width' => 200),
- 'filesize' => array('title' => $this->l('File size')));
- $this->optionTitle = $this->l('Backup options');
- $this->_fieldsOptions = array(
- 'PS_BACKUP_ALL' => array('title' => $this->l('Ignore statistics tables:'),
- 'desc' => $this->l('The following tables will NOT be backed up if you enable this option:').'
'._DB_PREFIX_.'connections, '._DB_PREFIX_.'connections_page, '._DB_PREFIX_.'connections_source, '._DB_PREFIX_.'guest, '._DB_PREFIX_.'statssearch', 'cast' => 'intval', 'type' => 'bool'),
- 'PS_BACKUP_DROP_TABLE' => array('title' => $this->l('Drop existing tables during import:'),
- 'desc' => $this->l('Select this option to instruct the backup file to drop your tables prior to restoring the backed up data').'
(ie. "DROP TABLE IF EXISTS")', 'cast' => 'intval', 'type' => 'bool'));
+ 'filesize' => array('title' => $this->l('File size'))
+ );
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Backup options'),
+ 'fields' => array(
+ 'PS_BACKUP_ALL' => array('title' => $this->l('Ignore statistics tables:'),
+ 'desc' => $this->l('The following tables will NOT be backed up if you enable this option:').'
'._DB_PREFIX_.'connections, '._DB_PREFIX_.'connections_page, '._DB_PREFIX_.'connections_source, '._DB_PREFIX_.'guest, '._DB_PREFIX_.'statssearch', 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_BACKUP_DROP_TABLE' => array('title' => $this->l('Drop existing tables during import:'),
+ 'desc' => $this->l('Select this option to instruct the backup file to drop your tables prior to restoring the backed up data').'
(ie. "DROP TABLE IF EXISTS")', 'cast' => 'intval', 'type' => 'bool'),
+ ),
+ ),
+ );
$this->identifier = 'filename';
}
diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php
index 1da6e99d8..c989bec7f 100644
--- a/admin-dev/tabs/AdminCarriers.php
+++ b/admin-dev/tabs/AdminCarriers.php
@@ -50,9 +50,13 @@ class AdminCarriers extends AdminTab
'is_free' => array('title' => $this->l('Is Free'), 'align' => 'center', 'icon' => array(0 => 'disabled.gif', 1 => 'enabled.gif', 'default' => 'disabled.gif'), 'type' => 'bool', 'orderby' => false)
);
- $this->optionTitle = $this->l('Carrier options');
- $this->_fieldsOptions = array(
- 'PS_CARRIER_DEFAULT' => array('title' => $this->l('Default carrier:'), 'desc' => $this->l('The default carrier used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_carrier', 'list' => Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, Carrier::ALL_CARRIERS)),
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Carrier options'),
+ 'fields' => array(
+ 'PS_CARRIER_DEFAULT' => array('title' => $this->l('Default carrier:'), 'desc' => $this->l('The default carrier used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_carrier', 'list' => Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true , false,false, NULL, Carrier::ALL_CARRIERS)),
+ ),
+ ),
);
parent::__construct();
diff --git a/admin-dev/tabs/AdminContacts.php b/admin-dev/tabs/AdminContacts.php
index 68ab38a28..67409e576 100644
--- a/admin-dev/tabs/AdminContacts.php
+++ b/admin-dev/tabs/AdminContacts.php
@@ -43,16 +43,19 @@ class AdminContacts extends AdminTab
'email' => array('title' => $this->l('E-mail address'), 'width' => 130),
'description' => array('title' => $this->l('Description'), 'width' => 150),
);
-
- $this->optionTitle = $this->l('Contact options');
- $this->_fieldsOptions = array(
- 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file upload'), 'desc' => $this->l('Allow customers to upload file using contact page'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array(
- '0' => array('value' => 0, 'name' => $this->l('No')),
- '1' => array('value' => 1, 'name' => $this->l('Yes'))
- )),
- 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Pre-defined message'), 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), 'cast' => 'pSQL', 'type' => 'textareaLang', 'identifier' => 'value',
- 'cols' => 40, 'rows' => 8
- ));
+
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Contact options'),
+ 'fields' => array(
+ 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array('title' => $this->l('Allow file upload'), 'desc' => $this->l('Allow customers to upload file using contact page'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', 'list' => array(
+ '0' => array('value' => 0, 'name' => $this->l('No')),
+ '1' => array('value' => 1, 'name' => $this->l('Yes'))
+ )),
+ 'PS_CUSTOMER_SERVICE_SIGNATURE' => array('title' => $this->l('Pre-defined message'), 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), 'cast' => 'pSQL', 'type' => 'textareaLang', 'identifier' => 'value', 'cols' => 40, 'rows' => 8),
+ ),
+ ),
+ );
parent::__construct();
}
diff --git a/admin-dev/tabs/AdminCountries.php b/admin-dev/tabs/AdminCountries.php
index 8d2b9f523..d5bbe97ac 100644
--- a/admin-dev/tabs/AdminCountries.php
+++ b/admin-dev/tabs/AdminCountries.php
@@ -40,17 +40,22 @@ class AdminCountries extends AdminTab
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)';
$this->fieldsDisplay = array(
- 'id_country' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
- 'name' => array('title' => $this->l('Country'), 'width' => 130, 'filter_key' => 'b!name'),
- 'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'),
- 'call_prefix' => array('title' => $this->l('Call prefix'), 'width' => 40, 'align' => 'center', 'callback' => 'displayCallPrefix'),
- 'zone' => array('title' => $this->l('Zone'), 'width' => 100, 'filter_key' => 'z!name'),
- 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active'));
+ 'id_country' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
+ 'name' => array('title' => $this->l('Country'), 'width' => 130, 'filter_key' => 'b!name'),
+ 'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'),
+ 'call_prefix' => array('title' => $this->l('Call prefix'), 'width' => 40, 'align' => 'center', 'callback' => 'displayCallPrefix'),
+ 'zone' => array('title' => $this->l('Zone'), 'width' => 100, 'filter_key' => 'z!name'),
+ 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active'),
+ );
- $this->optionTitle = $this->l('Countries options');
- $this->_fieldsOptions = array(
- 'PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries(Context::getContext()->language->id)),
- 'PS_RESTRICT_DELIVERED_COUNTRIES' => array('title' => $this->l('Restrict countries in FO by those delivered by active carriers'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0')
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Countries options'),
+ 'fields' => array(
+ 'PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries(Context::getContext()->language->id)),
+ 'PS_RESTRICT_DELIVERED_COUNTRIES' => array('title' => $this->l('Restrict countries in FO by those delivered by active carriers'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0')
+ ),
+ ),
);
parent::__construct();
diff --git a/admin-dev/tabs/AdminCurrencies.php b/admin-dev/tabs/AdminCurrencies.php
index 89e0391b9..3e8c8b061 100644
--- a/admin-dev/tabs/AdminCurrencies.php
+++ b/admin-dev/tabs/AdminCurrencies.php
@@ -46,21 +46,25 @@ class AdminCurrencies extends AdminTab
'conversion_rate' => array('title' => $this->l('Conversion rate'), 'float' => true, 'align' => 'center', 'width' => 50, 'search' => false),
'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
);
-
- $this->optionTitle = $this->l('Currencies options');
- $this->_fieldsOptions = array(
- 'PS_CURRENCY_DEFAULT' => array(
- 'title' => $this->l('Default currency:'),
- 'desc' => $this->l('The default currency used in shop')
- .'

'.$this->l('If you change default currency, you will have to manually edit every product price.').'
',
- 'cast' => 'intval',
- 'type' => 'select',
- 'identifier' => 'id_currency',
- 'list' => Currency::getCurrencies()
- ),
- );
$this->_where = 'AND a.`deleted` = 0';
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Currencies options'),
+ 'fields' => array(
+ 'PS_CURRENCY_DEFAULT' => array(
+ 'title' => $this->l('Default currency:'),
+ 'desc' => $this->l('The default currency used in shop')
+ .'
'.$this->l('If you change default currency, you will have to manually edit every product price.').'
',
+ 'cast' => 'intval',
+ 'type' => 'select',
+ 'identifier' => 'id_currency',
+ 'list' => Currency::getCurrencies()
+ ),
+ ),
+ ),
+ );
+
parent::__construct();
}
@@ -104,16 +108,6 @@ class AdminCurrencies extends AdminTab
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
- elseif (Tools::getValue('submitOptions'.$this->table))
- {
- foreach ($this->_fieldsOptions as $key => $field)
- {
- Configuration::updateValue($key, $field['cast'](Tools::getValue($key)));
- if ($key == 'PS_CURRENCY_DEFAULT')
- Currency::refreshCurrencies();
- }
- Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
- }
elseif (Tools::isSubmit('submitExchangesRates'))
{
if (!$this->_errors[] = Currency::refreshCurrencies())
@@ -122,10 +116,17 @@ class AdminCurrencies extends AdminTab
else
parent::postProcess();
}
+
+ public function updateOptionPsCurrencyDefault($value)
+ {
+ Configuration::updateValue('PS_CURRENCY_DEFAULT', $value);
+ Currency::refreshCurrencies();
+ }
public function displayOptionsList()
{
parent::displayOptionsList();
+
echo '
';
}
}
-
-
diff --git a/admin-dev/tabs/AdminShop.php b/admin-dev/tabs/AdminShop.php
index c44345b8c..946a4dc46 100755
--- a/admin-dev/tabs/AdminShop.php
+++ b/admin-dev/tabs/AdminShop.php
@@ -49,10 +49,15 @@ class AdminShop extends AdminTab
'category_name' => array('title' => $this->l('Category Root'), 'width' => 70),
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'active'),
);
-
- $this->optionTitle = $this->l('Shops options');
- $this->_fieldsOptions = array('PS_SHOP_DEFAULT' => array('title' => $this->l('Default shop:'), 'desc' => $this->l('The default shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_shop', 'list' => Shop::getShops(), 'visibility' => Shop::CONTEXT_ALL));
-
+
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Shops options'),
+ 'fields' => array(
+ 'PS_SHOP_DEFAULT' => array('title' => $this->l('Default shop:'), 'desc' => $this->l('The default shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_shop', 'list' => Shop::getShops(), 'visibility' => Shop::CONTEXT_ALL)
+ ),
+ ),
+ );
parent::__construct();
}
diff --git a/admin-dev/tabs/AdminStockMvt.php b/admin-dev/tabs/AdminStockMvt.php
index 9e8554fcf..e646fcc70 100755
--- a/admin-dev/tabs/AdminStockMvt.php
+++ b/admin-dev/tabs/AdminStockMvt.php
@@ -37,12 +37,12 @@ class AdminStockMvt extends AdminTab
$this->view = true;
$this->fieldsDisplay = array(
- 'id_stock_mvt' => array('title' => $this->l('ID'), 'width' => 40),
- 'product_name' => array('title' => $this->l('Product Name'), 'width' => 250, 'havingFilter' => true),
- 'quantity' => array('title' => $this->l('Quantity'), 'width' => 40),
- 'reason' => array('title' => $this->l('Reason'), 'width' => 250),
- 'id_order' => array('title' => $this->l('ID Order'), 'width' => 40),
- 'employee' => array('title' => $this->l('Employee'), 'width' => 100, 'havingFilter' => true),
+ 'id_stock_mvt' => array('title' => $this->l('ID'), 'width' => 40),
+ 'product_name' => array('title' => $this->l('Product Name'), 'width' => 250, 'havingFilter' => true),
+ 'quantity' => array('title' => $this->l('Quantity'), 'width' => 40),
+ 'reason' => array('title' => $this->l('Reason'), 'width' => 250),
+ 'id_order' => array('title' => $this->l('ID Order'), 'width' => 40),
+ 'employee' => array('title' => $this->l('Employee'), 'width' => 100, 'havingFilter' => true),
);
@@ -177,12 +177,21 @@ class AdminStockMvt extends AdminTab
'name' => array('title' => $this->l('Name'), 'width' => 500));
$reasons = StockMvtReason::getStockMvtReasons($this->context->language->id);
- $this->_fieldsOptions = array('PS_STOCK_MVT_REASON_DEFAULT' => array('title' => $this->l('Default Stock Movement reason:'),
- 'cast' => 'intval',
- 'type' => 'select',
- 'list' => $reasons,
- 'identifier' => 'id_stock_mvt_reason'));
-
+
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Options'),
+ 'fields' => array(
+ 'PS_STOCK_MVT_REASON_DEFAULT' => array(
+ 'title' => $this->l('Default Stock Movement reason:'),
+ 'cast' => 'intval',
+ 'type' => 'select',
+ 'list' => $reasons,
+ 'identifier' => 'id_stock_mvt_reason'
+ ),
+ ),
+ ),
+ );
unset($this->_select, $this->_join, $this->_group, $this->_filterHaving, $this->_filter);
echo ''.$this->l('Stock movement reason').'
';
diff --git a/admin-dev/tabs/AdminStores.php b/admin-dev/tabs/AdminStores.php
index 90066ca77..20a7b3242 100644
--- a/admin-dev/tabs/AdminStores.php
+++ b/admin-dev/tabs/AdminStores.php
@@ -63,15 +63,19 @@ class AdminStores extends AdminTab
'fax' => array('title' => $this->l('Fax'), 'width' => 70),
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
);
-
- $this->optionTitle = $this->l('Parameters');
- $this->_fieldsOptions = array(
- 'PS_STORES_DISPLAY_FOOTER' => array('title' => $this->l('Display in the footer:'), 'desc' => $this->l('Display a link to the store locator in the footer'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_DISPLAY_SITEMAP' => array('title' => $this->l('Display in the sitemap page:'), 'desc' => $this->l('Display a link to the store locator in the sitemap page'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_SIMPLIFIED' => array('title' => $this->l('Show a simplified store locator:'), 'desc' => $this->l('No map, no search, only a store directory'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_CENTER_LAT' => array('title' => $this->l('Latitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'float', 'size' => '10'),
- 'PS_STORES_CENTER_LONG' => array('title' => $this->l('Longitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'float', 'size' => '10'));
-
+
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Parameters'),
+ 'fields' => array(
+ 'PS_STORES_DISPLAY_FOOTER' => array('title' => $this->l('Display in the footer:'), 'desc' => $this->l('Display a link to the store locator in the footer'), 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_STORES_DISPLAY_SITEMAP' => array('title' => $this->l('Display in the sitemap page:'), 'desc' => $this->l('Display a link to the store locator in the sitemap page'), 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_STORES_SIMPLIFIED' => array('title' => $this->l('Show a simplified store locator:'), 'desc' => $this->l('No map, no search, only a store directory'), 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_STORES_CENTER_LAT' => array('title' => $this->l('Latitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'text', 'size' => '10'),
+ 'PS_STORES_CENTER_LONG' => array('title' => $this->l('Longitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'text', 'size' => '10')
+ ),
+ ),
+ );
parent::__construct();
}
diff --git a/admin-dev/tabs/AdminTaxes.php b/admin-dev/tabs/AdminTaxes.php
index 001d6cd21..5c0d5732e 100644
--- a/admin-dev/tabs/AdminTaxes.php
+++ b/admin-dev/tabs/AdminTaxes.php
@@ -45,17 +45,21 @@ class AdminTaxes extends AdminTab
if (Configuration::get('PS_USE_ECOTAX'))
$ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0');
- $this->optionTitle = $this->l('Tax options');
- $this->_fieldsOptions = array(
- 'PS_TAX' => array('title' => $this->l('Enable tax:'), 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in cart:'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Base on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice Address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery Address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'),
- 'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Tax options'),
+ 'fields' => array(
+ 'PS_TAX' => array('title' => $this->l('Enable tax:'), 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_TAX_DISPLAY' => array('title' => $this->l('Display tax in cart:'), 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_TAX_ADDRESS_TYPE' => array('title' => $this->l('Base on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array(array('name' => $this->l('Invoice Address'), 'id' => 'id_address_invoice'), array('name' => $this->l('Delivery Address'), 'id' => 'id_address_delivery')), 'identifier' => 'id'),
+ 'PS_USE_ECOTAX' => array('title' => $this->l('Use ecotax'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
+ ),
+ ),
);
if (Configuration::get('PS_USE_ECOTAX'))
- $this->_fieldsOptions['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array('title' => $this->l('Ecotax:'), 'desc' => $this->l('The tax to apply on the ecotax (e.g., French ecotax: 19.6%).'),
- 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax', 'identifier' => 'id_tax_rules_group', 'list' => TaxRulesGroup::getTaxRulesGroupsForOptions());
+ $this->optionsList['general']['fields']['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array('title' => $this->l('Ecotax:'), 'desc' => $this->l('The tax to apply on the ecotax (e.g., French ecotax: 19.6%).'),
+ 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax', 'identifier' => 'id_tax_rules_group', 'list' => TaxRulesGroup::getTaxRulesGroupsForOptions());
parent::__construct();
}
@@ -106,7 +110,7 @@ class AdminTaxes extends AdminTab
public function postProcess()
{
- if(Tools::getValue('submitAdd'.$this->table))
+ if (Tools::getValue('submitAdd'.$this->table))
{
/* Checking fields validity */
$this->validateRules();
@@ -196,7 +200,6 @@ class AdminTaxes extends AdminTab
Product::resetEcoTax();
Configuration::updateValue('PS_USE_ECOTAX', (int)$value);
-}
+ }
}
}
-
diff --git a/admin-dev/tabs/AdminWebservice.php b/admin-dev/tabs/AdminWebservice.php
index b6e23caa2..890c9f36c 100755
--- a/admin-dev/tabs/AdminWebservice.php
+++ b/admin-dev/tabs/AdminWebservice.php
@@ -40,28 +40,37 @@ class AdminWebservice extends AdminTab
$this->id_lang_default = Configuration::get('PS_LANG_DEFAULT');
$this->fieldsDisplay = array(
- 'key' => array('title' => $this->l('Key'), 'align' => 'center', 'width' => 32),
- 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
- 'description' => array('title' => $this->l('Key description'), 'align' => 'center', 'orderby' => false)
+ 'key' => array('title' => $this->l('Key'), 'align' => 'center', 'width' => 32),
+ 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
+ 'description' => array('title' => $this->l('Key description'), 'align' => 'center', 'orderby' => false)
);
- $this->optionTitle = $this->l('Configuration');
if (file_exists(_PS_ROOT_DIR_.'/.htaccess'))
- $this->_fieldsOptions = array('PS_WEBSERVICE' => array('title' => $this->l('Enable PrestaShop Webservice:'),
- 'desc' => $this->l('Before activating the webservice, you must be sure to: ').
- '- '.$this->l('be certain URL rewrite is available on this server').
- '
- '.$this->l('be certain that the 5 methods GET, POST, PUT, DELETE and HEAD are supported by this server').
- '
',
- 'cast' => 'intval',
- 'type' => 'bool'));
+ $this->optionsList = array(
+ 'general' => array(
+ 'title' => $this->l('Configuration'),
+ 'fields' => array(
+ 'PS_WEBSERVICE' => array('title' => $this->l('Enable PrestaShop Webservice:'),
+ 'desc' => $this->l('Before activating the webservice, you must be sure to: ').
+ '- '.$this->l('be certain URL rewrite is available on this server').
+ '
- '.$this->l('be certain that the 5 methods GET, POST, PUT, DELETE and HEAD are supported by this server').
+ '
',
+ 'cast' => 'intval',
+ 'type' => 'bool'),
+ ),
+ ),
+ );
+
parent::__construct();
}
- protected function afterAdd($object) {
+ protected function afterAdd($object)
+ {
WebserviceKey::setPermissionForAccount($object->id, Tools::getValue('resources', array()));
}
- protected function afterUpdate($object) {
+ protected function afterUpdate($object)
+ {
WebserviceKey::setPermissionForAccount($object->id, Tools::getValue('resources', array()));
}
@@ -223,6 +232,7 @@ echo '
';
}
+
public function postProcess()
{
if (Tools::getValue('key') && strlen(Tools::getValue('key')) < 32)
diff --git a/classes/AdminTab.php b/classes/AdminTab.php
index a49994dd8..1bf9bc788 100644
--- a/classes/AdminTab.php
+++ b/classes/AdminTab.php
@@ -156,6 +156,12 @@ abstract class AdminTabCore
protected $formOptions = true;
public $_fieldsOptions = array();
+
+ /**
+ * @since 1.5.0
+ * @var array
+ */
+ public $optionsList = array();
protected $_languages = NULL;
protected $_defaultFormLanguage = NULL;
@@ -285,6 +291,7 @@ abstract class AdminTabCore
{
$this->getList($this->context->language->id);
$this->displayList();
+ echo '
';
$this->displayOptionsList();
$this->displayRequiredFields();
$this->includeSubTab('display');
@@ -1773,10 +1780,25 @@ abstract class AdminTabCore
{
$tab = Tab::getTab($this->context->language->id, $this->id);
+ // Retrocompatibility < 1.5.0
+ if (!$this->optionsList && $this->_fieldsOptions)
+ {
+ $this->optionsList = array(
+ 'options' => array(
+ 'title' => ($this->optionTitle) ? $this->optionTitle : $this->l('Options'),
+ 'fields' => $this->_fieldsOptions,
+ ),
+ );
+ }
+
+ if (!$this->optionsList)
+ return ;
+
+ echo '
';
echo '';
-
+
echo '