diff --git a/admin-dev/themes/default/template/controllers/attributes_groups/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/attributes_groups/helpers/form/form.tpl index 8de8a54a7..5436aeaeb 100644 --- a/admin-dev/themes/default/template/controllers/attributes_groups/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/attributes_groups/helpers/form/form.tpl @@ -25,9 +25,9 @@ {extends file="helpers/form/form.tpl"} -{block name="field"} +{block name="input_row"} {$smarty.block.parent} {if $input.name == 'public_name'} {hook h="displayAttributeGroupForm" id_attribute_group=$form_id} {/if} -{/block} +{/block} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/feature_value/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/feature_value/helpers/form/form.tpl index f5c70a9d8..8b3d51b4b 100644 --- a/admin-dev/themes/default/template/controllers/feature_value/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/feature_value/helpers/form/form.tpl @@ -24,9 +24,9 @@ *} {extends file="helpers/form/form.tpl"} -{block name="field"} +{block name="input_row"} {$smarty.block.parent} {if $input.name == 'id_feature'} {hook h="displayFeatureValueForm" id_feature_value=$feature_value->id} {/if} -{/block} +{/block} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl index 9a34b5b0e..0c940227a 100644 --- a/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl @@ -24,7 +24,7 @@ *} {extends file="helpers/form/form.tpl"} -{block name="field"} +{block name="input_row"} {$smarty.block.parent} {if $input.name == 'name'} {hook h="displayFeatureForm" id_feature=$form_id} diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index d7083d218..48e79eb03 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -41,6 +41,7 @@ class BlockLayered extends Module $this->version = '1.8.9'; $this->author = 'PrestaShop'; $this->need_instance = 0; + $this->bootstrap = true; parent::__construct(); @@ -565,13 +566,8 @@ class BlockLayered extends Module public function hookFeatureValueForm($params) { $languages = Language::getLanguages(false); - $default_form_language = (int)(Configuration::get('PS_LANG_DEFAULT')); + $default_form_language = (int)$this->context->controller->default_form_language; $lang_value = array(); - - $return = ' - '; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS( 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang_value @@ -579,39 +575,74 @@ class BlockLayered extends Module if ($result) foreach ($result as $data) $lang_value[$data['id_lang']] = array('url_name' => $data['url_name'], 'meta_title' => $data['meta_title']); - $return .= '
- -
- -
'; - foreach ($languages as $language) - $return .= ' -
- - '.$this->l('Invalid characters:').' <>;=#{}_  -

'.$this->l('Specific URL format in block layered generation').'

-
'; - $return .= ' -
-
-
- -
-
'; + $return = '
+ +
+
'; foreach ($languages as $language) + { $return .= ' -
- -

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+ + +
'; + } - $return .= ' -
-
-
'; + $return .= '
+

'.$this->l('Specific URL format in block layered generation').'

+
+
+
+
+
+ +
+
'; + foreach ($languages as $language) + { + $return .= ' +
+
+ +
+
+ + +
+
'; + } + + $return .= '
+

'.$this->l('Specific format for meta title').'

+
+
+ +
+
'; return $return; } @@ -646,53 +677,83 @@ class BlockLayered extends Module public function hookAttributeForm($params) { $languages = Language::getLanguages(false); - $default_form_language = (int)(Configuration::get('PS_LANG_DEFAULT')); + $default_form_language = (int)$this->context->controller->default_form_language; $lang_value = array(); - - $return = ' - '; - + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS( 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_attribute_lang_value WHERE id_attribute = '.(int)$params['id_attribute']); if ($result) foreach ($result as $data) $lang_value[$data['id_lang']] = array('url_name' => $data['url_name'], 'meta_title' => $data['meta_title']); - $return .= '
- -
- -
'; + + $return = '
+ +
+
'; foreach ($languages as $language) + { $return .= ' -
- - '.$this->l('Invalid characters:').' <>;=#{}_  -

'.$this->l('Specific URL format in block layered generation').'

-
'; - - $return .= ' -
-
-
- -
-
'; - foreach ($languages as $language) - $return .= ' -
- -

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+ + +
'; + } - $return .= ' -
-
-
'; + $return .= '
+

'.$this->l('Specific URL format in block layered generation').'

+
+
+
+
+
+ +
+
'; + foreach ($languages as $language) + { + $return .= ' +
+
+ +
+
+ + +
+
'; + } + + $return .= '
+

'.$this->l('Specific format for meta title').'

+
+
+ +
+
'; return $return; } @@ -760,7 +821,7 @@ class BlockLayered extends Module public function hookAttributeGroupForm($params) { $languages = Language::getLanguages(false); - $default_form_language = (int)(Configuration::get('PS_LANG_DEFAULT')); + $default_form_language = (int)$this->context->controller->default_form_language; $indexable = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT indexable FROM '._DB_PREFIX_.'layered_indexable_attribute_group WHERE id_attribute_group = '.(int)$params['id_attribute_group']); $lang_value = array(); @@ -777,51 +838,95 @@ class BlockLayered extends Module else $on = (bool)$indexable; - $return = ' - '; - - $return .= '
- -
- -
'; + $return = '
+ +
+
'; foreach ($languages as $language) + { $return .= ' -
- - '.$this->l('Invalid characters:').' <>;=#{}_  -

'.$this->l('Specific URL format in block layered generation').'

-
'; - - $return .= ' -
-
-
- -
-
'; - foreach ($languages as $language) - $return .= ' -
- -

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+ + +
'; + } - $return .= ' -
-
+ $return .= '
+

'.$this->l('Specific URL format in block layered generation').'

+
+
+
+
+
+ +
+
'; + foreach ($languages as $language) + { + $return .= ' +
+
+ +
+
+ + +
+
'; + } + + $return .= '
+

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+

'.$this->l('Use this attribute in URL generated by the layered navigation module').'

- -
- - - - -

'.$this->l('Use this attribute in URL generated by the layered navigation module').'

'; return $return; } @@ -829,7 +934,7 @@ class BlockLayered extends Module public function hookFeatureForm($params) { $languages = Language::getLanguages(false); - $default_form_language = (int)(Configuration::get('PS_LANG_DEFAULT')); + $default_form_language = (int)$this->context->controller->default_form_language; $indexable = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT indexable FROM '._DB_PREFIX_.'layered_indexable_feature WHERE id_feature = '.(int)$params['id_feature']); $lang_value = array(); @@ -845,52 +950,96 @@ class BlockLayered extends Module $on = true; else $on = (bool)$indexable; - - $return = ' - '; - - $return .= '
- -
- -
'; - foreach ($languages as $language) - $return .= ' -
- - '.$this->l('Invalid characters:').' <>;=#{}_  -

'.$this->l('Specific URL format in block layered generation').'

-
'; - $return .= ' -
-
-
- -
-
'; + $return = '
+ +
+
'; foreach ($languages as $language) + { $return .= ' -
- -

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+ + +
'; + } - $return .= ' -
-
+ $return .= '
+

'.$this->l('Specific URL format in block layered generation').'

+
+
+
+
+
+ +
+
'; + foreach ($languages as $language) + { + $return .= ' +
+
+ +
+
+ + +
+
'; + } + + $return .= '
+

'.$this->l('Specific format for meta title').'

+
+
+ +
+
+
+ +
+
+
+ + + + + + + +
+
+
+
+

'.$this->l('Use this attribute in URL generated by the layered navigation module').'

- -
- - - - -

'.$this->l('Use this attribute in URL generated by the layered navigation module').'

'; return $return; } @@ -1442,16 +1591,15 @@ class BlockLayered extends Module } $html .= ' - +
+

'.$this->l('Existing filter templates').'

'; $filters_templates = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT * FROM '._DB_PREFIX_.'layered_filter ORDER BY date_add DESC'); if (count($filters_templates)) { - $html .= '

'.count($filters_templates).' '.$this->l('filter templates are configured:').'

- - - - - - - - '; + $html .= '

'.sprintf($this->l('%s filter templates are configured:'), count($filters_templates)).'

+
'.$this->l('ID').''.$this->l('Name').''.$this->l('Categories').''.$this->l('Created on').''.$this->l('Actions').'
+ + + + + + + + + '; foreach ($filters_templates as $filters_template) { @@ -1648,8 +1791,8 @@ class BlockLayered extends Module $html .= ' - - + +
'.$this->l('ID').''.$this->l('Name').''.$this->l('Categories').''.$this->l('Created on').''.$this->l('Actions').'
'.(int)$filters_template['id_layered_filter'].''.$filters_template['name'].''.(int)$filters_template['n_categories'].''.$filters_template['name'].''.(int)$filters_template['n_categories'].' '.Tools::displayDate($filters_template['date_add'],null , true).' @@ -1668,9 +1811,9 @@ class BlockLayered extends Module $html .= $this->l('No filter template found.'); $html .= ' -
-
- '.$this->l('Build your own filter template').' + +
+

'.$this->l('Build your own filter template').'