function smarty_function_white_firstPageMarkedEntry($params, &$smarty) { global $berta; $viewportWidth = 980; $viewportHeight = 800; if(!empty($params['entry'])) { $entry = $params['entry']; $imageSelect = !empty($params['imageselect']) ? $params['imageselect'] : 'random'; $wiggleClass = $berta->template->settings->get('firstPage', 'hoverWiggle') == 'yes' ? 'firstPageWiggle' : ''; $imgs = BertaGallery::getImagesArray($params['entry']['__raw']); if($imgs) { $img = $imageSelect == 'first' ? reset($imgs) : $imgs[array_rand($imgs)]; $sizeRatio = $berta->template->settings->get('firstPage', 'imageSizeRatio'); if($sizeRatio <= 0) $sizeRatio = 1; list($html, $w, $h) = BertaGallery::getHTML(array(0 => $img), $params['entry']['__raw']['mediafolder']['value'], 'slideshow', false, true, $sizeRatio); //BertaGallery::getHTML($img, $params['entry']['__raw']['mediafolder']['value']); $link = ''; if($berta->environment != 'engine' && $img['@attributes']['type'] == 'image') { $link = smarty_function_bertaLink(array( 'section' => $params['entry']['section']['name']['value'], 'tag' => !empty($params['entry']['tags']) ? reset($params['entry']['tags']) : null ), $smarty); $link = "<a class=\"firstPagePicLink\" href=\"$link\" style=\"width:{$w}px;height:{$h}px;\"></a>"; } $pos = !empty($entry['positionXY']) ? explode(',', $entry['positionXY']) : array(rand(0, $viewportWidth - $w), rand(0, $viewportHeight - $h)); $entryClasses = smarty_function_entryClasses(array('entry' => $params['entry']), $smarty); $html = "<div class=\"firstPagePic $wiggleClass $entryClasses xEditableDragXY xProperty-positionXY \" style=\"left:{$pos[0]}px;top:{$pos[1]}px;\">" . $html . ($berta->environment == 'engine' ? "<div class=\"xHandle\" style=\"width:{$w}px;height:{$h}px;\"></div>" : '') . $link . '</div>'; return $html; } else { $html = !empty($entry['description']) ? $entry['description'] : ''; if($html) { $pos = !empty($entry['positionXY']) ? explode(',', $entry['positionXY']) : array(rand(0, $viewportWidth - $w), rand(0, $viewportHeight - $h)); $entryClasses = smarty_function_entryClasses(array('entry' => $params['entry']), $smarty); $html = "<div class=\"firstPagePic $wiggleClass $entryClasses xEditableDragXY xProperty-positionXY \" style=\"left:{$pos[0]}px;top:{$pos[1]}px;\">" . $html . ($berta->environment == 'engine' ? "<div class=\"xHandle\" style=\"width:100%;height:100%;\"></div>" : '') . '</div>'; return $html; } } } return ''; }
public static function getHTMLForEntry($entry, $isAdminMode = false) { $imgs = BertaGallery::getImagesArray($entry); $galleryType = !empty($entry['mediaCacheData']['@attributes']['type']) ? $entry['mediaCacheData']['@attributes']['type'] : 'slideshow'; $imageSize = !empty($entry['mediaCacheData']['@attributes']['size']) ? $entry['mediaCacheData']['@attributes']['size'] : 'large'; //return entry ID - needed for milkbox $galleryFullScreen = !$isAdminMode && isset($entry['mediaCacheData']['@attributes']['fullscreen']) && $entry['mediaCacheData']['@attributes']['fullscreen'] == 'yes' ? $entry['id']['value'] : false; return BertaGallery::getHTML($imgs, $entry['mediafolder']['value'], $galleryType, $isAdminMode, false, 1, $galleryFullScreen, $imageSize); }
public static function getHTMLForEntry($entry, $isAdminMode = false) { global $berta; $imgs = BertaGallery::getImagesArray($entry); $galleryType = !empty($entry['mediaCacheData']['@attributes']['type']) ? $entry['mediaCacheData']['@attributes']['type'] : 'slideshow'; $imageSize = !empty($entry['mediaCacheData']['@attributes']['size']) ? $entry['mediaCacheData']['@attributes']['size'] : 'large'; //return entry ID - needed for milkbox $galleryFullScreen = !$isAdminMode && isset($entry['mediaCacheData']['@attributes']['fullscreen']) && $entry['mediaCacheData']['@attributes']['fullscreen'] == 'yes' ? $entry['id']['value'] : false; $galleryAutoPlay = !empty($entry['mediaCacheData']['@attributes']['autoplay']) ? $entry['mediaCacheData']['@attributes']['autoplay'] : '0'; $gallerySlideNumbersVisible = !empty($entry['mediaCacheData']['@attributes']['slide_numbers_visible']) ? $entry['mediaCacheData']['@attributes']['slide_numbers_visible'] : $berta->settings->get('entryLayout', 'gallerySlideNumberVisibilityDefault'); $galleryLinkAddress = !empty($entry['mediaCacheData']['@attributes']['link_address']) ? $entry['mediaCacheData']['@attributes']['link_address'] : ''; $galleryLinkTarget = !empty($entry['mediaCacheData']['@attributes']['linkTarget']) ? $entry['mediaCacheData']['@attributes']['linkTarget'] : ''; $rowGalleryPadding = !empty($entry['mediaCacheData']['@attributes']['row_gallery_padding']) ? $entry['mediaCacheData']['@attributes']['row_gallery_padding'] : false; return BertaGallery::getHTML($imgs, $entry['mediafolder']['value'], $galleryType, $isAdminMode, false, 1, $galleryFullScreen, $imageSize, $galleryAutoPlay, $gallerySlideNumbersVisible, $galleryLinkAddress, $galleryLinkTarget, $rowGalleryPadding); }