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 addFolder($folder) { $this->_xml->addChild('option', $folder)->addAttribute('value', $folder); foreach (NextendFilesystem::folders($folder) as $f) { $this->addFolder($folder . $f . '/'); } }
function fetchElement() { $this->setfolder(); $files = NextendFilesystem::files($this->_folder); $this->_xml->addChild('option', NextendText::_('No_image'))->addAttribute('value', -1); for ($i = 0; $i < count($files); $i++) { $ext = pathinfo($files[$i], PATHINFO_EXTENSION); if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($this->_folder . $files[$i]))); } } if (nextendIsWordPress()) { $wpfolder = get_template_directory() . '/' . NextendXmlGetAttribute($this->_xml, 'folder') . '/'; if (isset($_GET['nextendpath'])) { echo $wpfolder . "<br />"; } if (NextendFilesystem::existsFolder($wpfolder)) { $files = NextendFilesystem::files($wpfolder); for ($i = 0; $i < count($files); $i++) { $ext = pathinfo($files[$i], PATHINFO_EXTENSION); if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($wpfolder . $files[$i]))); } } } } $css = NextendCss::getInstance(); $css->addCssLibraryFile('element/imagelist.css'); $html = "<div class='nextend-imagelist' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>"; $html .= parent::fetchElement(); $html .= '</div>'; return $html; }
function generateOptions(&$xml) { $template = (string) $this->_xml; $cssfile = NextendFilesystem::translateToMediaPath(str_replace(DIRECTORY_SEPARATOR, '/', dirname($this->_form->_xmlfile)) . '/style.'); $css = NextendCss::getInstance(); if (NextendFilesystem::fileexists($cssfile . 'less')) { $css->enableLess(); $cssfile .= 'less'; $css->addCssFile(array($cssfile, $cssfile, array('id' => 'body'))); } else { $cssfile .= 'css'; $css->addCssFile($cssfile); } $prefix = NextendXmlGetAttribute($this->_xml, 'prefix'); $this->_values = array(); $html = ''; foreach ($xml->option as $option) { $v = NextendXmlGetAttribute($option, 'value'); $this->_values[] = $v; if ($v != -1) { $info = pathinfo($v); $class = $prefix . basename($v, '.' . $info['extension']); $html .= ' <div class="nextend-radio-option nextend-imagelist-option' . $this->isSelected($v) . '"> ' . str_Replace('{image}', NextendUri::pathToUri($v), str_Replace('{class}', $class, $template)) . ' </div>'; } else { $html .= '<div class="nextend-radio-option' . $this->isSelected($v) . '">' . (string) $option . '</div>'; } } return $html; }
function getFontUrl() { $css = NextendCss::getInstance(); $url = 'https://fonts.googleapis.com/css?family='; $subset = ''; if (count($this->_fonts)) { foreach ($this->_fonts as $family => $font) { $style = explode(',', $font[0]); $style = array_filter(array_unique($style)); foreach ($style as $k => $s) { $file = NEXTENDLIBRARYASSETS . 'fonts/' . preg_replace("/[^a-z0-9]/", '', strtolower($family)) . '/' . $s . '/s.css'; if (NextendFilesystem::existsFile($file)) { unset($style[$k]); $css->addCssFile($file, null, true); } } if (count($style)) { $url .= urlencode($family) . ':' . implode(',', $style) . '|'; $subset .= $font[1] . ','; } } } if ($url == 'https://fonts.googleapis.com/css?family=') { return ''; } $url = substr($url, 0, -1); $subset = explode(',', $subset); $subset = array_filter(array_unique($subset)); $url .= '&subset=' . implode(',', $subset); return $url; }
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); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'image' . DIRECTORY_SEPARATOR . 'style.css')); if ($previous && $previous != -1) { list($style, $data) = self::getPosition($params->get('previousposition', '')); $info = pathinfo($previous); $class = 'nextend-arrow-previous nextend-image nextend-image-previous nextend-image-previous-' . basename($previous, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'previous\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '></div>'; } if ($next && $next != -1) { list($style, $data) = self::getPosition($params->get('nextposition', '')); $info = pathinfo($next); $class = 'nextend-arrow-next nextend-image nextend-image-next nextend-image-next-' . basename($next, '.' . $info['extension']); $html .= '<div onclick="njQuery(\'#' . $id . '\').smartslider(\'next\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '></div>'; } } return $html; }
function render($xmlpath, $data) { $css = NextendCss::getInstance(); $js = NextendJavascript::getInstance(); $css->addCssLibraryFile('common.css'); $css->addCssLibraryFile('window.css'); $css->addCssLibraryFile('configurator.css'); $js->loadLibrary('dojo'); nextendimport('nextend.form.form'); $form = new NextendForm(); $form->loadArray($data); $form->loadXMLFile($xmlpath); echo $form->render('settings'); $js->addLibraryJsAssetsFile('dojo', 'form.js'); $js->addLibraryJs('dojo', ' new NextendForm({ container: "smartslider-form", data: ' . json_encode($form->_data) . ', xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($xmlpath)) . '", control_name: "settings", url: "' . NextendUri::ajaxUri('nextend', 'smartslider') . '", loadedJSS: ' . json_encode($js->generateArrayJs()) . ', loadedCSS: ' . json_encode($css->generateArrayCSS()) . ' }); ', true); }
function render($tpl) { $tplpath = $this->_path . 'tpl/' . $tpl . '.php'; if (NextendFilesystem::existsFile($tplpath)) { include $tplpath; } }
function nextendimportpath($file) { $file .= '.php'; if (NextendFilesystem::fileexists($file)) { require_once $file; return true; } return false; }
function addCSS() { parent::addCSS(); $css = NextendCss::getInstance(); end($css->_cssFiles); $last = key($css->_cssFiles); $override = str_replace(WP_PLUGIN_DIR, get_template_directory(), $css->_cssFiles[$last][1]); if (NextendFilesystem::fileexists($override)) { $css->_cssFiles[$last][1] = $override; } }
function onNextendSliderGeneratorList(&$group, &$list, $showall = false) { if ($showall || smartsliderIsFull()) { $installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_flexicontent'); if ($showall || $installed) { $group[$this->_group] = 'FLEXIcontent'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } $list[$this->_group][$this->_group . '_items'] = array(NextendText::_('Items'), $this->getPath() . 'items' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/authoring-a-content/content-construction/10667', null); } } }
function onNextendSliderGeneratorList(&$group, &$list, $showall = false) { if ($showall || smartsliderIsFull()) { $installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_phocagallery'); if ($showall || $installed) { $group[$this->_group] = 'Phoca Gallery'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } $list[$this->_group][$this->_group . '_phocagalleryimages'] = array(NextendText::_('Images'), $this->getPath() . 'phocagalleryimages' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/photos-a-images/galleries/photo-gallery/3150', 'image_extended'); } } }
function makeUrl($matches) { if (substr($matches[1], 0, 5) == 'data:') { return $matches[0]; } if (substr($matches[1], 0, 4) == 'http') { return $matches[0]; } if (substr($matches[1], 0, 2) == '//') { return $matches[0]; } return 'url(' . str_replace(array('http://', 'https://'), '//', NextendFilesystem::pathToAbsoluteURL(dirname($this->path))) . '/' . $matches[1] . ')'; }
function onNextendSliderGeneratorList(&$group, &$list, $showall = false) { if ($showall || smartsliderIsFull()) { $installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog'); if ($showall || $installed) { $group[$this->_group] = 'EasyBlog'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } $list[$this->_group][$this->_group . '_posts'] = array(NextendText::_('Posts'), $this->getPath() . 'posts' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/authoring-a-content/blog/12630', 'article'); } } }
function onNextendSliderGeneratorList(&$group, &$list, $showall = false) { if ($showall || smartsliderIsFull()) { $installed = NextendFilesystem::existsFile(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_jshopping' . DIRECTORY_SEPARATOR . 'jshopping.php'); if ($showall || $installed) { $group[$this->_group] = 'JoomShopping'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } $list[$this->_group][$this->_group . '_products'] = array(NextendText::_('Products'), $this->getPath() . 'products' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/e-commerce/shopping-cart/5378', 'product'); } } }
function auth() { $folder = NextendRequest::getVar('folder'); if ($folder) { $authfile = NextendFilesystem::pathToAbsolutePath($folder) . 'auth.php'; if (NextendFilesystem::fileexists($authfile)) { require_once $authfile; if (function_exists('nextend_api_auth_flow')) { nextend_api_auth_flow(); } } } exit; }
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 = ''; $autoplayimage = $params->get('autoplayimage', false); if ($autoplayimage && $autoplayimage != -1) { $displayclass = self::getDisplayClass($params->get('widgetautoplaydisplay', '0|*|always|*|0|*|0'), true); $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'image' . DIRECTORY_SEPARATOR . 'style.css')); list($style, $data) = self::getPosition($params->get('autoplayimageposition', '')); $info = pathinfo($autoplayimage); $class = 'nextend-autoplay-button nextend-autoplay-image nextend-autoplay-' . basename($autoplayimage, '.' . $info['extension']); $html .= '<div onclick="njQuery(this).hasClass(\'paused\') ? njQuery(\'#' . $id . '\').smartslider(\'startautoplay\') : njQuery(\'#' . $id . '\').smartslider(\'pauseautoplay\');" class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '></div>'; } 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 decorateBefore() { $js = NextendJavascript::getInstance(); $html = ''; $js->addLibraryJs('dojo', ' new NextendElementSubform({ hidden: "' . $this->_id . '", origvalue: "' . $this->_value . '", value: "' . $this->_value . '", tab: "' . $this->_tab->_name . '", xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($this->_form->_xmlfile)) . '" }); '); $GLOBALS['nextendbuffer'] = '<div id="nextend-' . $this->_name . '-panel">' . $this->renderForm() . "</div>"; return $html; }
function getData($number) { $data = array(); $folder = $this->_data->get('sourcefolder', ''); $files = NextendFilesystem::files($folder); $j = 0; for ($i = 0; $i < count($files) && $j < $number; $i++) { $ext = strtolower(pathinfo($files[$i], PATHINFO_EXTENSION)); if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png') { $data[$j] = array(); $data[$j]['thumbnail'] = $data[$j]['image'] = $data[$j]['image_url'] = NextendUri::pathToUri($folder . $files[$i]); $data[$j]['title'] = $data[$j]['file_name'] = $files[$i]; $j++; } } return $data; }
function fetchElement() { $this->setfolder(); $files = NextendFilesystem::files($this->_folder); $this->_xml->addChild('option', 'No image')->addAttribute('value', -1); for ($i = 0; $i < count($files); $i++) { $ext = pathinfo($files[$i], PATHINFO_EXTENSION); if ($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png') { $this->_xml->addChild('option', htmlspecialchars(ucfirst($files[$i])))->addAttribute('value', NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($this->_folder . $files[$i]))); } } $css = NextendCss::getInstance(); $css->addCssLibraryFile('element/imagelist.css'); $html = "<div class='nextend-imagelist' style='" . NextendXmlGetAttribute($this->_xml, 'style') . "'>"; $html .= parent::fetchElement(); $html .= '</div>'; return $html; }
function fetchElement() { $js = NextendJavascript::getInstance(); $js->addLibraryJsAssetsFile('dojo', 'element.js'); $js->addLibraryJsFile('dojo', dirname(__FILE__) . '/flickrtoken.js'); $js->addLibraryJs('dojo', ' new NextendElementFlickrToken({ hidden: "' . $this->_id . '", link: "nextend-flickr-request-token", callback: "nextend-flickr-callback", folder: "' . NextendFilesystem::pathToRelativePath(realpath(dirname(__FILE__) . '/..')) . '/' . '" }); '); $html = parent::fetchElement(); $html .= '<a href="#" id="nextend-flickr-request-token" style="line-height: 24px;">' . NextendText::_('Request_token') . '</a>'; $html .= '<span id="nextend-flickr-callback" style="line-height: 24px;clear: both;float:left;"></span>'; return $html; }
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 onNextendSliderGeneratorList(&$group, &$list, $showall = false) { if ($showall || smartsliderIsFull()) { $installed = NextendFilesystem::existsFolder(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_zoo'); if ($installed) { $group[$this->_group] = 'ZOO'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } require_once JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_zoo' . DIRECTORY_SEPARATOR . 'config.php'; $zoo = App::getInstance('zoo'); $apps = $zoo->table->application->all(array('order' => 'name')); require_once $this->getPath() . 'items' . DIRECTORY_SEPARATOR . 'generator.php'; foreach ($apps as $app) { foreach ($app->getTypes() as $type) { //Make them class name safe $appid = preg_replace('/[^a-zA-Z0-9_\\x7f-\\xff]*/', '', $app->id); $identifier = preg_replace('/[^a-zA-Z0-9_\\x7f-\\xff]*/', '', $type->identifier); $list[$this->_group][$this->_group . '_items__' . $appid . '___' . $identifier] = array(ucfirst($app->name) . ' (' . ucfirst($type->identifier) . ')', $this->getPath() . 'items' . DIRECTORY_SEPARATOR, true, true, $installed ? true : 'http://extensions.joomla.org/extensions/authoring-a-content/content-construction/12479', null); if (!class_exists('NextendGeneratorZoo_items__' . $appid . '___' . $identifier)) { eval('class NextendGeneratorZoo_items__' . $appid . '___' . $identifier . ' extends NextendGeneratorZoo_Items{}'); } } } } else { if ($showall) { $group[$this->_group] = 'ZOO'; if (!isset($list[$this->_group])) { $list[$this->_group] = array(); } $list[$this->_group][$this->_group . '_items'] = array('Zoo', $this->getPath() . 'items' . DIRECTORY_SEPARATOR, true, true, 'http://extensions.joomla.org/extensions/authoring-a-content/content-construction/12479', null); } } $app = JFactory::getApplication(); if ($app->isAdmin() && ((NextendRequest::getVar('action') == 'createdynamic' || NextendRequest::getVar('action') == 'generatorsettings') && NextendRequest::getVar('group') == 'zoo' && NextendRequest::getVar('type'))) { $class = 'NextendGenerator' . NextendRequest::getVar('type'); $data = new NextendData(); $data->set('source', NextendRequest::getVar('type')); new $class($data); } } }
static function render($slider, $id, $params) { $html = ''; $shadowcss = $params->get('shadowcss', false); if ($shadowcss && $shadowcss != -1) { $displayclass = self::getDisplayClass($params->get('widgetshadowdisplay', '0|*|always|*|0|*|0'), false); list($style, $data) = self::getPosition($params->get('shadowposition', '')); $width = NextendParse::parse($params->get('shadowwidth', 'width')); if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') { $style .= 'width:' . $width . ';'; } else { $data .= 'data-sswidth="' . $width . '" '; } $css = NextendCss::getInstance(); $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shadow' . DIRECTORY_SEPARATOR . 'style.css')); $info = pathinfo($shadowcss); $class = 'nextend-shadow nextend-shadow-' . basename($shadowcss, '.' . $info['extension']); $html .= '<div class="' . $displayclass . $class . '" style="line-height:0;' . $style . '" ' . $data . '><img src="' . (nextendIsWordpress() ? plugins_url('shadow/shadow/' . $info['basename'], __FILE__) : NextendUri::pathToUri(NextendFilesystem::getBasePath() . $shadowcss)) . '"/></div>'; } return $html; }
function subform() { $response = array(); if (!isset($_POST['data'])) { echo json_encode(array('error' => 'Post not OK!')); exit; } if (get_magic_quotes_gpc() || nextendIsWordPress()) { $_POST['data'] = stripslashes($_POST['data']); } $data = json_decode($_POST['data'], true); $configurationXmlFile = rtrim(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $data['xml']; if (NextendFilesystem::fileexists($configurationXmlFile)) { nextendimport('nextend.css.css'); nextendimport('nextend.javascript.javascript'); $css = NextendCSS::getInstance(); $js = NextendJavascript::getInstance(); $js->loadLibrary('dojo'); nextendimport('nextend.form.form'); $form = new NextendForm(); $form->loadArray($data['orig']); $form->loadArray(array($data['name'] => $data['value'])); $form->loadXMLFile($configurationXmlFile); ob_start(); $subform = $form->getSubform($data['tab'], $data['name']); $subform->initAjax($data['control_name']); echo $subform->renderForm(); echo "<style>"; echo $css->generateAjaxCSS($data['loadedCSS']); echo "</style>"; $scripts = $js->generateAjaxJs($data['loadedJSS']); $html = ob_get_clean(); $response = array('html' => $html, 'scripts' => $scripts); } else { $response = array('error' => 'Configuration file not found'); } echo json_encode($response); exit; }
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 = ''; $bargradient = $params->get('bargradient', false); if ($bargradient && $bargradient != -1) { $displayclass = self::getDisplayClass($params->get('widgetbardisplay', '0|*|always|*|0|*|0'), true); $css = NextendCss::getInstance(); $css->enableLess(); $cssfile = NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'gradient' . DIRECTORY_SEPARATOR . 'style.less'); $css->addCssFile(array($cssfile, $cssfile, array('id' => '~"#' . $id . '"')), $id); list($style, $data) = self::getPosition($params->get('bargradientposition', '')); $width = NextendParse::parse($params->get('bargradientwidth', '100%')); if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') { $style .= 'width:' . $width . ';'; } else { $data .= 'data-sswidth="' . $width . '" '; } $height = $params->get('bargradientheight', '30'); $style .= 'height: ' . $height . 'px;'; $style .= 'font-size: ' . intval($slider->_sliderParams->get('globalfontsize', '12')) . 'px;'; $info = pathinfo($bargradient); $class = 'nextend-bar nextend-bar-g nextend-bar-g-' . basename($bargradient, '.' . $info['extension']); $html .= '<div class="' . $displayclass . $class . '" style="' . $style . '" ' . $data . '>'; $html .= '<div class="inner" style="height:' . ($height - 2) . 'px;">'; for ($i = 0; $i < count($slider->_slides); $i++) { $html .= '<div class="nextend-bar-slide ' . ($slider->_slides[$i]['first'] ? ' active' : '') . '">'; $html .= '<h6 class="' . $params->get('bargradienttitlefont', '') . '" style="line-height: ' . $height . 'px;">' . $slider->_slides[$i]['title'] . '</h6>'; if ($slider->_slides[$i]['description']) { $html .= '<p class="' . $params->get('bargradientdescriptionfont', '') . '" style="line-height: ' . $height . 'px;"> - ' . $slider->_slides[$i]['description'] . '</p>'; } $html .= '</div>'; } $html .= '</div></div>'; } return $html; }