From 730e5e4d960e42e957c0fbad6a69e345cb108975 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Tue, 18 Oct 2011 14:00:27 +0000 Subject: [PATCH] [*] BO : #PSFV-94 - added AdminContactsController, fix flags display for option lists git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9424 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/tabs/AdminContacts.php | 124 --------------- admin-dev/themes/template/options.tpl | 6 +- classes/AdminController.php | 125 ++++++++------- classes/Helper.php | 32 ++++ controllers/admin/AdminBackupController.php | 18 +-- controllers/admin/AdminContactsController.php | 142 ++++++++++++++++++ controllers/admin/AdminImagesController.php | 28 ++-- controllers/admin/AdminStoresController.php | 72 +++++---- 8 files changed, 292 insertions(+), 255 deletions(-) delete mode 100644 admin-dev/tabs/AdminContacts.php create mode 100644 controllers/admin/AdminContactsController.php diff --git a/admin-dev/tabs/AdminContacts.php b/admin-dev/tabs/AdminContacts.php deleted file mode 100644 index eb5271e6c..000000000 --- a/admin-dev/tabs/AdminContacts.php +++ /dev/null @@ -1,124 +0,0 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7300 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -include_once(_PS_ADMIN_DIR_.'/../classes/AdminTab.php'); - -class AdminContacts extends AdminTab -{ - public function __construct() - { - $this->table = 'contact'; - $this->className = 'Contact'; - $this->lang = true; - $this->edit = true; - $this->delete = true; - - $this->fieldsDisplay = array( - 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'name' => array('title' => $this->l('Title'), 'width' => 130), - 'email' => array('title' => $this->l('E-mail address'), 'width' => 130), - 'description' => array('title' => $this->l('Description'), 'width' => 150), - ); - - $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(); - } - - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - - echo ' -
- '.($obj->id ? '' : '').' -
'.$this->l('Contacts').' - -
'; - foreach ($this->_languages as $language) - echo ' -
- * -
'; - $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'name'); - echo '

'.$this->l('Contact name, e.g., Technical Support').'

-
- -
- -

'.$this->l('E-mails will be sent to this address').'

-
- -
- getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/> - - getFieldValue($obj, 'customer_service') ? 'checked="checked" ' : '').'/> - -

'.$this->l('The messages will be saved in the Customer Service tab').'

-
 
- -
'; - foreach ($this->_languages as $language) - echo ' -
- -
'; - $this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name¤description', 'description'); - echo ' -

'.$this->l('Additional information about this contact').'

-
'; - if (Shop::isMultiShopActivated()) - { - echo '
'; - $this->displayAssoShop(); - echo '
'; - } - echo ' -
- -
-
* '.$this->l('Required field').'
-
-
'; - } -} - - diff --git a/admin-dev/themes/template/options.tpl b/admin-dev/themes/template/options.tpl index 87c52ec4c..d504a666c 100644 --- a/admin-dev/themes/template/options.tpl +++ b/admin-dev/themes/template/options.tpl @@ -24,10 +24,6 @@ * International Registered Trademark & Property of PrestaShop SA *}
- -
{foreach $optionsList AS $category => $categoryData} {if isset($categoryData['top'])}{$categoryData['top']}{/if} @@ -123,7 +119,7 @@ {$field['flags']} {elseif $field['type'] == 'textareaLang'} {foreach $field['languages'] AS $id_lang => $value} -
'; +
{/foreach} diff --git a/classes/AdminController.php b/classes/AdminController.php index 66dff2355..e5dc3951f 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1784,87 +1784,84 @@ class AdminControllerCore extends Controller $languages = Language::getLanguages(false); - foreach ($this->options as $option_list) + foreach ($this->options as $category => $category_data) { - foreach ($option_list as $category => $category_data) - { - $fields = $category_data['fields']; + $fields = $category_data['fields']; - /* Check required fields */ - foreach ($fields as $field => $values) - if (isset($values['required']) && $values['required'] && !isset($_POST['configUseDefault'][$field])) - if (isset($values['type']) && $values['type'] == 'textLang') - { - foreach ($languages as $language) - if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false && (string)$value != '0') - $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); - } - else if (($value = Tools::getValue($field)) == false && (string)$value != '0') - $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); - - /* Check fields validity */ - foreach ($fields as $field => $values) + /* Check required fields */ + foreach ($fields as $field => $values) + if (isset($values['required']) && $values['required'] && !isset($_POST['configUseDefault'][$field])) if (isset($values['type']) && $values['type'] == 'textLang') { foreach ($languages as $language) - if (Tools::getValue($field.'_'.$language['id_lang']) && isset($values['validation'])) - if (!Validate::$values['validation'](Tools::getValue($field.'_'.$language['id_lang']))) - $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); + if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false && (string)$value != '0') + $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); } - else if (Tools::getValue($field) && isset($values['validation'])) - if (!Validate::$values['validation'](Tools::getValue($field))) - $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); + else if (($value = Tools::getValue($field)) == false && (string)$value != '0') + $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); - /* Default value if null */ - foreach ($fields as $field => $values) - if (!Tools::getValue($field) && isset($values['default'])) - $_POST[$field] = $values['default']; - - if (1 || !count($this->_errors)) + /* Check fields validity */ + foreach ($fields as $field => $values) + if (isset($values['type']) && $values['type'] == 'textLang') { - foreach ($fields as $key => $options) + foreach ($languages as $language) + if (Tools::getValue($field.'_'.$language['id_lang']) && isset($values['validation'])) + if (!Validate::$values['validation'](Tools::getValue($field.'_'.$language['id_lang']))) + $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); + } + else if (Tools::getValue($field) && isset($values['validation'])) + if (!Validate::$values['validation'](Tools::getValue($field))) + $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); + + /* Default value if null */ + foreach ($fields as $field => $values) + if (!Tools::getValue($field) && isset($values['default'])) + $_POST[$field] = $values['default']; + + if (1 || !count($this->_errors)) + { + foreach ($fields as $key => $options) + { + if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType()) + continue; + + if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key])) { - if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType()) - continue; + Configuration::deleteFromContext($key); + continue; + } - if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key])) + // check if a method updateOptionFieldName is available + $method_name = 'updateOption'.Tools::toCamelCase($key, true); + if (method_exists($this, $method_name)) + $this->$method_name(Tools::getValue($key)); + else if (isset($options['type']) && in_array($options['type'], array('textLang', 'textareaLang'))) + { + $list = array(); + foreach ($languages as $language) { - Configuration::deleteFromContext($key); - continue; - } - - // check if a method updateOptionFieldName is available - $method_name = 'updateOption'.Tools::toCamelCase($key, true); - if (method_exists($this, $method_name)) - $this->$method_name(Tools::getValue($key)); - else if (isset($options['type']) && in_array($options['type'], array('textLang', 'textareaLang'))) - { - $list = array(); - foreach ($languages as $language) - { - $key_lang = Tools::getValue($key.'_'.$language['id_lang']); - $val = (isset($options['cast']) ? $options['cast']($key_lang) : $key_lang); - if ($this->validateField($val, $options)) - { - if (Validate::isCleanHtml($val)) - $list[$language['id_lang']] = $val; - else - $this->_errors[] = Tools::displayError('Can not add configuration '.$key.' for lang '.Language::getIsoById((int)$language['id_lang'])); - } - } - Configuration::updateValue($key, $list); - } - else - { - $val = (isset($options['cast']) ? $options['cast'](Tools::getValue($key)) : Tools::getValue($key)); + $key_lang = Tools::getValue($key.'_'.$language['id_lang']); + $val = (isset($options['cast']) ? $options['cast']($key_lang) : $key_lang); if ($this->validateField($val, $options)) { if (Validate::isCleanHtml($val)) - Configuration::updateValue($key, $val); + $list[$language['id_lang']] = $val; else - $this->_errors[] = Tools::displayError('Can not add configuration '.$key); + $this->_errors[] = Tools::displayError('Can not add configuration '.$key.' for lang '.Language::getIsoById((int)$language['id_lang'])); } } + Configuration::updateValue($key, $list); + } + else + { + $val = (isset($options['cast']) ? $options['cast'](Tools::getValue($key)) : Tools::getValue($key)); + if ($this->validateField($val, $options)) + { + if (Validate::isCleanHtml($val)) + Configuration::updateValue($key, $val); + else + $this->_errors[] = Tools::displayError('Can not add configuration '.$key); + } } } } diff --git a/classes/Helper.php b/classes/Helper.php index e2d90deb5..2a60fbbb1 100755 --- a/classes/Helper.php +++ b/classes/Helper.php @@ -235,5 +235,37 @@ class HelperCore return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str))); } + /** + * Display flags in forms for translations + * + * @param array $languages All languages available + * @param integer $default_language Default language id + * @param string $ids Multilingual div ids in form + * @param string $id Current div id] + * @param boolean $return define the return way : false for a display, true for a return + * @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤" + */ + public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false) + { + if (count($languages) == 1) + return false; + $output = ' +
+ +
+
+ '.$this->l('Choose language:').'

'; + foreach ($languages as $language) + if($use_vars_instead_of_ids) + $output .= ''.$language['name'].' '; + else + $output .= ''.$language['name'].' '; + $output .= '
'; + + if ($return) + return $output; + echo $output; + } + } diff --git a/controllers/admin/AdminBackupController.php b/controllers/admin/AdminBackupController.php index 109c98b25..d75d94fc5 100644 --- a/controllers/admin/AdminBackupController.php +++ b/controllers/admin/AdminBackupController.php @@ -51,15 +51,13 @@ class AdminBackupControllerCore extends AdminController ); $this->options = array( - 'options_general' => 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'), - ), + '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'), ), ), ); @@ -123,7 +121,7 @@ class AdminBackupControllerCore extends AdminController $helper = new HelperOptions(); $helper->id = $this->id; $helper->currentIndex = self::$currentIndex; - $this->content .= $helper->generateOptions($this->options['options_general']); + $this->content .= $helper->generateOptions($this->options); } } diff --git a/controllers/admin/AdminContactsController.php b/controllers/admin/AdminContactsController.php new file mode 100644 index 000000000..e71133a13 --- /dev/null +++ b/controllers/admin/AdminContactsController.php @@ -0,0 +1,142 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7300 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminContactsControllerCore extends AdminController +{ + public function __construct() + { + $this->table = 'contact'; + $this->className = 'Contact'; + $this->lang = true; + $this->addRowAction('edit'); + $this->addRowAction('delete'); + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + + $this->fieldsDisplay = array( + 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'name' => array('title' => $this->l('Title'), 'width' => 130), + 'email' => array('title' => $this->l('E-mail address'), 'width' => 130), + 'description' => array('title' => $this->l('Description'), 'width' => 150), + ); + + $this->options = 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), + ), + ), + ); + + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Contacts'), + 'image' => '../img/admin/contact.gif' + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Title:'), + 'name' => 'name', + 'size' => 33, + 'required' => true, + 'lang' => true, + 'attributeLang' => 'name', + 'p' => $this->l('Contact name, e.g., Technical Support'), + ), + array( + 'type' => 'text', + 'label' => $this->l('E-mail address'), + 'name' => 'email', + 'size' => 33, + 'required' => false, + 'p' => $this->l('E-mails will be sent to this address'), + ), + array( + 'type' => 'radio', + 'label' => $this->l('Save in Customer Service?'), + 'name' => 'customer_service', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('The messages will be saved in the Customer Service tab'), + 'values' => array( + array( + 'id' => 'customer_service_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'customer_service_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + ), + array( + 'type' => 'textarea', + 'label' => $this->l('Description'), + 'name' => 'description', + 'required' => false, + 'lang' => true, + 'attributeLang' => 'description', + 'cols' => 36, + 'rows' => 5, + 'p' => $this->l('Additional information about this contact'), + ), + ), + 'submit' => array( + 'title' => $this->l(' Save '), + 'class' => 'button' + ) + ); + + parent::__construct(); + } + + public function initContent() + { + if ($this->display != 'edit') + $this->display = 'list'; + + parent::initContent(); + + if ($this->display == 'list') + { + $helper = new HelperOptions(); + $helper->id = $this->id; + $helper->currentIndex = self::$currentIndex; + $this->content .= $helper->generateOptions($this->options); + } + } +} + + diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 4549da671..4d46f3908 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -47,20 +47,18 @@ class AdminImagesController extends AdminController ); $this->options = array( - 'options_image_pref' => array( - 'images' => array( - 'title' => $this->l('Images'), - 'icon' => 'tab-orders', - 'class' => 'width4', - 'top' => '', - 'bottom' => '', - 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' -

'.$this->l('WARNING: This feature may not be compatible with your theme or with some modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issue, turn it off by selecting "Use JPEG".'), - 'fields' => array( - 'PS_IMAGE_QUALITY' => array('title' => $this->l('Image quality'), 'show' => true, 'required' => true, 'type' => 'radio', 'choices' => array('jpg' => $this->l('Use JPEG'), 'png' => $this->l('Use PNG only if the base image is in PNG format'), 'png_all' => $this->l('Use PNG for all images'))), - 'PS_JPEG_QUALITY' => array('title' => $this->l('JPEG quality'), 'desc' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file)'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), - 'PS_PNG_QUALITY' => array('title' => $this->l('PNG quality'), 'desc' => $this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file)'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), - ), + 'images' => array( + 'title' => $this->l('Images'), + 'icon' => 'tab-orders', + 'class' => 'width4', + 'top' => '', + 'bottom' => '', + 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' +

'.$this->l('WARNING: This feature may not be compatible with your theme or with some modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issue, turn it off by selecting "Use JPEG".'), + 'fields' => array( + 'PS_IMAGE_QUALITY' => array('title' => $this->l('Image quality'), 'show' => true, 'required' => true, 'type' => 'radio', 'choices' => array('jpg' => $this->l('Use JPEG'), 'png' => $this->l('Use PNG only if the base image is in PNG format'), 'png_all' => $this->l('Use PNG for all images'))), + 'PS_JPEG_QUALITY' => array('title' => $this->l('JPEG quality'), 'desc' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file)'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), + 'PS_PNG_QUALITY' => array('title' => $this->l('PNG quality'), 'desc' => $this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file)'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text'), ), ) ); @@ -537,7 +535,7 @@ class AdminImagesController extends AdminController $helper = new HelperOptions(); $helper->id = $this->id; $helper->currentIndex = self::$currentIndex; - $this->content .= $helper->generateOptions($this->options['options_image_pref']); + $this->content .= $helper->generateOptions($this->options); $this->initRegenerate(); $this->initMoveImages(); diff --git a/controllers/admin/AdminStoresController.php b/controllers/admin/AdminStoresController.php index 049009c90..27596cbab 100644 --- a/controllers/admin/AdminStoresController.php +++ b/controllers/admin/AdminStoresController.php @@ -214,42 +214,40 @@ class AdminStoresControllerCore extends AdminController ); $this->options = array( - 'option_store_pref' => 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' - ) + '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' ) ) ) @@ -371,7 +369,7 @@ class AdminStoresControllerCore extends AdminController $helper->id = $this->id; $helper->currentIndex = self::$currentIndex; - $this->content .= $helper->generateOptions($this->options['option_store_pref']); + $this->content .= $helper->generateOptions($this->options); } }