// fix Update the call of JavaScript and CSS files in the class of HelperForm and controller templates (PSFV-94)

This commit is contained in:
lLefevre committed 2011-11-14 14:29:25 +00:00
1 parent 0fd7bdcea4
commit 4081c7bf80
2 files changed
+30 -31

No files matched your search

+27 -25
View File
@@ -351,28 +351,30 @@
</form> </form>
{/block} {/block}
<script type="text/javascript"> {if isset($tinymce) && $tinymce}
<script type="text/javascript">
var iso = '{$iso}';
var pathCSS = '{$path_css}'; var iso = '{$iso}';
var ad = '{$ad}'; var pathCSS = '{$path_css}';
var ad = '{$ad}';
$(document).ready(function(){
$(document).ready(function(){
tinySetup();
tinySetup();
{block name="autoload_tinyMCE"}
$(".autoload_rte").click(function(e){ {block name="autoload_tinyMCE"}
tinySetup({ $(".autoload_rte").click(function(e){
mode :"exact", tinySetup({
editor_selector :"autoload_rte", mode :"exact",
elements : $(this).attr("id"), editor_selector :"autoload_rte",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull|cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,undo,redo", elements : $(this).attr("id"),
theme_advanced_buttons2 : "link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,charmap,media,|,ltr,rtl,|,fullscreen", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull|cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,undo,redo",
theme_advanced_buttons3 : "", theme_advanced_buttons2 : "link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,charmap,media,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "", theme_advanced_buttons3 : "",
}); theme_advanced_buttons4 : "",
}) });
{/block} })
}); {/block}
</script> });
</script>
{/if}
+3 -6
View File
@@ -124,8 +124,9 @@ class HelperFormCore extends Helper
{ {
$iso = $this->context->language->iso_code; $iso = $this->context->language->iso_code;
$this->tpl_vars['iso'] = file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en'; $this->tpl_vars['iso'] = file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en';
$this->tpl_vars['theme_path_css'] = _THEME_CSS_DIR_; $this->tpl_vars['path_css'] = _THEME_CSS_DIR_;
$this->tpl_vars['ad'] = dirname($_SERVER['PHP_SELF']); $this->tpl_vars['ad'] = dirname($_SERVER['PHP_SELF']);
$this->tpl_vars['tinymce'] = true;
$this->context->controller->addJS(_PS_JS_DIR_.'tiny_mce/tiny_mce.js'); $this->context->controller->addJS(_PS_JS_DIR_.'tiny_mce/tiny_mce.js');
$this->context->controller->addJS(_PS_JS_DIR_.'tinymce.inc.js'); $this->context->controller->addJS(_PS_JS_DIR_.'tinymce.inc.js');
@@ -135,7 +136,6 @@ class HelperFormCore extends Helper
} }
} }
$iso = $this->context->language->iso_code;
$this->tpl->assign(array( $this->tpl->assign(array(
'submit_action' => $this->submit_action, 'submit_action' => $this->submit_action,
'toolbar_btn' => $this->toolbar_btn, 'toolbar_btn' => $this->toolbar_btn,
@@ -156,10 +156,7 @@ class HelperFormCore extends Helper
'vat_number' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'), 'vat_number' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
'module_dir' => _MODULE_DIR_, 'module_dir' => _MODULE_DIR_,
'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null, 'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null,
'asso_shop' => isset($asso_shop) ? $asso_shop : null, 'asso_shop' => isset($asso_shop) ? $asso_shop : null
'iso' => file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en',
'path_css' => _THEME_CSS_DIR_,
'ad' => dirname($_SERVER['PHP_SELF'])
)); ));
return parent::generate(); return parent::generate();
} }