Back to PhocaGalleryImageFront class

Method getMosaicFields

public static
getMosaicFields
(mixed $a, mixed $images, mixed $size = 0, mixed $extImg = 0, mixed $w = 100, mixed $h = 100)

Method getMosaicFields - Source code

public static function getMosaicFields($a, $images, $size = 0, $extImg = 0, $w = 100, $h = 100)
{
    $paramsC = ComponentHelper::getParams('com_phocagallery');
    $alt_value = $paramsC->get('alt_value', 1);
    if ($size == 1) {
        $i0 = 'medium';
        // |
        $i1 = 'medium1';
        // ||
        $i2 = 'medium2';
        // --
        $i3 = 'medium3';
        // ||--
    } else {
        $i0 = 'small';
        // |
        $i1 = 'small1';
        // ||
        $i2 = 'small2';
        // --
        $i3 = 'small3';
        // ||--
    }
    $o = array();
    switch ($a) {
        case 1:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h;
                $o['w1'] = (int) $w * 2;
                $o['w2'] = (int) $w;
                $wi = $w * 2;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h;
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr1 . ' alt="' . $altValue0 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i3);
                $i[0][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[1][0] = $t->rel;
                $i[1][1] = $iS[0];
                $i[1][2] = $iS[1];
                $o['w'] = (int) $i[1][1] * 3;
                $o['h'] = (int) $i[1][2];
                $o['w1'] = (int) $i[1][1] * 2;
                $o['w2'] = (int) $i[1][1];
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue0 . '" /></span>';
            }
            return $o;
            break;
        case 2:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h;
                $o['w1'] = (int) $w * 2;
                $o['w2'] = (int) $w;
                $wi = $w * 2;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h * 2;
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i3);
                $i[0][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[1][0] = $t->rel;
                $i[1][1] = $iS[0];
                $i[1][2] = $iS[1];
                $o['w'] = (int) $i[1][1] * 3;
                $o['h'] = (int) $i[1][2];
                $o['w1'] = (int) $i[1][1] * 2;
                $o['w2'] = (int) $i[1][1];
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>';
            }
            return $o;
            break;
        case 3:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            $altValue2 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[2]->title, $images[2]->description, $images[2]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h * 2;
                $o['w1'] = (int) $w * 2;
                $o['w2'] = (int) $w;
                $wi = $w * 2;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h;
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr2 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[2]->extm . '" ' . $attr2 . ' alt="' . $altValue2 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i3);
                $i[0][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i0);
                $i[1][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[2]->filename, $i0);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[2][0] = $t->rel;
                $i[2][1] = $iS[0];
                $i[2][2] = $iS[1];
                $o['w'] = (int) $i[2][1] * 3;
                $o['h'] = (int) $i[2][2] * 2;
                $o['w1'] = (int) $i[2][1] * 2;
                $o['w2'] = (int) $i[2][1];
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[2][0] . '" alt="' . $altValue2 . '" /></span>';
            }
            return $o;
            break;
        case 4:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            $altValue2 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[2]->title, $images[2]->description, $images[2]->metadesc);
            //$altValue3	= PhocaGalleryRenderFront::getAltValue($alt_value, $images[3]->title, $images[3]->description, $images[3]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h;
                $o['w1'] = (int) $w;
                $o['w2'] = (int) $w * 2;
                $wi = $w;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w * 2;
                $hi = $h;
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr2 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[2]->extm . '" ' . $attr2 . ' alt="' . $altValue2 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[0][0] = $t->rel;
                $i[0][1] = $iS[0];
                $i[0][2] = $iS[1];
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i2);
                $i[1][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[2]->filename, $i2);
                $i[2][0] = $t->rel;
                $o['w'] = (int) $i[0][1] * 3;
                $o['h'] = (int) $i[0][2];
                $o['w1'] = (int) $i[0][1];
                $o['w2'] = (int) $i[0][1] * 2;
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[2][0] . '" alt="' . $altValue2 . '" /></span>';
            }
            return $o;
            break;
        case 5:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            $altValue2 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[2]->title, $images[2]->description, $images[2]->metadesc);
            $altValue3 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[3]->title, $images[3]->description, $images[3]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h * 2;
                $o['w1'] = (int) $w;
                $o['w2'] = (int) $w * 2;
                $wi = $w;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px; height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h;
                $attr1 = 'style="width:' . $wi . 'px; height:' . $hi . 'px"';
                $attr2 = 'style="width:' . $wi . 'px; height:' . $hi . 'px"';
                $wi = $w * 2;
                $hi = $h;
                $attr3 = 'style="width:' . $wi . 'px; height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[2]->extm . '" ' . $attr2 . ' alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[3]->extm . '" ' . $attr3 . ' alt="' . $altValue3 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[0][0] = $t->rel;
                $i[0][1] = $iS[0];
                $i[0][2] = $iS[1];
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i0);
                $i[1][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[2]->filename, $i0);
                $i[2][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[3]->filename, $i2);
                $i[3][0] = $t->rel;
                $o['w'] = (int) $i[0][1] * 3;
                $o['h'] = (int) $i[0][2];
                $o['w1'] = (int) $i[0][1];
                $o['w2'] = (int) $i[0][1] * 2;
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[2][0] . '" alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[3][0] . '" alt="' . $altValue3 . '" /></span>';
            }
            return $o;
            break;
        case 6:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            $altValue2 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[2]->title, $images[2]->description, $images[2]->metadesc);
            $altValue3 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[3]->title, $images[3]->description, $images[3]->metadesc);
            $altValue4 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[4]->title, $images[4]->description, $images[4]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h;
                $o['w1'] = (int) $w;
                $o['w2'] = (int) $w * 2;
                $wi = $w;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h;
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr2 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr3 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr4 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[2]->extm . '" ' . $attr2 . ' alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[3]->extm . '" ' . $attr3 . ' alt="' . $altValue3 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[4]->extm . '" ' . $attr4 . ' alt="' . $altValue4 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[0][0] = $t->rel;
                $i[0][1] = $iS[0];
                $i[0][2] = $iS[1];
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i0);
                $i[1][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[2]->filename, $i0);
                $i[2][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[3]->filename, $i0);
                $i[3][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[4]->filename, $i0);
                $i[4][0] = $t->rel;
                $o['w'] = (int) $i[0][1] * 3;
                $o['h'] = (int) $i[0][2];
                $o['w1'] = (int) $i[0][1];
                $o['w2'] = (int) $i[0][1] * 2;
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[2][0] . '" alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[3][0] . '" alt="' . $altValue3 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[4][0] . '" alt="' . $altValue4 . '" /></span>';
            }
            return $o;
            break;
        case 7:
            $altValue0 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[0]->title, $images[0]->description, $images[0]->metadesc);
            $altValue1 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[1]->title, $images[1]->description, $images[1]->metadesc);
            $altValue2 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[2]->title, $images[2]->description, $images[2]->metadesc);
            $altValue3 = PhocaGalleryRenderFront::getAltValue($alt_value, $images[3]->title, $images[3]->description, $images[3]->metadesc);
            //$altValue4	= PhocaGalleryRenderFront::getAltValue($alt_value, $images[4]->title, $images[4]->description, $images[4]->metadesc);
            //$altValue5	= PhocaGalleryRenderFront::getAltValue($alt_value, $images[5]->title, $images[5]->description, $images[5]->metadesc);
            if ($extImg == 1) {
                $o['w'] = (int) $w * 3;
                $o['h'] = (int) $h;
                $o['w1'] = (int) $w;
                $o['w2'] = (int) $w * 2;
                $wi = $w;
                $hi = $h * 2;
                $attr = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr1 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $wi = $w;
                $hi = $h;
                $attr2 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $attr3 = 'style="width:' . $wi . 'px;height:' . $hi . 'px"';
                $o['b1'] = '<span class="pg-multi-img"><img src="' . $images[0]->extm . '" ' . $attr . ' alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . $images[1]->extm . '" ' . $attr1 . ' alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[2]->extm . '" ' . $attr2 . ' alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . $images[3]->extm . '" ' . $attr3 . ' alt="' . $altValue3 . '" /></span>';
            } else {
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[0]->filename, $i1);
                $iS = @getimagesize($t->abs);
                //INHIBITERROR
                $i[0][0] = $t->rel;
                $i[0][1] = $iS[0];
                $i[0][2] = $iS[1];
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[1]->filename, $i1);
                $i[1][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[2]->filename, $i0);
                $i[2][0] = $t->rel;
                $t = PhocaGalleryFileThumbnail::getThumbnailName($images[3]->filename, $i0);
                $i[3][0] = $t->rel;
                $o['w'] = (int) $i[0][1] * 3;
                $o['h'] = (int) $i[0][2];
                $o['w1'] = (int) $i[0][1];
                $o['w2'] = (int) $i[0][1] * 2;
                $o['b1'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[0][0] . '" alt="' . $altValue0 . '" /></span>';
                $o['b2'] = '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[1][0] . '" alt="' . $altValue1 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[2][0] . '" alt="' . $altValue2 . '" /></span>' . '<span class="pg-multi-img"><img src="' . Uri::base(true) . '/' . $i[3][0] . '" alt="' . $altValue3 . '" /></span>';
            }
            return $o;
            break;
    }
}