From 97375a4039d48de11de74be73a1b42b0c9f07595 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Mon, 1 Feb 2016 17:34:07 +0100 Subject: [PATCH] Fixes in ImageField --- src/CoreFields/ImageField.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/CoreFields/ImageField.php b/src/CoreFields/ImageField.php index 872cb0d..f3fc474 100644 --- a/src/CoreFields/ImageField.php +++ b/src/CoreFields/ImageField.php @@ -42,7 +42,11 @@ class ImageField extends PhangoField { } - //Check if the image is correct.. + /** + * Check if the image is correct. + * + * This method check the image and save in a selected folder + */ function check($fake_image) { @@ -59,7 +63,10 @@ class ImageField extends PhangoField { //Check the image for delete. //This field is used only for a row + old_reset=Webmodel::$model[$this->name_model]->reset_conditions; + Webmodel::$model[$this->name_model]->reset_conditions=0; $old_image=Webmodel::$model[$this->name_model]->select_a_row_where(array($this->name_component), 1)[$this->name_component]; + Webmodel::$model[$this->name_model]->reset_conditions=old_reset; } @@ -318,12 +325,25 @@ class ImageField extends PhangoField { } - function get_parameters_default() + public function get_parameters_default() { $this->form_loaded->file_url=$this->url_path; + } + + /** + * Method for delete all orphan images. You can call this method in a script + */ + + public function clean_orphan_images() + { + + + + + } }