Little change for management better the errors in fields
This commit is contained in:
parent
243767bc12
commit
479f449b13
25 changed files with 124 additions and 24 deletions
|
|
@ -98,6 +98,9 @@ class ImageField extends PhangoField {
|
|||
|
||||
if(!@unlink($this->path.'/'.$prefix.'_'.$base_old_image))
|
||||
{
|
||||
|
||||
// $this->error=true;
|
||||
|
||||
$this->std_error=I18n::lang('common', 'cannot_delete_old_image', 'Cannot delete old thumb images, please, check permissions');
|
||||
}
|
||||
|
||||
|
|
@ -147,6 +150,8 @@ class ImageField extends PhangoField {
|
|||
if(!$image->fit($width)->encode('jpg', $this->quality_jpeg)->save($this->path.'/'.$prefix.'_'.$base_name_image.'.jpg'))
|
||||
{
|
||||
|
||||
$this->error=true;
|
||||
|
||||
$this->std_error=I18n::lang('common', 'cannot_save_images', 'Cannot save images. Please, check permissions');
|
||||
|
||||
}
|
||||
|
|
@ -169,6 +174,8 @@ class ImageField extends PhangoField {
|
|||
if(!$image->save($this->path.'/'.$name_image))
|
||||
{
|
||||
|
||||
$this->error=1;
|
||||
|
||||
$this->std_error=I18n::lang('common', 'cannot_save_images', 'Cannot save images, please, check permissions');
|
||||
|
||||
return '';
|
||||
|
|
@ -183,6 +190,8 @@ class ImageField extends PhangoField {
|
|||
|
||||
$this->std_error=I18n::lang('common', 'no_valid_image', 'This image is wrong');
|
||||
|
||||
$this->error=1;
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
|
@ -196,6 +205,8 @@ class ImageField extends PhangoField {
|
|||
|
||||
}
|
||||
|
||||
$this->error=true;
|
||||
|
||||
$this->std_error=I18n::lang('common', 'no_image_found', 'No image uploaded, check enctype form');
|
||||
|
||||
return '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue