61 lines
1.5 KiB
PHTML
Raw Normal View History

2011-09-29 08:17:51 +00:00
<?php if ($this->isPost) :?>
<div style="text-align:center;">';
2012-01-23 13:13:21 +00:00
<img src="/fichier/logo/<?=$this->image?>"/>
2011-09-29 08:17:51 +00:00
<br/>';
<a href="<?=$this->url(array('controller'=>'logo','action'=>'delete','image'=>$this->image))?>" id="logo_delete">
Supprimer le logo existant</a>
</div>
<?php else:?>
<script src="/themes/default/scripts/jquery.Jcrop.js"></script>
<link rel="stylesheet" href="/themes/default/styles/jquery.Jcrop.css" type="text/css" />
<script>
$(function(){
$('#cropbox').Jcrop({
onSelect: updateCoords,
maxSize: [ 350, 150 ]
});
});
function updateCoords(c)
{
$('#x').val(c.x);
$('#y').val(c.y);
$('#w').val(c.w);
$('#h').val(c.h);
};
function checkCoords()
{
if (parseInt($('#w').val())) return true;
alert('Please select a crop region then press submit.');
return false;
};
var options = {
target: '#formLogo',
beforeSubmit: checkCoords,
success: function(data, status, xhr, $form)
{
$('#formLogo').html(data);
$('#dialogcrop').dialog('close');
}
};
$('#crop').ajaxForm(options);
</script>
2012-01-24 17:10:14 +00:00
<img src="/fichier/logo/<?=$this->image?>" id="cropbox" />
2011-09-29 08:17:51 +00:00
<br/>
<form id="crop" name="crop"
action="<?=$this->url(array('controller'=>'logo', 'action'=>'crop'),null, true);?>" method="post">
<input type="hidden" id="x" name="x" />
<input type="hidden" id="y" name="y" />
<input type="hidden" id="w" name="w" />
<input type="hidden" id="h" name="h" />
<input type="hidden" id="image" name="image" value="<?=$this->image?>" />
<input type="submit" name="submit" value="Découper" />
</form>
<?php endif;?>