function addCSS() { $id = $this->getId(); nextendimport('nextend.css.css'); $css = NextendCss::getInstance(); $css->createGroup($id); $css->enableLess($id); $css->addLessImportDir(NEXTEND_SMART_SLIDER2_ASSETS . 'less' . DIRECTORY_SEPARATOR, $id); $data =& $this->_data; $slider =& $this->_slider; $sliderParams =& $this->_sliderParams; $size = NextendParse::parse($sliderParams->get('size')); $context = array('id' => '~"#' . $this->getId() . '"', 'width' => $size[0] . 'px', 'height' => $size[1] . 'px', 'canvas' => intval($size[2]), 'count' => count($this->_slides), 'margin' => NextendParse::parseUnit($sliderParams->get('margin'), ' ')); if ($this->_backend) { $context['margin'] = '0px 0px 0px 0px'; } nextendimport('nextend.parse.font'); $fonts = 0; foreach (NextendSmartSliderFontSettings::getAll($this->_sliderid) as $k => $v) { preg_match('/sliderfont(custom)?([0-9]*)$/', $k, $matches); if (count($matches)) { $context['font' . $fonts] = '~".' . $matches[0] . '"'; $tmp = json_decode($v); if ($tmp === null || $tmp == $v) { $v = base64_decode($v); } $font = new NextendParseFont($v); $context['font' . $fonts . 'text'] = '";' . $font->printTab() . '"'; $font->mixinTab('Link'); $context['font' . $fonts . 'link'] = '";' . $font->printTab('Link') . '"'; $font->mixinTab('Link:Hover', 'Link'); $context['font' . $fonts . 'hover'] = '";' . $font->printTab('Link:Hover') . '"'; $fonts++; } } $context['fonts'] = $fonts; include $this->_typePath . 'context.php'; $css->addCssFile(array($this->getId(), $this->_typePath . 'style.less', $context), $this->getId()); $imageload = NextendParse::parse($this->_sliderParams->get('imageload', '0|*|0')); $lazyload = intval($imageload[0]); if ($lazyload) { $css->addCssFile(array($this->getId() . 'spinner', NEXTEND_SMART_SLIDER2_ASSETS . 'less' . DIRECTORY_SEPARATOR . 'spinner.less', array('id' => '~"#' . $this->getId() . '"')), $this->getId()); } if (strpos($context['margin'], '%')) { $m = explode('% ', $context['margin']); $m[1] = $m[1] / 100 * intval($context['width']); $m[3] = $m[3] / 100 * intval($context['width']); $m[0] = $m[0] / 100 * intval($context['height']); $m[2] = $m[2] / 100 * intval($context['height']); } else { $m = explode('px ', $context['margin']); } $addcss = (array) NextendParse::parse(NextendSmartSliderSettings::get('externalcssfile')); if ($this->_backend && count($addcss)) { foreach ($addcss as $cssfile) { $css->addCssFile($cssfile); } } return array(intval($context['width']), intval($context['height']), $m[0] + $m[2], $m[1] + $m[3], intval($context['canvaswidth']), intval($context['canvasheight'])); }
$titleheights = $titleheight * $context['count']; $context['inner1margin'] = '0'; if ($context['canvas']) { $width += 2 * ($border1 + $border2) + $slidemargin * 2; $height += 2 * ($border1 + $border2 + $slidemargin * $context['count']) + $titleheights; $context['width'] = $width . "px"; $context['height'] = $height . "px"; } $width = $width - 2 * $border1; $height = $height - 2 * $border1; $context['border1width'] = $width . 'px'; $context['border1height'] = $height . 'px'; $width = $width - 2 * $border2; $height = $height - 2 * $border2; $context['border2width'] = $width . 'px'; $context['border2height'] = $height . 'px'; $width = $width - 2 * $slidemargin; $height = $height - 2 * $context['count'] * $slidemargin; $context['titlewidth'] = $width . "px"; $context['titleheight'] = $titleheight . "px"; $context['innerborderradius'] = "2px"; $context['canvaswidth'] = $width . "px"; $context['canvasheight'] = $height - $titleheights . "px"; $f = $params->get('accordionverticaltabfont', '{"firsttab":"Text","Text":{"color":"e4eaeeff","size":"112||%","tshadow":"0|*|1|*|0|*|000000FF","afont":"google(@import url(http://fonts.googleapis.com/css?family=Open Sans);),Arial","lineheight":"normal","bold":1,"italic":0,"underline":0,"align":"left","paddingleft":0},"Active":{"paddingleft":0,"color":"222222ff","tshadow":"0|*|1|*|0|*|ffffff3d"},"Link":{"paddingleft":0},"Hover":{"paddingleft":0,"color":"222222ff","tshadow":"0|*|1|*|0|*|ffffffff"},"firsttab":"Text"}'); if (json_decode($f) === null) { $f = base64_decode($f); } $font = new NextendParseFont($f); $context['tabfont-text'] = '";' . $font->printTab() . '"'; $font->mixinTab('Active'); $context['tabfont-active'] = '";' . $font->printTab('Active') . '"';
$font = new NextendParseFont($data->get('titlefont')); $context['titlefont'] = '";' . $font->printTab() . '"'; $context['margin'] = NextendParse::parseUnit($data->get('margin'), ' '); for ($i = 1; $i < 6; $i++) { $context['level' . $i . 'margin'] = '"' . NextendParse::parseUnit($data->get('level' . $i . 'margin'), ' ') . '"'; $context['level' . $i . 'padding'] = '"' . NextendParse::parseUnit($data->get('level' . $i . 'padding'), ' ') . '"'; $border = NextendParse::parse($data->get('level' . $i . 'border')); $context['level' . $i . 'borderstyle'] = $border[6]; unset($border[6]); $context['level' . $i . 'bordercolor'] = '#' . $border[5]; unset($border[5]); $context['level' . $i . 'borderwidth'] = NextendParse::parseUnit($border, ' '); $minus = NextendParse::parse($data->get('level' . $i . 'minus')); $context['level' . $i . 'minusimage'] = '"' . $minus[0] . '"'; $context['level' . $i . 'minusposition'] = $minus[1]; $context['level' . $i . 'minuscolor'] = '"' . $minus[2] . '"'; $context['level' . $i . 'minuscolorize'] = '"' . $minus[3] . '"'; $plus = NextendParse::parse($data->get('level' . $i . 'plus')); $context['level' . $i . 'plusimage'] = '"' . $plus[0] . '"'; $context['level' . $i . 'plusposition'] = $plus[1]; $context['level' . $i . 'pluscolor'] = '"' . $plus[2] . '"'; $context['level' . $i . 'pluscolorize'] = '"' . $plus[3] . '"'; $font = new NextendParseFont($data->get('level' . $i . 'textfont')); $context['level' . $i . 'font-text'] = '";' . $font->printTab() . '"'; $font->mixinTab('Active'); $context['level' . $i . 'font-active'] = '";' . $font->printTab('Active') . '"'; $font->mixinTab('Link'); $context['level' . $i . 'font-link'] = '";' . $font->printTab('Link') . '"'; $font->mixinTab('Hover'); $context['level' . $i . 'font-hover'] = '";' . $font->printTab('Hover') . '"'; }