public function renderPlaceholder($sizes) { if (!$this->slider->isAdmin && $this->fadeOnLoad && ($this->slider->features->responsive->scaleDown || $this->slider->features->responsive->scaleUp)) { if (N2SystemHelper::testMemoryLimit()) { if ($sizes['width'] + $sizes['marginHorizontal'] > 0 && $sizes['height'] > 0 && function_exists('imagecreatetruecolor')) { return N2Html::tag("div", array("id" => $this->slider->elementId . "-placeholder", "encode" => false, "style" => 'position: relative;z-index:2;'), $this->makeImage($sizes)); } else { N2CSS::addCode("#{$this->slider->elementId} .n2-ss-load-fade{position: relative !important;}", $this->slider->cacheId); } } else { N2Message::error(n2_("It seems like the <a href='http://php.net/manual/en/ini.core.php#ini.memory-limit'>memory_limit</a> on the server is too low for the fade on load feature. Please set it minimum 60M and reload the page! You can disable this message in <a href='" . N2Form::$documentation . "#Troubleshooting-G-Server'>global configuration</a> 'Frontend debug message' option.")); } } else { N2CSS::addCode("#{$this->slider->elementId}.n2-ss-load-fade{position: relative !important;}", $this->slider->cacheId); } return ''; }
public static function render($style, $mode, $group, $pre = '') { self::$pre = $pre; $selector = ''; if (intval($style) > 0) { // Linked $style = N2StorageSectionAdmin::getById($style, 'style'); if ($style) { if (is_string($style['value'])) { $value = json_decode(base64_decode($style['value']), true); } else { $value = $style['value']; } $selector = 'n2-style-' . $style['id'] . '-' . $mode; self::$sets[] = $style['referencekey']; if (!isset(self::$styles[$style['id']])) { self::$styles[$style['id']] = array($mode); } else { if (!in_array($mode, self::$styles[$style['id']])) { self::$styles[$style['id']][] = $mode; } } N2CSS::addCode(self::renderStyle($mode, $pre, $selector, $value['data']), $group); return $selector . ' '; } } else { if ($style != '') { $value = json_decode(base64_decode($style), true); if ($value) { $selector = 'n2-style-' . md5($style) . '-' . $mode; N2CSS::addCode(self::renderStyle($mode, $pre, $selector, $value['data']), $group); return $selector . ' '; } } } return ''; }
public static function render($font, $mode, $group, $pre = '', $fontSize = false) { self::$pre = $pre; if (intval($font) > 0) { // Linked $font = N2StorageSectionAdmin::getById($font, 'font'); if ($font) { if (is_string($font['value'])) { $value = json_decode(base64_decode($font['value']), true); } else { $value = $font['value']; } $selector = 'n2-font-' . $font['id'] . '-' . $mode; self::$sets[] = $font['referencekey']; if (!isset(self::$fonts[$font['id']])) { self::$fonts[$font['id']] = array($mode); } else { if (!in_array($mode, self::$fonts[$font['id']])) { self::$fonts[$font['id']][] = $mode; } } N2CSS::addCode(self::renderFont($mode, $pre, $selector, $value['data'], $fontSize), $group); return $selector . ' '; } } else { if ($font != '') { $value = json_decode(base64_decode($font), true); if ($value) { $selector = 'n2-font-' . md5($font) . '-' . $mode; N2CSS::addCode(self::renderFont($mode, $pre, $selector, $value['data'], $fontSize), $group); return $selector . ' '; } } } return ''; }