public static
displayCategoriesExtImgOrFolder
(mixed $exts, mixed $extm, mixed $extw, mixed $exth, mixed $imgCategoriesSize, mixed $rightDisplayKey = 0)
public static function displayCategoriesExtImgOrFolder($exts, $extm, $extw, $exth, $imgCategoriesSize, $rightDisplayKey = 0)
{
phocagalleryimport('phocagallery.image.image');
phocagalleryimport('phocagallery.path.path');
phocagalleryimport('phocagallery.file.filethumbnail');
$path = PhocaGalleryPath::getPath();
$fileThumbnail = new CMSObject();
$fileThumbnail->rel = '';
$fileThumbnail->extw = '';
$fileThumbnail->exth = '';
$fileThumbnail->extpic = false;
$extw = explode(',', $extw);
$exth = explode(',', $exth);
$paramsC = ComponentHelper::getParams('com_phocagallery');
if (!isset($extw[0])) {
$extw[0] = $paramsC->get('large_image_width', 640);
}
if (!isset($extw[1])) {
$extw[1] = $paramsC->get('medium_image_width', 256);
}
if (!isset($extw[2])) {
$extw[2] = $paramsC->get('small_image_width', 128);
}
if (!isset($exth[0])) {
$exth[0] = $paramsC->get('large_image_height', 480);
}
if (!isset($exth[1])) {
$exth[1] = $paramsC->get('medium_image_height', 192);
}
if (!isset($exth[2])) {
$exth[2] = $paramsC->get('small_image_height', 96);
}
$key = '';
if ((int) $rightDisplayKey == 0) {
$key = '-key';
return false;
}
switch ($imgCategoriesSize) {
case 3:
case 7:
return false;
break;
case 2:
case 6:
return false;
break;
case 1:
case 5:
if ($extm == '' || (int) $rightDisplayKey == 0) {
return false;
} else {
$fileThumbnail->rel = $extm;
$fileThumbnail->extw = $extw[1];
$fileThumbnail->exth = $exth[1];
$fileThumbnail->extpic = true;
}
break;
case 0:
case 4:
if ($exts == '' || (int) $rightDisplayKey == 0) {
return false;
} else {
$fileThumbnail->rel = $exts;
$fileThumbnail->extw = $extw[2];
$fileThumbnail->exth = $exth[2];
$fileThumbnail->extpic = true;
}
break;
}
return $fileThumbnail;
}