function includeCssFile($cssUrl, $type = 'text/css', $media = null, $attrs = array()) { if (AriJoomlaUtils::isJoomla15()) { $document =& JFactory::getDocument(); $document->addStyleSheet($cssUrl, $type, $media, $attrs); } else { if (is_null($media)) $media = 'screen'; $tag = sprintf('<link rel="stylesheet" href="%s" type="%s" media="%s"%s />', $cssUrl, $type, $media, AriHtmlHelper::getAttrStr($attrs)); AriDocumentHelper::includeCustomHeadTag($tag); } }
if (J1_6) { $aAttr['title'] = htmlspecialchars($menuItem->params->get('menu-anchor_title', '')); } ?> <li<?php if ($liClass) { ?> class="<?php echo $liClass; ?> "<?php } ?> > <a<?php echo AriHtmlHelper::getAttrStr($aAttr); ?> > <?php echo stripslashes(J1_6 ? $menuItem->title : $menuItem->name); ?> <?php if ($hasChilds) { ?> <span class="ux-menu-arrow"></span> <?php } ?> </a> <div class="left-circ-2"></div> <div class="left-circ"></div>
?> <?php if ($isLink) { // echo $isLink; ?> <a<?php echo AriHtmlHelper::getAttrStr($slide['lnkAttrs']); ?> > <?php } ?> <img<?php echo AriHtmlHelper::getAttrStr($imgAttrs); ?> /> <?php if ($isLink) { ?> </a> <?php } ?> <?php ++$slideIdx; } ?>
function getImages($content, $params) { $images = array(); $matches = array(); $clearContent = strip_tags($content, '<img>'); preg_match_all('/<img.*?>/i', $clearContent, $matches); if (!empty($matches[0])) { $prefix = $this->_prefix; $cacheDir = $this->_cacheDir; $cacheUri = $cacheDir; if (strpos($cacheUri, JPATH_ROOT . DS) === 0) $cacheUri = substr($cacheUri, strlen(JPATH_ROOT . DS)); $cacheUri = str_replace(DS, '/', $cacheUri) . '/'; $i = 0; $thumbCount = $params['thumbCount']; $generateThumbs = $params['generateThumbs']; $thumbType = $params['thumbType']; $thumbTypeParams = $params['thumbTypeParams']; $thumbFilters = $params['thumbFilters']; $ignoreEmptyDim = $params['ignoreEmptyDim']; $ignoreRemote = $params['ignoreRemote']; $thumbAttrs = null; foreach ($matches[0] as $match) { $attrs = AriHtmlHelper::extractAttrs($match); $src = AriUtils2::getParam($attrs, 'src', ''); if (empty($src)) continue ; if ($ignoreRemote && strpos($src, 'http') === 0 && strpos($src, JURI::root()) === false) continue ; $thumbWidth = $params['thumbWidth']; $thumbHeight = $params['thumbHeight']; if (!empty($attrs['style']) || !empty($attrs['width']) || !empty($attrs['height'])) { $imgStyles = !empty($attrs['style']) ? AriHtmlHelper::extractInlineStyles($attrs['style']) : null; $styleWidth = isset($imgStyles['width']) ? intval($imgStyles['width'], 10) : 0; $styleHeight = isset($imgStyles['height']) ? intval($imgStyles['height'], 10) : 0; if (!empty($styleWidth)) $thumbWidth = $styleWidth; else if (!empty($attrs['width'])) $thumbWidth = @intval($attrs['width'], 10); if (!empty($styleHeight)) $thumbHeight = $styleHeight; else if (!empty($attrs['height'])) $thumbHeight = @intval($attrs['height'], 10); } $title = AriUtils2::getParam($attrs, 'alt', AriUtils2::getParam($attrs, 'title', '')); $thumbAttrs = array('alt' => $title); $imgAttrs = array('title' => $title, 'href' => $src); if ($params['class']) $imgAttrs['class'] = $params['class']; $image = array( 'image' => array( 'original' => $match, 'originalAttributes' => $attrs, 'attributes' => null, 'title' => $title, 'src' => $src), 'thumb' => array( 'src' => $src, 'width' => $thumbWidth, 'height' => $thumbHeight, 'atttributes' => null, 'asOriginal' => false ) ); $thumbSrc = $src; if ($generateThumbs && ($thumbCount < 1 || $i < $thumbCount)) { $imgPath = $src; $baseUrl = strtolower(JURI::base()); if (strpos(strtolower($imgPath), $baseUrl) === 0) $imgPath = substr($imgPath, strlen($baseUrl)); if (!preg_match('/^(http|https|ftp):\/\//i', $imgPath)) { $imgPath = JPATH_ROOT . DS . str_replace('/', DS, $imgPath); $originalSize = @getimagesize($imgPath); if ((!$ignoreEmptyDim || isset($attrs['width']) || isset($attrs['height'])) && (!is_array($originalSize) || count($originalSize) < 2 || (($thumbWidth > 0 && $originalSize[0] != $thumbWidth) || ($thumbHeight > 0 && $originalSize[1] != $thumbHeight)))) { $thumbFile = AriImageHelper::generateThumbnail( $imgPath, $cacheDir, $prefix, $thumbWidth, $thumbHeight, $thumbType, $thumbTypeParams, $thumbFilters); if ($thumbFile) { $size = @getimagesize($cacheDir . DS . $thumbFile); if (is_array($size) && count($size) > 1) { $image['thumb']['width'] = $size[0]; $image['thumb']['height'] = $size[1]; } $image['thumb']['src'] = $cacheUri . $thumbFile; } } else { $image['thumb']['asOriginal'] = true; } } } $thumbAttrs['src'] = $image['thumb']['src']; if ($image['thumb']['width'] > 0) $thumbAttrs['width'] = $image['thumb']['width']; if ($image['thumb']['height'] > 0) $thumbAttrs['height'] = $image['thumb']['height']; if (isset($attrs['border'])) $thumbAttrs['border'] = $attrs['border']; $image['thumb']['attributes'] = $thumbAttrs; $image['image']['attributes'] = $imgAttrs; $images[] = $image; ++$i; } } return $images; }
function getData($picasaData, $modelParams, $params) { $data = array(); if (empty($picasaData)) return $data; $group = $params['_default']['groupName']; if (empty($group)) $group = uniqid('asexy_'); $modal = AriUtils2::parseValueBySample($params['_default']['modal'], false); $keepSize = AriUtils2::getParam($modelParams, 'keepSize', false); $captionTemplate = AriUtils2::getParam($modelParams, 'caption', '{$Title}'); $needParseTemplate = strpos($captionTemplate, '{$') !== false; foreach ($picasaData as $key => $value) { $dataItem = $value; $dataItem['Title'] = AriUtils2::getParam($dataItem, 'summary', ''); $title = $needParseTemplate ? AriSimpleTemplate::parse($captionTemplate, $dataItem, true) : $captionTemplate; $img = $dataItem['image']; $thumb = $dataItem['thumb']; $aAttrs = array('href' => $img['url'] . ($modal ? '?modal=1' : ''), 'rel' => 'sexylightbox[' . $group . ']', 'title' => $title); $imgAttrs = array('src' => $thumb['url'], 'border' => '0', 'alt' => $dataItem['Title'], 'width' => $thumb['w'], 'height' => $thumb['h']); if ($keepSize) { $aAttrs['href'] .= $modal ? '&' : '?'; $aAttrs['href'] .= 'width=' . $img['w'] . '&height=' . $img['h']; } $dataItem['sexyimage'] = sprintf('<a%1$s><img%2$s/></a>', AriHtmlHelper::getAttrStr($aAttrs), AriHtmlHelper::getAttrStr($imgAttrs)); $data[$key] = $dataItem; } return $data; }
++$slideIdx; endforeach; if ($enableNav): ?> <div class="nivo-controlNavHolder"> <div class="nivo-controlNav"> <?php $slideIdx = 0; foreach ($slides as $slide): $thumbNav = !empty($slide['nav']); $nav = $thumbNav ? $slide['nav'] : null; $navEl = $thumbNav ? '<img' . AriHtmlHelper::getAttrStr(array('src' => $nav['image'], 'width' => $nav['width'], 'height' => $nav['height'], 'alt' => $nav['alt'])) . '/>' : $slideIdx; ?> <a rel="<?php echo $slideIdx; ?>" class="nivo-control<?php if ($startSlide == $slideIdx):?> active<?php endif; ?>"> <span<?php echo AriHtmlHelper::getAttrStr(array('style' => array('width' => $nav['width'] . 'px', 'height' => $nav['height'] . 'px'), 'class' => 'nivo-thumbNavWrapper')); ?>> <?php echo $navEl; ?> <span class="nivo-arrow-border"></span> <span class="nivo-arrow"></span> </span> </a> <?php ++$slideIdx; endforeach; ?> </div> </div> <?php endif; ?> </div>
function getData($flickrData, $modelParams, $params) { $data = array('photos' => array(), 'photosets' => array()); if (empty($flickrData)) return $data; $group = $params['_default']['groupName']; if (empty($group)) $group = uniqid('asexy_'); $modal = AriUtils2::parseValueBySample($params['_default']['modal'], false); $captionTemplate = AriUtils2::getParam($modelParams, 'caption', '{$Title}'); $needParseTemplate = strpos($captionTemplate, '{$') !== false; $photos = AriUtils2::getParam($flickrData, 'photos', $flickrData); foreach ($photos as $key => $value) { $dataItem = $value; $title = $needParseTemplate ? AriSimpleTemplate::parse($captionTemplate, $dataItem, true) : $captionTemplate; $aAttrs = array('href' => $dataItem['imgUrl'] . ($modal ? '?modal=1' : ''), 'rel' => 'sexylightbox[' . $group . ']', 'title' => $title); $imgAttrs = array('src' => $dataItem['thumbUrl'], 'border' => '0', 'alt' => $dataItem['Title']); $dataItem['thumb'] = $dataItem['thumbUrl']; $dataItem['sexyimage'] = sprintf('<a%1$s><img%2$s/></a>', AriHtmlHelper::getAttrStr($aAttrs), AriHtmlHelper::getAttrStr($imgAttrs)); $data['photos'][$key] = $dataItem; } $data['photosets'] = AriUtils2::getParam($flickrData, 'photosets', array()); return $data; }
$menuAbsLevel = $menuLevel - $menuStartLevel; $liClass = $menuItemClass; $liClass .= ' yuimenuitem-level-' . $menuAbsLevel; if ($hasChilds) $liClass .= ' yuimenuitem-parent'; $liClass .= ' yuimenuitem-item' . $menuItem->id; if ($isSelected) $liClass .= ' ' . $selectedCssClass; if ($isDisabled) $liClass .= ' ' . $menuItemDisabledClass; if ($isMainLevel && !$i) $liClass .= ' first-of-type'; ?> <li class="<?php echo $liClass; ?>"> <a<?php echo AriHtmlHelper::getAttrStr($aAttr); ?>><?php echo stripslashes(htmlspecialchars(J1_6 ? $menuItem->title : $menuItem->name)); ?></a> <?php if ($hasChilds && ($menuEndLevel < 0 || $menuLevel + 1 <= $menuEndLevel)): AriTemplate::display( __FILE__, array( 'menu' => $menu, 'menuStartLevel' => $menuStartLevel, 'menuEndLevel' => $menuEndLevel, 'menuLevel' => $menuLevel + 1, 'menuDirection' => $menuDirection, 'parent' => $menuItem->id, 'hlCurrentItem' => $hlCurrentItem, 'hlOnlyActiveItems' => $hlOnlyActiveItems, 'showHiddenItems' => $showHiddenItems, 'remainActive' => $remainActive,
<?php foreach ($slides as $slide) { $isLink = !empty($slide['link']); ?> <?php if ($isLink) { ?> <a<?php echo AriHtmlHelper::getAttrStr($slide['lnkAttrs']); ?> > <?php } ?> <img<?php echo AriHtmlHelper::getAttrStr($slide['imgAttrs']); ?> /> <?php if ($isLink) { ?> </a> <?php } ?> <?php } ?> </div> <?php if ($showNav) {
if (!empty($nav['width']) && !empty($nav['height'])) { $navElAttrs['style'] = array('width' => $nav['width'] . 'px', 'height' => $nav['height'] . 'px'); } ?> <a rel="<?php echo $slideIdx; ?> " class="nivo-control<?php if ($startSlide == $slideIdx) { ?> active<?php } ?> "> <span<?php echo AriHtmlHelper::getAttrStr($navElAttrs); ?> > <?php echo $navEl; ?> <span class="nivo-arrow-border"></span> <span class="nivo-arrow"></span> </span> </a> <?php ++$slideIdx; } ?> </div> </div>
function modifyData(&$data, $params, $modelParams) { $rootUri = JURI::root(true) . '/'; $keepSize = AriUtils2::getParam($modelParams, 'keepSize', false); $target = AriUtils2::getParam($modelParams, 'target'); if ($target == '_self') $target = null; $group = $params['_default']['groupName']; if (empty($group)) $group = uniqid('asexy_'); $modal = AriUtils2::parseValueBySample($params['_default']['modal'], false); $captionTemplate = AriUtils2::getParam($modelParams, 'caption', '{$Title}'); $needParseTemplate = strpos($captionTemplate, '{$') !== false; foreach ($data as $key => $value) { $dataItem =& $data[$key]; $img = $dataItem['image']; $title = $needParseTemplate ? AriSimpleTemplate::parse($captionTemplate, $dataItem, true) : $captionTemplate; $aAttrs = array('href' => $rootUri . $img . ($modal ? '?modal=1' : ''), 'rel' => 'sexylightbox[' . $group . ']', 'title' => $title); if ($target) $aAttrs['target'] = $target; if ($keepSize) { $size = @getimagesize(JPATH_ROOT . DS . $img); if (!empty($size) && count($size) > 1) { $aAttrs['href'] .= $modal ? '&' : '?'; $aAttrs['href'] .= 'width=' . $size[0] . '&height=' . $size[1]; } } $imgAttrs = array('src' => $rootUri . $dataItem['thumb'], 'border' => '0', 'alt' => str_replace('"', '&qout;', AriUtils2::getParam($dataItem, 'Title', ''))); if ($dataItem['w']) $imgAttrs['width'] = $dataItem['w']; if ($dataItem['h']) $imgAttrs['height'] = $dataItem['h']; if (!empty($dataItem['Link'])) $imgAttrs['longdesc'] = $dataItem['Link']; $dataItem['sexyimage'] = sprintf('<a%1$s><img%2$s/></a>', AriHtmlHelper::getAttrStr($aAttrs), AriHtmlHelper::getAttrStr($imgAttrs)); } }