Ejemplo n.º 1
0
    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;
    }
Ejemplo n.º 2
0
 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;
 }