Esempio n. 1
0
 public static function getHTML($imgs, $mediaFolderName, $galleryType, $isAdminMode = false, $bReturnFullInfo = false, $sizeRatio = 1, $galleryFullScreen = false, $imageSize = 'large')
 {
     global $berta;
     $strOut = '';
     $mFolder = self::$options['MEDIA_ROOT'] . $mediaFolderName . '/';
     $mFolderABS = self::$options['MEDIA_ABS_ROOT'] . $mediaFolderName . '/';
     $imageTargetWidth = $berta->template->settings->get('media', 'images' . ucfirst($imageSize) . 'Width', false, true);
     $imageTargetHeight = $berta->template->settings->get('media', 'images' . ucfirst($imageSize) . 'Width', false, true);
     // print output ...
     if ($imgs && count($imgs) > 0) {
         list($firstImageHTML, $firstImageWidth, $firstImageHeight) = BertaGallery::getImageHTML($imgs[0], $mediaFolderName, $isAdminMode, $sizeRatio, $imageTargetWidth, $imageTargetHeight);
         $strOut = '<div class="xGalleryContainer xGalleryHasImages xGalleryType-' . $galleryType . '">';
         $strOut .= "<div class=\"xGallery\" style=\"width: {$firstImageWidth}px; height: {$firstImageHeight}px;\">";
         $strOut .= $firstImageHTML;
         if ($isAdminMode) {
             $strOut .= '<a href="#" class="xGalleryEditButton xEditorLink xSysCaption xMAlign-container"><span class="xMAlign-outer"><span class="xMAlign-inner">edit gallery</span></span></a>';
         }
         $strOut .= '</div>';
         $strOut .= BertaGallery::getNavHTML($imgs, $galleryType, $mFolder, $mFolderABS, $isAdminMode, $sizeRatio, $imageTargetWidth, $imageTargetHeight, $galleryFullScreen);
         $strOut .= '</div>';
     } elseif ($isAdminMode) {
         $strOut = '<div class="xGalleryContainer">';
         //.
         //'<img src="' . $options['MEDIA_ROOT'] . $p['mediafolder']['value'] . '/' . $imgs[0] . '" alt="' . (!empty($p['title']['value']) ? htmlspecialchars($p['title']['value']) : '') . '" />' .
         //'</div>';
         $strOut .= '<div class="imageEmpty">';
         if ($isAdminMode) {
             $strOut .= '<a href="#" class="xGalleryEditButton">' . BertaContent::getXEmpty('gallery') . '</a>';
         }
         $strOut .= '</div>';
         $strOut .= '</div>';
     }
     return $bReturnFullInfo ? array($strOut, $firstImageWidth, $firstImageHeight) : $strOut;
 }
Esempio n. 2
0
 public static function getHTML($imgs, $mediaFolderName, $galleryType, $isAdminMode = false, $bReturnFullInfo = false, $sizeRatio = 1, $galleryFullScreen = false, $imageSize = 'large', $galleryAutoPlay = '0', $gallerySlideNumbersVisible = 'yes', $galleryLinkAddress = '', $galleryLinkTarget = '', $rowGalleryPadding = false)
 {
     global $berta;
     $strOut = '';
     $mFolder = self::$options['MEDIA_ROOT'] . $mediaFolderName . '/';
     $mFolderABS = self::$options['MEDIA_ABS_ROOT'] . $mediaFolderName . '/';
     $imageTargetWidth = $berta->template->settings->get('media', 'images' . ucfirst($imageSize) . 'Width', false, true);
     $imageTargetHeight = $berta->template->settings->get('media', 'images' . ucfirst($imageSize) . 'Height', false, true);
     // print output ...
     if ($imgs && count($imgs) > 0) {
         list($firstImageHTML, $firstImageWidth, $firstImageHeight) = BertaGallery::getImageHTML($imgs[0], $mediaFolderName, $isAdminMode, $sizeRatio, $imageTargetWidth, $imageTargetHeight);
         $specificClasses = '';
         switch ($galleryType) {
             case 'link':
                 $specificClasses = ' xGalleryLinkAddress-' . $galleryLinkAddress;
                 $specificClasses .= ' xGalleryLinkTarget-' . $galleryLinkTarget;
                 break;
             case 'slideshow':
                 $specificClasses = ' xGalleryAutoPlay-' . $galleryAutoPlay . ' xSlideNumbersVisible-' . $gallerySlideNumbersVisible;
                 break;
         }
         $strOut = '<div class="xGalleryContainer xGalleryHasImages xGalleryType-' . $galleryType . $specificClasses . '">';
         $strOut .= "<div class=\"xGallery\" style=\"width: {$firstImageWidth}px; height: {$firstImageHeight}px;\"" . ($rowGalleryPadding ? ' xRowGalleryPadding="' . $rowGalleryPadding . '"' : '') . ">";
         $strOut .= $firstImageHTML;
         if ($isAdminMode) {
             $strOut .= '<a href="#" class="xGalleryEditButton xEditorLink xSysCaption xMAlign-container"><span class="xMAlign-outer-gallery"><span class="xMAlign-inner-gallery">edit gallery</span></span></a>';
         }
         $strOut .= '</div>';
         $strOut .= BertaGallery::getNavHTML($imgs, $galleryType, $mFolder, $mFolderABS, $isAdminMode, $sizeRatio, $imageTargetWidth, $imageTargetHeight, $galleryFullScreen);
         if ($galleryType == 'slideshow') {
             $strOut .= '<div class="loader xHidden"></div>';
         }
         $strOut .= '</div>';
     } elseif ($isAdminMode) {
         $strOut = '<div class="xGalleryContainer">';
         //.
         //'<img src="' . $options['MEDIA_ROOT'] . $p['mediafolder']['value'] . '/' . $imgs[0] . '" alt="' . (!empty($p['title']['value']) ? htmlspecialchars($p['title']['value']) : '') . '" />' .
         //'</div>';
         $strOut .= '<div class="imageEmpty">';
         if ($isAdminMode) {
             $strOut .= '<a href="#" class="xGalleryEditButton">' . BertaContent::getXEmpty('gallery') . '</a>';
         }
         $strOut .= '</div>';
         $strOut .= '</div>';
     }
     return $bReturnFullInfo ? array($strOut, $firstImageWidth, $firstImageHeight) : $strOut;
 }