- function_exists: documentation ( source)
- getimagesize: documentation ( source)
- str_replace: documentation ( source)
<?php
$ocType = new stdClass;
$cmsTag = new stdClass;
$cmsTag = getXstImage($cmsTag);
if(!function_exists("getXstImage")){
function getXstImage($cmsTag){
global $cmsTag;
// build class containing all data necessary to display image
// therefor the image dimensions have to be determined
if (0 < strlen($cmsTag->tag)) {
$clientConfig = cRegistry::getClientConfig(cRegistry::getClientId());
$filename = str_replace($clientConfig["upl"]["htmlpath"], $clientConfig["upl"]["path"], $cmsTag->tag);
list($imageWidth, $imageHeight) = getimagesize($filename);
$image = new stdClass();
$image->src = $cmsTag->tag;
$image->alt = $cmsTag->desc;
$image->width = $imageWidth;
$image->height = $imageHeight;
$image->css = $css_class;
} else {
$image = NULL;
}
return $image;
}
}