// fix bug tag image in AdminProductsController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11206 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -484,20 +484,20 @@ var textFieldLabel = 0;
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
changeTagImage();
|
||||
$("#createImageDescription input").change(function(){
|
||||
$('#createImageDescription input').change(function(){
|
||||
changeTagImage();
|
||||
});
|
||||
|
||||
var i = 0;
|
||||
$(".addImageDescription").click(function(){
|
||||
$('.addImageDescription').click(function(){
|
||||
if (i == 0){
|
||||
$("#createImageDescription").animate({
|
||||
opacity: 1, height: "toggle"
|
||||
$('#createImageDescription').animate({
|
||||
opacity: 1, height: 'toggle'
|
||||
}, 500);
|
||||
i = 1;
|
||||
}else{
|
||||
$("#createImageDescription").animate({
|
||||
opacity: 0, height: "toggle"
|
||||
$('#createImageDescription').animate({
|
||||
opacity: 0, height: 'toggle'
|
||||
}, 500);
|
||||
i = 0;
|
||||
}
|
||||
@@ -505,10 +505,11 @@ var textFieldLabel = 0;
|
||||
});
|
||||
|
||||
function changeTagImage(){
|
||||
var smallImage = $("input[name=smallImage]:checked").attr("value");
|
||||
var leftRight = $("input[name=leftRight]:checked").attr("value");
|
||||
var imageTypes = $("input[name=imageTypes]:checked").attr("value");
|
||||
$("#resultImage").val("{img-"+smallImage+"-"+leftRight+"-"+imageTypes+"}");
|
||||
var smallImage = $('input[name=smallImage]:checked').attr('value');
|
||||
var leftRight = $('input[name=leftRight]:checked').attr('value');
|
||||
var imageTypes = $('input[name=imageTypes]:checked').attr('value');
|
||||
var tag = '[img-'+smallImage+'-'+leftRight+'-'+imageTypes+']';
|
||||
$('#resultImage').val(tag);
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
@@ -440,7 +440,7 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
public function transformDescriptionWithImg($desc)
|
||||
{
|
||||
$reg = '/{img-([0-9]+)-(left|right)-([a-z]+)}/';
|
||||
$reg = '/\[img-([0-9]+)-(left|right)-([a-z]+)\]/';
|
||||
while (preg_match($reg, $desc, $matches))
|
||||
{
|
||||
$link_lmg = $this->context->link->getImageLink($this->product->link_rewrite, $this->product->id.'-'.$matches[1], $matches[3]);
|
||||
|
||||
Reference in New Issue
Block a user