Created
October 10, 2014 17:43
-
-
Save gabrielem/aa60c74b9688a06924cc to your computer and use it in GitHub Desktop.
Add Extension if not ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Gabriele - Adding Global Function for correct Images Visibility | |
function getFullImageUrlForPopUp($path) | |
{ | |
/* | |
* This is a bug fix | |
* as some of the images | |
* uploaded in this sitem | |
* was cutting the extension name | |
* like some .jpeg images are display | |
* in the source field without extension | |
* causing error with javascript popup | |
*/ | |
//$this->webroot | |
///web/htdocs/www.romasiteweb.it/home/lombardi/app/webroot/img/images/large/38_Element_ciampino_ciampino_28072014-130833 | |
$ext_array=array('.jpeg','.jpg','.png','.gif'); | |
//print_r(APP."webroot/".$path); | |
if(!file_exists(APP."webroot/".$path)){ | |
foreach ($ext_array AS $ext){ | |
if(file_exists(APP."webroot/".$path.$ext)) | |
return $path.$ext; | |
} | |
}else | |
return $path; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment