static function render($slider, $id, $params) { $html = ''; $indicatorstripe = $params->get('indicatorstripe', false); if ($indicatorstripe && $indicatorstripe != -1) { $displayclass = self::getDisplayClass($params->get('widgetindicatordisplay', '0|*|always|*|0|*|0'), true) . 'nextend-indicator '; $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'stripe' . DIRECTORY_SEPARATOR . 'style.css')); list($style, $data) = self::getPosition($params->get('indicatorposition', '')); $style .= 'z-index:10;'; $width = NextendParse::parse($params->get('indicatorwidth', '100%')); if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') { $style .= 'width:' . $width . ';'; } else { $data .= 'data-sswidth="' . $width . '" '; } $size = intval($params->get('indicatorsize', 50)); list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('indicatorstripecolor', '000000cc')); list($colorhexbg, $rgbacssbg) = NextendColor::colorToCss($params->get('backgroundstripecolor', '7670c7ff')); $height = $params->get('indicatorstripeheight', '6'); $info = pathinfo($indicatorstripe); $class = 'nextend-indicator nextend-indicator-stripe nextend-indicator-stripe-' . basename($indicatorstripe, '.' . $info['extension']); $html = '<div class="' . $displayclass . 'nextend-indicator-stripe-container" style="' . $style . 'background-color:' . $colorhexbg . '; background-color:' . $rgbacssbg . '; height: ' . $height . 'px;" ' . $data . '><div class="' . $class . '" style="width: 0%; background-color:' . $colorhex . '; background-color:' . $rgbacss . '; height: ' . $height . 'px;"></div></div>'; $html .= "\r\n <script type='text/javascript'>\r\n njQuery(document).ready(function () {\r\n var stripe = window.njQuery('#" . $id . " .nextend-indicator-stripe');\r\n window['" . $id . "-indicator'] = {\r\n hide: function(){\r\n stripe.hide();\r\n },\r\n show: function(){\r\n stripe.show();\r\n },\r\n refresh: function(val){\r\n stripe.css('width', val+'%');\r\n }\r\n };\r\n });\r\n </script>\r\n "; } return $html; }
function parseTshadow($v) { $v = NextendParse::parse($v); $rgba = NextendColor::hex2rgba($v[3]); if ($v[0] == 0 && $v[1] == 0 && $v[2] == 0) { return 'text-shadow: none;'; } return 'text-shadow: ' . $v[0] . 'px ' . $v[1] . 'px ' . $v[2] . 'px RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');'; }
static function render($slider, $id, $params) { $html = ''; $thumbnail = $params->get('thumbnail', false); if ($thumbnail && $thumbnail != '-1') { $displayclass = self::getDisplayClass($params->get('widgetthumbnaildisplay', '0|*|always|*|0|*|0'), true); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'horizontal' . DIRECTORY_SEPARATOR . 'style.css')); $js = NextendJavascript::getInstance(); $js->addLibraryJsFile('jquery', dirname(__FILE__) . '/horizontal/script.js'); list($colorhexthumbnailactivebackground, $rgbacssthumbnailactivebackground) = NextendColor::colorToCss($params->get('thumbnailactivebackground', '00000080')); $info = pathinfo($thumbnail); $class = 'nextend-thumbnail nextend-thumbnail-horizontal nextend-thumbnail-horizontal-' . basename($thumbnail, '.' . $info['extension']); $style = ''; $thumbnailsize = NextendParse::parse($params->get('thumbnailsize', '100|*|54')); $thumbnailperpage = $params->get('thumbnailperpage', 2); $style .= 'width:' . $thumbnailsize[0] . 'px; height:' . $thumbnailsize[1] . 'px;'; list($positionstyle, $data) = self::getPosition($params->get('thumbnailposition', '')); $positionstyle .= 'z-index:10; width: 100%;'; $html .= '<div id="' . $id . '-thumbnail" class="' . $displayclass . '" style="' . $positionstyle . '" ' . $data . '>'; $html .= '<div class="nextend-thumbnail-container ' . $class . ' nextend-clearfix"> <div class="nextend-arrow-left" style="height:' . $thumbnailsize[1] . 'px"></div>'; $html .= '<div class="nextend-thumbnail-strip-hider"><div class="nextend-thumbnail-strip">'; for ($i = 0; $i < count($slider->_slides); $i++) { if (!$slider->_slides[$i]['thumbnail'] && $slider->_slides[$i]['bg']['desktop']) { $im = new NextendImage(); $slider->_slides[$i]['thumbnail'] = $im->resizeImage($slider->_slides[$i]['bg']['desktop'], $thumbnailsize[0], $thumbnailsize[1]); } $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'goto\',' . $i . ',false);" class="' . $class . ($slider->_slides[$i]['first'] ? ' active' : '') . '" style="' . $style . 'background-image: url(\'' . $slider->_slides[$i]['thumbnail'] . '\')"></div>'; } $html .= '</div></div>'; $html .= '<div class="nextend-arrow-right" style="height:' . $thumbnailsize[1] . 'px"></div> </div> <style> .nextend-thumbnail-container.nextend-thumbnail-horizontal-horizontal1 .nextend-thumbnail:HOVER, .nextend-thumbnail-container.nextend-thumbnail-horizontal-horizontal1 .nextend-thumbnail.active{ box-shadow: inset 0 0 0 6px ' . $rgbacssthumbnailactivebackground . '; } .nextend-thumbnail-container.nextend-thumbnail-horizontal-horizontal-dark .nextend-thumbnail:HOVER, .nextend-thumbnail-container.nextend-thumbnail-horizontal-horizontal-dark .nextend-thumbnail.active{ box-shadow: 0 0 3px 1px RGBA(0,0,0,0.6), 0 0 0 6px ' . $rgbacssthumbnailactivebackground . ' inset; } </style> '; $html .= '</div>'; $html .= "\r\n <script type='text/javascript'>\r\n njQuery(document).ready(function () {\r\n window['" . $id . "-thumbnail'] = new smartSliderHorizontal({\r\n id: '" . $id . "',\r\n node: window.njQuery('#" . $id . "-thumbnail'),\r\n thumbnailperpage: '" . $thumbnailperpage . "',\r\n thumbnailanimation: '" . $params->get('thumbnailanimation', 700) . "'\r\n });\r\n });\r\n </script>\r\n "; } return $html; }
static function render($slider, $id, $params) { $html = ''; $thumbnail = $params->get('thumbnail', false); if ($thumbnail && $thumbnail != '-1') { $displayclass = self::getDisplayClass($params->get('widgetthumbnaildisplay', '0|*|always|*|0|*|0'), true); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'gallery' . DIRECTORY_SEPARATOR . 'style.css')); $js = NextendJavascript::getInstance(); $js->addLibraryJsFile('jquery', dirname(__FILE__) . '/gallery/script.js'); $info = pathinfo($thumbnail); $class = 'nextend-thumbnail nextend-thumbnail-gallery nextend-thumbnail-gallery-' . basename($thumbnail, '.' . $info['extension']); $style = ''; $thumbnailsize = NextendParse::parse($params->get('thumbnailgallerysize', '100|*|54')); $thumbnailperpage = $params->get('thumbnailperpage', 2); $style .= 'width:' . $thumbnailsize[0] . 'px; height:' . $thumbnailsize[1] . 'px;'; list($positionstyle, $data) = self::getPosition($params->get('thumbnailgalleryposition', '')); $positionstyle .= 'z-index:10;'; $thumbnailgalleryoutersize = NextendParse::parse($params->get('thumbnailgalleryoutersize', '100%|*|auto')); if (is_numeric($thumbnailgalleryoutersize[0]) || $thumbnailgalleryoutersize[0] == 'auto' || substr($thumbnailgalleryoutersize[0], -1) == '%') { $positionstyle .= 'width:' . $thumbnailgalleryoutersize[0] . ';'; } else { $data .= 'data-sswidth="' . $thumbnailgalleryoutersize[0] . '" '; } if (is_numeric($thumbnailgalleryoutersize[1]) || $thumbnailgalleryoutersize[1] == 'auto' || substr($thumbnailgalleryoutersize[1], -1) == '%') { $positionstyle .= 'height:' . $thumbnailgalleryoutersize[1] . ';'; } else { $data .= 'data-ssheight="' . $thumbnailgalleryoutersize[1] . '" '; } list($colorhexthumbnailgallerybackground, $rgbacssthumbnailgallerybackground) = NextendColor::colorToCss($params->get('thumbnailgallerybackground', 'eeeeeefff')); $positionstyle .= 'background: #' . $colorhexthumbnailgallerybackground . '; background: ' . $rgbacssthumbnailgallerybackground . ';'; $br = NextendParse::parse($params->get('thumbnailgalleryborderradius', '0|*|0|*|0|*|0')); $positionstyle .= 'border-radius: ' . $br[0] . 'px ' . $br[1] . 'px ' . $br[2] . 'px ' . $br[3] . 'px; overflow: auto;'; $html .= '<div id="' . $id . '-thumbnail" class="' . $displayclass . '" style="opacity: 0.9999; ' . $positionstyle . '" ' . $data . '>'; $p = NextendParse::parse($params->get('thumbnailgallerypadding', '5|*|5|*|5|*|5')); $html .= '<div class="nextend-thumbnail-container ' . $class . '" style="padding: ' . $p[0] . 'px ' . $p[1] . 'px ' . $p[2] . 'px ' . $p[3] . 'px;">'; $m = NextendParse::parse($params->get('thumbnailgallerymargin', '0|*|1|*|1|*|0')); for ($i = 0; $i < count($slider->_slides); $i++) { if (!$slider->_slides[$i]['thumbnail'] && $slider->_slides[$i]['bg']) { $im = new NextendImage(); $slider->_slides[$i]['thumbnail'] = $im->resizeImage($slider->_slides[$i]['bg'], $thumbnailsize[0], $thumbnailsize[1]); } $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'goto\',' . $i . ',false);" class="' . $class . ($slider->_slides[$i]['first'] ? ' active' : '') . '" style="' . $style . 'background-image: url(\'' . $slider->_slides[$i]['thumbnail'] . '\'); margin: ' . $m[0] . 'px ' . $m[1] . 'px ' . $m[2] . 'px ' . $m[3] . 'px;"></div>'; } $html .= '</div></div>'; $html .= "\r\n <script type='text/javascript'>\r\n njQuery(document).ready(function () {\r\n window['" . $id . "-thumbnail'] = new smartSliderGallery({\r\n id: '" . $id . "',\r\n node: window.njQuery('#" . $id . "-thumbnail')\r\n });\r\n });\r\n </script>\r\n "; } return $html; }
static function render($slider, $id, $params) { $html = ''; $barcolored = $params->get('barcolored', false); if ($barcolored && $barcolored != -1) { $displayclass = self::getDisplayClass($params->get('widgetbardisplay', '0|*|always|*|0|*|0'), true); list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('barbackground', '00000080')); $css = NextendCss::getInstance(); $css->enableLess(); $cssfile = NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'colored' . DIRECTORY_SEPARATOR . 'style.less'); $css->addCssFile(array($cssfile, $cssfile, array('id' => '~"#' . $id . '"')), $id); list($style, $data) = self::getPosition($params->get('barcoloredposition', '')); $style .= 'background-color:' . $rgbacss . ';'; $width = NextendParse::parse($params->get('barcoloredwidth', '20')); if (is_numeric($width)) { $style .= 'width:' . $width . '%;'; } else { $data .= 'data-sswidth="' . $width . '" '; } /*$height = NextendParse::parse($params->get('barcoloredheight', '100')); if(is_numeric($height)){ $style.= 'height:'.$height.'px;'; }else{ $data.= 'data-ssheight="'.$height.'" '; } $style .= 'font-size: '.intval($slider->_sliderParams->get('globalfontsize', '12')).'px;'; */ $style .= 'padding: ' . NextendParse::parse($params->get('barcoloredpadding', '0')) . '% 0;'; $borderradius = NextendParse::parse($params->get('barcoloredborderradius', '0|*|0|*|0|*|0')); $style .= '-webkit-border-radius: ' . $borderradius[0] . 'px ' . $borderradius[1] . 'px ' . $borderradius[2] . 'px ' . $borderradius[3] . 'px;'; $style .= '-moz-border-radius: ' . $borderradius[0] . 'px ' . $borderradius[1] . 'px ' . $borderradius[2] . 'px ' . $borderradius[3] . 'px;'; $style .= 'border-radius: ' . $borderradius[0] . 'px ' . $borderradius[1] . 'px ' . $borderradius[2] . 'px ' . $borderradius[3] . 'px;'; $info = pathinfo($barcolored); $class = 'nextend-bar nextend-bar-c nextend-bar-c-' . basename($barcolored, '.' . $info['extension']); $html .= '<div class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '>'; for ($i = 0; $i < count($slider->_slides); $i++) { $html .= '<div class="nextend-bar-slide ' . ($slider->_slides[$i]['first'] ? ' active' : '') . '">'; $html .= '<h6 class="' . $params->get('barcoloredtitlefont', '') . '">' . $slider->_slides[$i]['title'] . '</h6>'; if ($slider->_slides[$i]['description']) { $html .= '<p class="' . $params->get('barcoloreddescriptionfont', '') . '">' . $slider->_slides[$i]['description'] . '</p>'; } $html .= '<div style="clear: both;"></div></div>'; } $html .= '</div>'; } return $html; }
function colorizeImage($img, $targetColor, $baseColor) { $cachefile = $this->_folder . 'colorize' . md5($img) . $targetColor . $baseColor . '.' . $this->_filetype; if (!NextendFilesystem::existsFile($cachefile)) { $targetHexArr = NextendColor::hex82hex($targetColor); $targetColor = $targetHexArr[0]; $alpha = hexdec($targetHexArr[1]); $c1 = NextendColor::hex2hsl($baseColor); $c2 = NextendColor::hex2hsl($targetColor); $im = imagecreatefrompng($img); $width = imagesx($im); $height = imagesy($im); $this->createIm($width, $height); $rgb = NextendColor::rgb2array($targetColor); for ($x = 0; $x < $width; $x++) { for ($y = 0; $y < $height; $y++) { $rgba = ImageColorAt($im, $x, $y); $rgb = array($rgba >> 16 & 0xff, $rgba >> 8 & 0xff, $rgba & 0xff); $hsl = NextendColor::rgb2hsl($rgb); $a[0] = $hsl[0] + ($c2[0] - $c1[0]); $a[1] = $hsl[1] * ($c2[1] / $c1[1]); if ($a[1] > 1) { $a[1] = 1; } $a[2] = exp(log($hsl[2]) * log($c2[2]) / log($c1[2])); if ($a[2] > 1) { $a[2] = 1; } $rgb = NextendColor::hsl2rgb($a); $A = 0xff - ($rgba >> 24) * 2 & 0xff; $A = (int) ($A * ($alpha / 0xff)); if ($A > 0xff) { $A = 0xff; } $A = (int) ((0xff - $A) / 2); imagesetpixel($this->_im, $x, $y, imagecolorallocatealpha($this->_im, $rgb[0], $rgb[1], $rgb[2], $A)); } } $this->saveIm($cachefile); imagedestroy($im); } return NextendFilesystem::pathToAbsoluteURL($cachefile); }
static function render($slider, $id, $params) { $html = ''; $previous = $params->get('previous', false); $next = $params->get('next', false); $enabled = $previous && $previous != -1 || $next && $next != -1; $fontsize = intval($slider->_sliderParams->get('globalfontsize', '12')); if ($enabled) { $displayclass = self::getDisplayClass($params->get('widgetarrowdisplay', '0|*|always|*|0|*|0'), true); list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('arrowtextbackground', '00ff00ff')); list($colorhexhover, $rgbacsshover) = NextendColor::colorToCss($params->get('arrowtextbackgroundhover', '000000ff')); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'text' . DIRECTORY_SEPARATOR . 'style.css')); if ($previous && $previous != -1) { list($style, $data) = self::getPosition($params->get('previousposition', '')); $style .= 'font-size: ' . $fontsize . 'px;'; $info = pathinfo($previous); $class = 'nextend-arrow-previous nextend-arrow-text nextend-arrow-text-previous nextend-arrow-text-previous-' . basename($previous, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'previous\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '> <span class="' . $params->get('fontclassprev', 'sliderfont7') . '">' . $params->get('contentprev', 'Prev') . '</span> </div>'; } if ($next && $next != -1) { list($style, $data) = self::getPosition($params->get('nextposition', '')); $style .= 'font-size: ' . $fontsize . 'px;'; $info = pathinfo($next); $class = 'nextend-arrow-next nextend-arrow-text nextend-arrow-text-next nextend-arrow-text-next-' . basename($next, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'next\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '> <span class="' . $params->get('fontclassnext', 'sliderfont7') . '">' . $params->get('contentnext', 'Next') . '</span> </div>'; } $css->addCssFile(' #' . $id . ' .nextend-arrow-text-next, #' . $id . ' .nextend-arrow-text-previous{ background-color:' . $rgbacss . '; } #' . $id . ' .nextend-arrow-text-next:HOVER, #' . $id . ' .nextend-arrow-text-previous:HOVER{ background-color:' . $rgbacsshover . '; }', $id); } return $html; }
function _renderAdmin($data, $id, $sliderid, $items) { $link = (array) NextendParse::parse($data->get('link', '')); if (!isset($link[1])) { $link[1] = ''; } $colors = NextendColor::colorToCss($data->get('color2', '357cbdff')); $hovercolors = NextendColor::colorToCss($data->get('hovercolor2', '01add3ff')); return ' <div class="' . $data->get('fontclass') . '"> ' . ($link[0] != '#' ? '<a href="' . $link[0] . '" target="' . $link[1] . '">' : '') . ' <span class="nextend-smartslider-tag-' . $data->get('tagclass') . ' ' . $data->get('class') . '"> ' . $data->get('content') . ' </span> ' . ($link[0] != '#' ? '</a>' : '') . ' <style> ' . $this->getCSS($sliderid, $data->get('tagclass'), $colors[1], $colors[0], $hovercolors[1], $hovercolors[0]) . ' </style> </div> '; }
static function render($slider, $id, $params) { $html = ''; $previous = $params->get('previous', false); $next = $params->get('next', false); $enabled = $previous && $previous != -1 || $next && $next != -1; if ($enabled) { $displayclass = self::getDisplayClass($params->get('widgetarrowdisplay', '0|*|always|*|0|*|0'), true); list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('arrowbackground', '00ff00ff')); list($colorhexhover, $rgbacsshover) = NextendColor::colorToCss($params->get('arrowbackgroundhover', '000000ff')); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'transition' . DIRECTORY_SEPARATOR . 'style.css')); if ($previous && $previous != -1) { list($style, $data) = self::getPosition($params->get('previousposition', '')); $info = pathinfo($previous); $class = 'nextend-arrow-previous nextend-transition nextend-transition-previous nextend-transition-previous-' . basename($previous, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'previous\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '><div class="smartslider-outer"></div><div class="smartslider-inner"></div></div>'; } if ($next && $next != -1) { list($style, $data) = self::getPosition($params->get('nextposition', '')); $info = pathinfo($next); $class = 'nextend-arrow-next nextend-transition nextend-transition-next nextend-transition-next-' . basename($next, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'next\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '><div class="smartslider-outer"></div><div class="smartslider-inner"></div></div>'; } $css->addCssFile(' #' . $id . ' .nextend-transition.nextend-transition-previous .smartslider-outer, #' . $id . ' .nextend-transition.nextend-transition-next .smartslider-outer{ background-color:' . $rgbacss . '; } #' . $id . ' .nextend-transition.nextend-transition-previous .smartslider-inner, #' . $id . ' .nextend-transition.nextend-transition-next .smartslider-inner{ background-color:' . $rgbacsshover . '; }', $id); } return $html; }
static function render($slider, $id, $params) { $html = ''; $thumbnail = $params->get('thumbnail', false); if ($thumbnail && $thumbnail != '-1') { $displayclass = self::getDisplayClass($params->get('widgetthumbnaildisplay', '0|*|always|*|0|*|0'), true); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'vertical' . DIRECTORY_SEPARATOR . 'style.css')); $js = NextendJavascript::getInstance(); $js->addLibraryJsLibraryFile('jquery', 'jquery.mousewheel.js'); $js->addLibraryJsFile('jquery', dirname(__FILE__) . '/vertical/script.js'); $thumbnailactivebackground = $params->get('thumbnailactivebackground', '00000080'); $rgbathumbnailactivebackground = NextendColor::hex2rgba($thumbnailactivebackground); $rgbacssthumbnailactivebackground = 'RGBA(' . $rgbathumbnailactivebackground[0] . ',' . $rgbathumbnailactivebackground[1] . ',' . $rgbathumbnailactivebackground[2] . ',' . round($rgbathumbnailactivebackground[3] / 127, 2) . ')'; $colorhexthumbnailactivebackground = substr($thumbnailactivebackground, 0, 6); $info = pathinfo($thumbnail); $class = 'nextend-thumbnail nextend-thumbnail-vertical nextend-thumbnail-vertical-' . basename($thumbnail, '.' . $info['extension']); $thumbnailsize = array(NextendParse::parse($params->get('thumbnailsize', '300'))); $thumbnailcolumn = $params->get('thumbnailcolumn', '30'); $thumbnailperpage = $params->get('thumbnailperpage', 2); list($positionstyle, $data) = self::getPosition($params->get('thumbnailposition', '')); $positionstyle .= 'z-index:10; font-size: ' . intval($slider->_sliderParams->get('globalfontsize', '12')) . 'px;'; $html .= '<div id="' . $id . '-thumbnail" class="' . $displayclass . '" style="width: ' . $thumbnailsize[0] . 'px;height: 100%;' . $positionstyle . '" ' . $data . '>'; $html .= '<div class="nextend-thumbnail-container ' . $class . ' nextend-clearfix"> <div class="nextend-arrow-top"></div>'; $html .= '<div class="nextend-thumbnail-strip-hider"><div class="nextend-thumbnail-strip">'; $thumbnailtitlelink = $params->get('thumbnailtitlelink', 0); for ($i = 0; $i < count($slider->_slides); $i++) { $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'goto\',' . $i . ',false);" class="' . $class . ($slider->_slides[$i]['first'] ? ' active' : '') . '">'; if ($thumbnailcolumn != 0) { if (!$slider->_slides[$i]['thumbnail'] && $slider->_slides[$i]['bg']['desktop']) { $slider->_slides[$i]['thumbnail'] = $slider->_slides[$i]['bg']['desktop']; } $html .= '<div class="nextend-thumbnail-vertical-image" style="float:left;width:' . $thumbnailcolumn . '%; background-image:url(\'' . $slider->_slides[$i]['thumbnail'] . '\');"></div>'; } $html .= '<div class="nextend-thumbnail-vertical-content" style="width:' . (100 - $thumbnailcolumn) . '%;">'; $link = NextendParse::parse($slider->_slides[$i]['params']->get('link')); if ($thumbnailtitlelink && $link[0] != '' && $link[0] != '#') { $html .= '<h4 class="' . $params->get('thumbnailfontclasstitle') . '"><a href="' . $link[0] . '" target="' . $link[1] . '">' . $slider->_slides[$i]['title'] . '</a></h4>'; } else { $html .= '<h4 class="' . $params->get('thumbnailfontclasstitle') . '">' . $slider->_slides[$i]['title'] . '</h4>'; } $html .= '<p class="' . $params->get('thumbnailfontclassdescription') . '">' . $slider->_slides[$i]['description'] . '</p> </div></div>'; } $html .= '</div></div></td>'; $html .= '<div class="nextend-arrow-bottom"></div></div></div>'; $html .= "\n <script type='text/javascript'>\n njQuery(document).ready(function () {\n window['" . $id . "-thumbnail'] = new smartSliderVertical({\n id: '" . $id . "',\n node: window.njQuery('#" . $id . "-thumbnail'),\n thumbnailperpage: '" . $thumbnailperpage . "',\n thumbnailanimation: '" . $params->get('thumbnailanimation', 700) . "'\n });\n });\n </script>\n "; $css->addCssFile(' #' . $id . ' .nextend-thumbnail-container .nextend-thumbnail-vertical-vertical1:HOVER, #' . $id . ' .nextend-thumbnail-container .nextend-thumbnail-vertical-vertical1.active, #' . $id . ' .nextend-thumbnail-container.nextend-thumbnail-vertical-vertical1 .nextend-arrow-top:HOVER, #' . $id . ' .nextend-thumbnail-container.nextend-thumbnail-vertical-vertical1 .nextend-arrow-bottom:HOVER, #' . $id . ' .nextend-thumbnail-container .nextend-thumbnail-vertical-vertical-light:HOVER, #' . $id . ' .nextend-thumbnail-container .nextend-thumbnail-vertical-vertical-light.active, #' . $id . ' .nextend-thumbnail-container.nextend-thumbnail-vertical-vertical-light .nextend-arrow-top:HOVER, #' . $id . ' .nextend-thumbnail-container.nextend-thumbnail-vertical-vertical-light .nextend-arrow-bottom:HOVER{ background-color:' . $rgbacssthumbnailactivebackground . '; }', $id); } return $html; }
function _renderAdmin($data, $id, $sliderid, $items) { $link = (array) NextendParse::parse($data->get('link', '')); if (!isset($link[1])) { $link[1] = ''; } $colors = NextendColor::colorToCss($data->get('color', '00000080')); $size = (array) NextendParse::parse($data->get('size', '')); if (!isset($size[0])) { $size[0] = '100'; } if (!isset($size[1])) { $size[1] = '100'; } return ' <div id="' . $id . '"> ' . ($link[0] != '#' ? '<a href="' . $link[0] . '" target="' . $link[1] . '" style="display: block; background: none !important;">' : '') . ' <div class="nextend-smartslider-caption ' . $data->get('customcaptionclass', '') . '" style="width:' . $size[0] . 'px; height:' . $size[1] . 'px;"> <img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . $data->get('image', '') . '" class="img-' . $data->get('captionclass', '') . '" /> <div class="caption nextend-smartslider-caption-' . $data->get('captionclass', '') . '" style="background:#' . $colors[0] . ';background:' . $colors[1] . ';"> <h4 class="' . $data->get('fontclasstitle', '') . '">' . $data->get('content', '') . '</h4> <p class="' . $data->get('fontclass', '') . '">' . $data->get('description', '') . '</p> </div> </div> ' . ($link[0] != '#' ? '</a>' : '') . ' <script type="text/javascript"> ' . $this->getJs($sliderid, $id) . ' </script> </div> '; }
function initSlides($slides) { if ($this->_backend) { if (NextendRequest::getCmd('action') == 'create') { array_unshift($slides, array('id' => 0, 'title' => '{_slidetitle}', 'slider' => NextendRequest::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'params' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'description' => 'Description', 'ordering' => count($slides))); } if (NextendRequest::getCmd('action') == 'generatoredit') { global $smartslidergeneratorslide; if (!$smartslidergeneratorslide) { $smartslidergeneratorslide = array(); } array_unshift($slides, array_merge(array('id' => 0, 'title' => '{_slidetitle}', 'slider' => NextendRequest::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'params' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'description' => 'Description', 'ordering' => count($slides)), $smartslidergeneratorslide)); } else { if (NextendRequest::getCmd('controller') == 'layouts' && NextendRequest::getCmd('action') == 'edit') { global $smartsliderlayout; if (!$smartsliderlayout) { $smartsliderlayout = ''; } array_unshift($slides, array('id' => 0, 'title' => '{_slidetitle}', 'slide' => $smartsliderlayout, 'params' => '')); } else { if (NextendRequest::getCmd('controller') == 'slides') { $currentlyedited = NextendRequest::getInt('slideid'); for ($i = 0; $i < count($slides); $i++) { if ($slides[$i]['id'] == $currentlyedited) { $this->_activeSlide = $i; break; } } } } } } else { for ($i = 0; $i < count($slides); $i++) { if ($slides[$i]['first'] == 1) { $this->_activeSlide = $i; break; } } } nextendimport('nextend.image.color'); for ($i = 0; $i < count($slides); $i++) { $params = new NextendData(); $params->loadJSON($slides[$i]['params']); $slides[$i]['params'] = $params; $slides[$i]['classes'] = 'smart-slider-canvas'; if (!isset($slides[$i]['background'])) { $slides[$i]['background'] = 'ffffff00|*|'; } $bg = (array) NextendParse::parse($slides[$i]['background']); $style = ''; if (isset($bg[0]) && strlen($bg[0]) == 8) { if (substr($bg[0], 6, 2) != '00') { $style .= 'background-color: #' . substr($bg[0], 0, 6) . ';'; $rgba = NextendColor::hex2rgba($bg[0]); $style .= 'background-color: RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');'; } } $slides[$i]['style'] = $style; $bgmore = (array) NextendParse::parse($slides[$i]['params']->get('backgroundmore')); $slides[$i]['bg'] = array('desktop' => empty($bg[1]) ? 0 : NextendUri::fixrelative($bg[1]), 'desktopretina' => empty($bgmore[0]) ? 0 : NextendUri::fixrelative($bgmore[0]), 'tablet' => empty($bgmore[1]) ? 0 : NextendUri::fixrelative($bgmore[1]), 'tabletretina' => empty($bgmore[2]) ? 0 : NextendUri::fixrelative($bgmore[2]), 'mobile' => empty($bgmore[3]) ? 0 : NextendUri::fixrelative($bgmore[3]), 'mobileretina' => empty($bgmore[4]) ? 0 : NextendUri::fixrelative($bgmore[4]), 'alt' => empty($bg[2]) ? '' : $bg[2]); if (!empty($slides[$i]['thumbnail'])) { $slides[$i]['thumbnail'] = NextendUri::fixrelative($slides[$i]['thumbnail']); } $link = $params->get('link', ''); $link = (array) NextendParse::parse($link); if (!$this->_backend && $link && isset($link[0]) && $link[0] != '' && $link[0] != '#') { if (!isset($link[1])) { $link[1] = '_self'; } $slides[$i]['link'] = ' onclick="' . htmlspecialchars(strpos($link[0], 'javascript:') === 0 ? $link[0] : ($link[1] == '_blank' ? "window.open('" . (nextendIsJoomla() ? JRoute::_($link[0], false) : $link[0]) . "','_blank');" : "window.location='" . (nextendIsJoomla() ? JRoute::_($link[0], false) : $link[0]) . "'")) . '" '; $slides[$i]['style'] .= 'cursor:pointer;'; } else { $slides[$i]['link'] = ''; } } return $slides; }
function setBackground($hex) { $this->backgrouncolor = NextendColor::hex2rgb($hex); }
function _render($data, $id, $sliderid, $items) { $shapeclass = $data->get('shapeclass', 'square'); $colors = NextendColor::colorToCss($data->get('color', '00000080')); $data->set('colorhex', $colors[0]); $data->set('colora', $colors[1]); $size = (array) NextendParse::parse($data->get('size', '')); if (!isset($size[0])) { $size[0] = '100'; } if (!isset($size[1])) { $size[1] = '100'; } $data->set('width', $size[0]); $data->set('height', $size[1]); $attr = ''; $click = $data->get('onmouseclick', ''); if (!empty($click)) { $attr .= ' data-click="' . htmlspecialchars($click) . '"'; } $enter = $data->get('onmouseenter', ''); if (!empty($enter)) { $attr .= ' data-enter="' . htmlspecialchars($enter) . '"'; } $leave = $data->get('onmouseleave', ''); if (!empty($leave)) { $attr .= ' data-leave="' . htmlspecialchars($leave) . '"'; } return '<div> <div id="' . $id . '" class="' . $id . ' nextend-smartslider-shape nextend-smartslider-shape-' . $shapeclass . '" ' . $attr . '></div> <style>' . $this->getCss($shapeclass, $id, $sliderid, $data) . '</style> <script type="text/javascript">' . $this->getJs($shapeclass, $id, $sliderid, $data) . '</script> </div>'; }
$params = $this->_sliderParams; $width = intval($context['width']); $height = intval($context['height']); $context['bgsize'] = NextendParse::parse($params->get('simplebackgroundimagesize', 'auto')); $border = NextendParse::parse($params->get('simpleborder', '0|*|3E3E3Eff')); $border1 = intval($border[0]); $padding = NextendParse::parse($params->get('simplepadding', '0|*|0|*|0|*|0')); $context['paddingt'] = $padding[0] . 'px'; $context['paddingr'] = $padding[1] . 'px'; $context['paddingb'] = $padding[2] . 'px'; $context['paddingl'] = $padding[3] . 'px'; if ($context['canvas']) { $width += 2 * $border1 + $padding[1] + $padding[3]; $height += 2 * $border1 + $padding[0] + $padding[2]; $context['width'] = $width . "px"; $context['height'] = $height . "px"; } $context['border'] = $border1 . 'px'; $rgba = NextendColor::hex2rgba($border[1]); $context['borderrgba'] = 'RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ')'; $context['borderhex'] = '#' . substr($border[1], 0, 6); $borderradius = NextendParse::parse($params->get('simpleborderradius', '0|*|0|*|0|*|0')); $context['tl'] = $borderradius[0] . 'px'; $context['tr'] = $borderradius[1] . 'px'; $context['br'] = $borderradius[2] . 'px'; $context['bl'] = $borderradius[3] . 'px'; $width = $width - ($padding[1] + $padding[3]) - $border1 * 2; $height = $height - ($padding[0] + $padding[2]) - $border1 * 2; $context['inner1height'] = $height . 'px'; $context['canvaswidth'] = $width . "px"; $context['canvasheight'] = $height . "px";
static function render($slider, $id, $params) { $html = ''; $bullet = $params->get('bullet', false); if ($bullet && $bullet != -1) { $displayclass = self::getDisplayClass($params->get('widgetbulletdisplay', '0|*|always|*|0|*|0'), true) . 'nextend-widget-bullet '; $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'numbers' . DIRECTORY_SEPARATOR . 'style.css')); list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('bulletbackground', '00000060')); list($colorhexhover, $rgbacsshover) = NextendColor::colorToCss($params->get('bulletbackgroundhover', '7670C7ff')); list($colorhexborderbar, $rgbacssborderbar) = NextendColor::colorToCss($params->get('bulletbarcolor', '00000060')); list($colorhexthumbnail, $rgbacssthumbnail) = NextendColor::colorToCss($params->get('bulletthumbnail', '00000060')); list($style, $data) = self::getPosition($params->get('bulletposition', '')); $style .= 'visibility: hidden;z-index:10; line-height: 0;'; $width = NextendParse::parse($params->get('bulletwidth', 'width')); if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') { $style .= 'width:' . $width . ';'; } else { $data .= 'data-sswidth="' . $width . '" '; } $bulletalign = $params->get('bulletalign', 'center'); if ($bulletalign) { $style .= 'text-align:' . $bulletalign . ';'; } $info = pathinfo($bullet); $class = 'nextend-bullet nextend-bullet-numbers nextend-bullet-numbers-' . basename($bullet, '.' . $info['extension']); $class .= ' nextend-bullet-' . $params->get('bulletorientation', 'horizontal'); $shadow = $params->get('bulletshadow', 'none'); switch ($shadow) { case 'inner': $class .= ' bullet-shadow-inner'; break; case 'outer': $class .= ' bullet-shadow-outer'; break; } $bar = $params->get('bulletbar', 'none'); switch ($bar) { case 'simplerounded': $class .= ' bullet-bar-simple-rounded'; break; case 'elegantrounded': $class .= ' bullet-bar-elegant-rounded'; break; case 'simple': $class .= ' bullet-bar-simple'; break; case 'elegant': $class .= ' bullet-bar-elegant'; break; } $html .= '<div style="' . $style . '" class="' . $displayclass . '" ' . $data . '><div class="nextend-bullet-container ' . $class . '">'; $i = 0; foreach ($slider->_slides as $slide) { $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'goto\',' . $i . ',false);" data-thumbnail="' . $slide['thumbnail'] . '" class="' . $class . ($slide['first'] ? ' active' : '') . '"><span class="' . $params->get('fontclassnumber', 'sliderfont7') . '"> ' . ($i + 1) . ' </span></div>'; $i++; } $html .= '</div></div>'; self::tooltip($id, NextendParse::parse($params->get('bullethumbnail', false), '0|*|top'), "nextend-bullet-numbers-thumbnail"); $thumbnailsize = NextendParse::parse($params->get('thumbnailsizebullet', false), '100|*|60'); $css->addCssFile(' #' . $id . ' .nextend-bullet-container .nextend-bullet-numbers.nextend-bullet{ background:' . $rgbacss . '; } #' . $id . ' .nextend-bullet-container .nextend-bullet-numbers.nextend-bullet.active, #' . $id . ' .nextend-bullet-container .nextend-bullet-numbers.nextend-bullet:HOVER{ background:' . $rgbacsshover . '; } #' . $id . ' .nextend-bullet-container.nextend-bullet.nextend-bullet-numbers.bullet-bar-simple-rounded, #' . $id . ' .nextend-bullet-container.nextend-bullet.nextend-bullet-numbers.bullet-bar-elegant-rounded, #' . $id . ' .nextend-bullet-container.nextend-bullet.nextend-bullet-numbers.bullet-bar-simple, #' . $id . ' .nextend-bullet-container.nextend-bullet.nextend-bullet-numbers.bullet-bar-elegant{ background:' . $rgbacssborderbar . '; } #' . $id . ' .nextend-bullet-numbers-thumbnail .qtip-content{ width:' . $thumbnailsize[0] . 'px; height:' . $thumbnailsize[1] . 'px; padding: 4px; } #' . $id . ' .nextend-bullet-numbers-thumbnail .qtip-content img{ box-shadow: 0 0px 0px 1px RGBA(255,255,255,.2); } #' . $id . ' .nextend-bullet-numbers-thumbnail{ background: ' . $rgbacssthumbnail . '; }', $id); } return $html; }
static function render($slider, $id, $params) { $html = ''; $indicatorskin = $params->get('indicatorskin', false); if ($indicatorskin && $indicatorskin != -1) { $displayclass = self::getDisplayClass($params->get('widgetindicatordisplay', '0|*|always|*|0|*|0'), true) . 'nextend-indicator '; $js = NextendJavascript::getInstance(); $js->addLibraryJsFile('jquery', dirname(__FILE__) . '/pie/jquery.knob.js'); list($style, $data) = self::getPosition($params->get('indicatorposition', '')); $style .= 'z-index:10;'; $size = intval($params->get('indicatorsize', 50)); $color = NextendParse::parse($params->get('indicatorcolor', 50)); list($color[0], $rgbafg) = NextendColor::colorToCss($color[0]); list($color[1], $rgbabg) = NextendColor::colorToCss($color[1]); $html = '<div class="' . $displayclass . 'nextend-indicator-pie" style="line-height:0;' . $style . '" ' . $data . '> <input class="nextend-indicator-pie-input" name="pie" type="hidden" value="0" data-thickness="' . $params->get('indicatorthickness', 0.5) . '" data-width="' . $size . '" data-height="' . $size . '" data-linecap="' . $params->get('indicatorlinecap', 'butt') . '" data-fgcolor="' . $rgbafg . '" data-bgcolor="' . $rgbabg . '" data-readOnly="1" autocomplete="off" /> </div>'; $skin = ''; switch (basename($params->get('indicatorskin', 'default.png'))) { case 'tron.png': $skin = 'draw : function () { var a = this.angle(this.cv) // Angle , sa = this.startAngle // Previous start angle , sat = this.startAngle // Start angle , ea // Previous end angle , eat = sat + a // End angle , r = true; this.g.lineWidth = this.lineWidth; this.o.cursor && (sat = eat - 0.3) && (eat = eat + 0.3); if (this.o.displayPrevious) { ea = this.startAngle + this.angle(this.value); this.o.cursor && (sa = ea - 0.3) && (ea = ea + 0.3); this.g.beginPath(); this.g.strokeStyle = this.previousColor; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false); this.g.stroke(); } this.g.beginPath(); this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false); this.g.stroke(); this.g.lineWidth = 2; this.g.beginPath(); this.g.strokeStyle = this.o.fgColor; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false); this.g.stroke(); return false; }'; break; } $html .= "\n <script type='text/javascript'>\n function isCanvasSupported(){\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n }\n njQuery(document).ready(function () {\n if(isCanvasSupported()){\n var input = window.njQuery('#" . $id . " .nextend-indicator-pie-input');\n input.knob({\n " . $skin . "\n });\n window['" . $id . "-indicator'] = {\n hide: function(){\n input.hide();\n },\n show: function(){\n input.show();\n },\n refresh: function(val){\n input.val(val).trigger('change');\n }\n };\n }\n });\n </script>\n "; } return $html; }