public function save() { $namespace = N2Request::getCmd('namespace', 'default'); $settings = N2Request::getVar('settings'); if ($namespace && $settings) { if ($namespace == 'default') { $namespace = 'settings'; } if ($namespace == 'font' && N2Request::getInt('sliderid')) { $namespace .= N2Request::getInt('sliderid'); self::markChanged(N2Request::getInt('sliderid')); } if ($namespace == 'joomla') { $license = empty($settings['license']) ? '' : $settings['license']; $updates = $this->db->queryAll("SELECT b.update_site_id FROM " . $this->db->tableAlias("extensions") . " AS a LEFT JOIN " . $this->db->tableAlias("update_sites_extensions") . " AS b ON a.extension_id = b.extension_id WHERE a.element = 'com_smartslider3'"); if (count($updates)) { $id = $updates[0]['update_site_id']; unset($updates[0]); if (count($updates)) { foreach ($updates as $u) { $this->db->setTableName("update_sites"); $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id'])); $this->db->setTableName("update_sites_extensions"); $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id'])); } } $this->db->setTableName("update_sites"); $this->db->update(array("location" => 'http://www.nextendweb.com/update2/joomla/update.php?license=' . urlencode($license) . '&fake=extension.xml'), array("update_site_id" => $id)); } } N2SmartSliderSettings::store($namespace, json_encode($settings)); } }
public function actionEdit() { $this->validateToken(); $this->validatePermission('smartslider_edit'); $slidersModel = new N2SmartsliderSlidersModel(); $sliderId = N2Request::getInt('sliderid'); $slider = $slidersModel->get($sliderId); $this->validateDatabase($slider); $slidesModel = new N2SmartsliderSlidesModel(); $this->validateDatabase($slidesModel->get(N2Request::getInt('slideid'))); $response = array(); if (N2Request::getInt('save')) { if (N2SmartSliderSettings::get('slide-as-file', 0) && isset($_FILES['slide']) && isset(N2Request::$storage['slide'])) { N2Request::$storage['slide']['slide'] = N2Filesystem::readFile($_FILES['slide']['tmp_name']); } if ($slideId = $slidesModel->save(N2Request::getInt('slideid'), N2Request::getVar('slide'))) { N2Message::success(n2_('Slide saved.')); if (N2Request::getInt('static') == 1) { $slideCount = $slidesModel->makeStatic(N2Request::getInt('slideid')); if ($slideCount) { N2Message::success(sprintf(n2_('%d static slides generated.'), $slideCount)); $this->response->redirect(array("slider/edit", array("sliderid" => $sliderId))); } } } } $this->response->respond($response); }
private function autoCheck() { if (intval(N2SmartSliderSettings::get('autoupdatecheck', 1))) { $time = $this->storage->get('update', 'lastcheck'); if (!$time || strtotime("+1 week", $time) < time()) { $this->check(); } } }
public function actionEnd() { $this->validateToken(); $this->validatePermission('smartslider_edit'); $key = N2Request::getCmd('key'); N2SmartSliderSettings::set('guide-' . $key, 0); N2Message::notice('The ' . $key . ' guide completed. If you need it again, you can turn it on in the "Settings"!'); $this->response->respond(); }
public function actionOrderBy() { $time = N2Request::getCmd('time', null); if ($time == 'DESC' || $time == 'ASC') { N2SmartSliderSettings::set('slidersOrder', 'time'); N2SmartSliderSettings::set('slidersOrderDirection', $time); } $title = N2Request::getCmd('title', null); if ($title == 'DESC' || $title == 'ASC') { N2SmartSliderSettings::set('slidersOrder', 'title'); N2SmartSliderSettings::set('slidersOrderDirection', $title); } $this->redirectToSliders(); }
n2GetBox('n2-box-wide n2-box-overflow n2-box-free', 'free/box2.png', N2Html::tag('div', array(), 'Take your slider to the next level with Smart Slider 3 PRO!') . N2Html::link('See all features', N2SS3::getWhyProUrl(), array('target' => '_blank', 'class' => 'n2-button n2-button-blue n2-button-medium n2-h5 n2-uc')), false); n2GetBox('', 'Documentation.png', N2Html::tag('div', array(), n2_('Interactive online documentation.')) . N2Html::link(n2_('Read'), 'http://doc.smartslider3.com', array('target' => '_blank', 'class' => 'n2-button n2-button-grey n2-button-small n2-h5 n2-uc'))); n2GetBox('', 'Videos.png', N2Html::tag('div', array(), n2_('Helpful tutorial videos.')) . N2Html::link(n2_('Watch'), 'https://www.youtube.com/watch?v=MKmIwHAFjSU&list=PLSawiBnEUNfvzcI3pBHs4iKcbtMCQU0dB', array('target' => '_blank', 'class' => 'n2-button n2-button-grey n2-button-small n2-h5 n2-uc'))); n2GetBox('', 'Help.png', N2Html::tag('div', array(), n2_('First class support with real people.')) . N2Html::link(n2_('Write'), 'http://smartslider3.com/contact-us/', array('target' => '_blank', 'class' => 'n2-button n2-button-grey n2-button-small n2-h5 n2-uc'))); n2GetBox('', 'Newsletter.png', N2Html::tag('div', array(), n2_('Receive the latest news.')) . N2Html::link(n2_('Subscribe'), 'http://eepurl.com/bDp_8b', array('target' => '_blank', 'class' => 'n2-button n2-button-grey n2-button-small n2-h5 n2-uc'))); n2GetBox('', 'Facebook.png', N2Html::tag('div', array(), n2_('Join the community on Facebook.')) . N2Html::link(n2_('Join'), 'https://www.facebook.com/nextendweb', array('class' => 'n2-button n2-button-grey n2-button-small n2-h5 n2-uc', 'target' => '_blank'))); n2GetBox('', 'Love.png', N2Html::tag('div', array(), n2_('Are you satisfied with Smart Slider 3?')) . N2Html::link(n2_('Yes'), 'http://smartslider3.com/satisfied-customer/', array('target' => '_blank', 'class' => 'n2-button n2-button-green n2-button-small n2-h5 n2-uc')) . N2Html::link(n2_('No'), 'http://smartslider3.com/suggestion/', array('target' => '_blank', 'class' => 'n2-button n2-button-red n2-button-small n2-h5 n2-uc'))); n2GetBox('n2-box-add-license', 'AddLicense.png', '<div>' . n2_('You got the PRO license key?') . '</div><a href="http://doc.smartslider3.com/article/484-updating-the-free-version-to-the-full" target="_blank" class="n2-button n2-button-small n2-button-blue n2-uc n2-h5">' . n2_('Install PRO version') . '</a>'); ?> <div class="n2-clear"></div> </div> <?php if (intval(N2SmartSliderSettings::get('discover', 1)) == 1) { N2SmartSliderSettings::set('discover', 0); ?> <script type="text/javascript"> n2(window).ready(function () { new NextendModal({ zero: { size: [ 913, 710 ], title: n2_('Discover Smart Slider 3'), back: false, close: true, content: '<iframe style="margin:20px 10px 0;" width="854" height="480" src="https://www.youtube.com/embed/fjmENHah_oY?autoplay=1" frameborder="0" allowfullscreen></iframe>', controls: ['<a href="#" class="n2-button n2-button-big n2-button-green n2-uc n2-h4">' + n2_('Close') + '</a>'],
public static function showBeacon($search = '') { if (intval(N2SmartSliderSettings::get('beacon', 1))) { echo '<script>!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!0,baseUrl:"//smart-slider-3.helpscoutdocs.com/"},contact:{enabled:!0,formId:"5bf2183c-77e2-11e5-8846-0e599dc12a51"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});HS.beacon.ready(function () {HS.beacon.search("' . $search . '");});</script>'; } }
public function generateJSProperties() { $return = array('admin' => $this->slider->isAdmin, 'isStaticEdited' => intval($this->slider->isStaticEdited), 'translate3d' => intval(N2SmartSliderSettings::get('hardware-acceleration', 1)), 'randomize' => intval(!$this->slider->isAdmin && $this->slider->params->get('randomize', 0)), 'callbacks' => $this->slider->params->get('callbacks', '')); $this->makeJavaScriptProperties($return); return $return; }
static function set($key, $value) { self::getAll(); self::$settings[$key] = $value; N2SmartSliderSettings::store(self::$_type, json_encode(self::$settings)); }
public function __construct($slider) { $this->slider = $slider; $this->desktop = intval($slider->params->get('desktop', 1)); $this->tablet = intval($slider->params->get('tablet', 1)); $this->mobile = intval($slider->params->get('mobile', 1)); $this->type = $slider->params->get('responsive-mode', 'auto'); $class = 'N2SSResponsive' . $this->type; if (!class_exists($class)) { $class = 'N2SSResponsiveAuto'; } $this->modeObject = new $class($slider->params, $this); $this->onResizeEnabled = !$slider->disableResponsive; if (!$this->scaleDown && !$this->scaleUp) { $this->onResizeEnabled = 0; } $this->basedOn = N2SmartSliderSettings::get('responsive-basedon', 'combined'); $this->desktopPortraitScreenWidth = intval(N2SmartSliderSettings::get('responsive-screen-width-desktop-portrait', 1200)); $this->tabletPortraitScreenWidth = intval(N2SmartSliderSettings::get('responsive-screen-width-tablet-portrait', 800)); $this->mobilePortraitScreenWidth = intval(N2SmartSliderSettings::get('responsive-screen-width-mobile-portrait', 440)); if ($this->tabletPortraitScreenWidth < $this->mobilePortraitScreenWidth) { $this->mobilePortraitScreenWidth = $this->tabletPortraitScreenWidth; } $this->tabletLandscapeScreenWidth = intval(N2SmartSliderSettings::get('responsive-screen-width-tablet-landscape', 1024)); $this->mobileLandscapeScreenWidth = intval(N2SmartSliderSettings::get('responsive-screen-width-mobile-landscape', 740)); if ($this->tabletLandscapeScreenWidth < $this->mobileLandscapeScreenWidth) { $this->mobileLandscapeScreenWidth = $this->tabletLandscapeScreenWidth; } $modes = array('desktopPortrait' => 1, 'desktopLandscape' => 0, 'tabletPortrait' => 0, 'tabletLandscape' => 0, 'mobilePortrait' => 0, 'mobileLandscape' => 0); $min = intval($slider->params->get('desktop-portrait-minimum-font-size', 4)); $minimumFontSize = array('desktopPortrait' => $min, 'desktopLandscape' => $min, 'tabletPortrait' => $min, 'tabletLandscape' => $min, 'mobilePortrait' => $min, 'mobileLandscape' => $min); $ratioModifiers = array('unknownUnknown' => 1, 'desktopPortrait' => 1, 'desktopLandscape' => 1, 'tabletPortrait' => 1, 'tabletLandscape' => 1, 'mobilePortrait' => 1, 'mobileLandscape' => 1); $sliderWidth = intval($slider->params->get('width', 1000)); $sliderHeight = intval($slider->params->get('height', 500)); $modeSwitchWidth = array('desktopPortrait' => $sliderWidth, 'desktopLandscape' => $sliderWidth, 'tabletPortrait' => 0, 'tabletLandscape' => 0, 'mobilePortrait' => 0, 'mobileLandscape' => 0); if ($slider->params->get('desktop-landscape', 0)) { $modes['desktopLandscape'] = 1; $landscapeWidth = intval($slider->params->get('desktop-landscape-width', 1440)); $modeSwitchWidth['desktopLandscape'] = $landscapeWidth; $landscapeHeight = intval($slider->params->get('desktop-landscape-height')); if ($landscapeHeight) { $ratioModifiers['desktopLandscape'] = $landscapeHeight / ($modeSwitchWidth['desktopLandscape'] / $sliderWidth * $sliderHeight); } $minimumFontSize['desktopLandscape'] = intval($slider->params->get('desktop-landscape-minimum-font-size', 4)); } if ($slider->params->get('tablet-portrait', 0)) { $tabletWidth = intval($slider->params->get('tablet-portrait-width', 800)); } else { $tabletWidth = intval($sliderWidth * N2SmartSliderSettings::get('responsive-default-ratio-tablet-portrait', 70) / 100); } if ($tabletWidth > 0) { if ($tabletWidth >= $modeSwitchWidth['desktopPortrait']) { $tabletWidth = $modeSwitchWidth['desktopPortrait'] - 1; } if ($tabletWidth > 0) { $modes['tabletPortrait'] = 1; $modeSwitchWidth['tabletPortrait'] = $tabletWidth; $portraitHeight = intval($slider->params->get('tablet-portrait-height')); if ($portraitHeight) { $ratioModifiers['tabletPortrait'] = $portraitHeight / ($modeSwitchWidth['tabletPortrait'] / $sliderWidth * $sliderHeight); } else { $ratioModifiers['tabletPortrait'] = $ratioModifiers['desktopPortrait']; } $minimumFontSize['tabletPortrait'] = intval($slider->params->get('tablet-portrait-minimum-font-size', 4)); } } if ($slider->params->get('tablet-landscape', 0)) { $tabletWidth = intval($slider->params->get('tablet-landscape-width', 1024)); if ($tabletWidth >= $modeSwitchWidth['desktopLandscape']) { $tabletWidth = $modeSwitchWidth['desktopLandscape'] - 1; } if ($tabletWidth > 0) { $modes['tabletLandscape'] = 1; $modeSwitchWidth['tabletLandscape'] = $tabletWidth; $landscapeHeight = intval($slider->params->get('tablet-landscape-height')); if ($landscapeHeight) { $ratioModifiers['tabletLandscape'] = $landscapeHeight / ($modeSwitchWidth['tabletLandscape'] / $sliderWidth * $sliderHeight); } else { $ratioModifiers['tabletLandscape'] = $ratioModifiers['desktopLandscape']; } $minimumFontSize['tabletLandscape'] = intval($slider->params->get('tablet-landscape-minimum-font-size', 4)); } } else { $this->tabletLandscapeScreenWidth = $this->tabletPortraitScreenWidth; $ratioModifiers['tabletLandscape'] = $ratioModifiers['tabletPortrait']; } if ($slider->params->get('mobile-portrait', 0)) { $mobileWidth = intval($slider->params->get('mobile-portrait-width', 440)); } else { $mobileWidth = intval($sliderWidth * N2SmartSliderSettings::get('responsive-default-ratio-mobile-portrait', 50) / 100); } if ($mobileWidth > 0) { if ($modeSwitchWidth['tabletPortrait'] > 0) { if ($mobileWidth >= $modeSwitchWidth['tabletPortrait']) { $mobileWidth = $modeSwitchWidth['tabletPortrait'] - 1; } } else { if ($mobileWidth >= $modeSwitchWidth['desktopPortrait']) { $mobileWidth = $modeSwitchWidth['desktopPortrait'] - 1; } } if ($mobileWidth > 0) { $modes['mobilePortrait'] = 1; $modeSwitchWidth['mobilePortrait'] = $mobileWidth; $portraitHeight = intval($slider->params->get('mobile-portrait-height')); if ($portraitHeight) { $ratioModifiers['mobilePortrait'] = $portraitHeight / ($modeSwitchWidth['mobilePortrait'] / $sliderWidth * $sliderHeight); } else { $ratioModifiers['mobilePortrait'] = $ratioModifiers['tabletPortrait']; } $minimumFontSize['mobilePortrait'] = intval($slider->params->get('mobile-portrait-minimum-font-size', 4)); } } if ($slider->params->get('mobile-landscape', 0)) { $mobileWidth = intval($slider->params->get('mobile-landscape-width', 740)); if ($modeSwitchWidth['tabletLandscape'] > 0) { if ($mobileWidth >= $modeSwitchWidth['tabletLandscape']) { $mobileWidth = $modeSwitchWidth['tabletLandscape'] - 1; } } else { if ($mobileWidth >= $modeSwitchWidth['desktopLandscape']) { $mobileWidth = $modeSwitchWidth['desktopLandscape'] - 1; } } if ($mobileWidth > 0) { $modes['mobileLandscape'] = 1; $modeSwitchWidth['mobileLandscape'] = $mobileWidth; $landscapeHeight = intval($slider->params->get('mobile-landscape-height')); if ($landscapeHeight) { $ratioModifiers['mobileLandscape'] = $landscapeHeight / ($modeSwitchWidth['mobileLandscape'] / $sliderWidth * $sliderHeight); } else { $ratioModifiers['mobileLandscape'] = $ratioModifiers['tabletLandscape']; } $minimumFontSize['mobileLandscape'] = intval($slider->params->get('mobile-landscape-minimum-font-size', 4)); } } else { $this->mobileLandscapeScreenWidth = $this->mobilePortraitScreenWidth; $ratioModifiers['mobileLandscape'] = $ratioModifiers['mobilePortrait']; } $this->modes = $modes; $this->sliderWidthToDevice = $modeSwitchWidth; $this->sliderRatioToDevice = array('Portrait' => array('tablet' => $modeSwitchWidth['tabletPortrait'] / $modeSwitchWidth['desktopPortrait'], 'mobile' => $modeSwitchWidth['mobilePortrait'] / $modeSwitchWidth['desktopPortrait']), 'Landscape' => array('tablet' => $modeSwitchWidth['tabletLandscape'] / $modeSwitchWidth['desktopPortrait'], 'mobile' => $modeSwitchWidth['mobileLandscape'] / $modeSwitchWidth['desktopPortrait'])); $this->minimumFontSizes = $minimumFontSize; $this->verticalRatioModifiers = $ratioModifiers; }
<div class="n2-sidebar-inner"> <?php N2Loader::import('libraries.browse.browse'); $app = N2Base::getApplication('smartslider'); $accessEdit = N2Acl::canDo('smartslider_edit', $app->info); $accessDelete = N2Acl::canDo('smartslider_delete', $app->info); $sliderid = N2Request::getInt('sliderid', 0); $generatorId = N2Request::getInt('generator_id', 0); $controller = N2Request::getCmd('nextendcontroller'); $slidersModel = new N2SmartsliderSlidersModel(); $showSlideManager = false; $dl = array(); if (!$sliderid) { $orderBy = N2SmartSliderSettings::get('slidersOrder', 'time'); $orderByDirection = N2SmartSliderSettings::get('slidersOrderDirection', 'DESC'); $actions = N2Html::tag('a', array("class" => 'n2-button n2-button-grey n2-button-medium' . ($orderBy == 'title' ? ' n2-active' : ''), "href" => $this->appType->router->createUrl(array('sliders/orderby', array('title' => $orderBy == 'title' ? $orderByDirection == 'ASC' ? 'DESC' : 'ASC' : 'ASC') + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-16' . ($orderBy == 'title' ? $orderByDirection == 'ASC' ? ' n2-i-sortalphabetic1' : ' n2-i-sortalphabetic2' : ' n2-i-sortalphabetic1')), '')); $actions .= N2Html::tag('a', array("class" => 'n2-button n2-button-grey n2-button-medium' . ($orderBy == 'time' ? ' n2-active' : ''), "href" => $this->appType->router->createUrl(array('sliders/orderby', array('time' => $orderBy == 'time' ? $orderByDirection == 'ASC' ? 'DESC' : 'ASC' : 'DESC') + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-16' . ($orderBy == 'time' ? $orderByDirection == 'ASC' ? ' n2-i-sortdate1' : ' n2-i-sortdate2' : ' n2-i-sortdate2')), '')); $dl[] = array('title' => '<span>' . n2_('SLIDER LIST') . '</span>', 'class' => 'n2-ss-slider-ordering n2-ss-slide2-list', 'tooltip' => null, 'actions' => $actions); $sliders = $slidersModel->getAll($orderBy, $orderByDirection); } else { // Show only one sliders's sidebar in this context $sliders = array($slidersModel->get($sliderid)); } if ($sliders) { foreach ($sliders as $slider) { $active = $sliderid == $slider['id']; $preUl = ''; if ($active) { $showSlideManager = true; ob_start(); $this->widget->init("buttonmenu", array("content" => N2Html::tag('div', array('class' => 'n2-button-menu'), N2Html::tag('div', array('class' => 'n2-button-menu-inner n2-border-radius'), N2Html::link(n2_('Add images'), '#', array('class' => 'n2-add-quick-image n2-h4')) . N2Html::link(n2_('Add video'), '#', array('class' => 'n2-add-quick-video n2-h4' . (N2Platform::$hasPosts ? '' : ' n2-separator'))) . (N2Platform::$hasPosts ? N2Html::link(n2_('Add post'), '#', array('class' => 'n2-add-quick-post n2-h4')) : '') . N2Html::link(n2_('Create empty slide'), $app->router->createUrl(array("slides/create", array("sliderid" => N2Request::getInt('sliderid'), "static" => 0))), array('class' => 'n2-h4 n2-separator')) . N2Html::link(n2_('Create static slide'), $app->router->createUrl(array("slides/create", array("sliderid" => N2Request::getInt('sliderid'), "static" => 1))), array('class' => 'n2-h4')) . N2Html::link(n2_('Create dynamic slides'), $app->router->createUrl(array("generator/create", array("sliderid" => N2Request::getInt('sliderid')))), array('class' => 'n2-h4'))))));
public function __construct($slider) { $this->slider = $slider; list($this->from, $this->to) = (array) N2Parse::parse(N2SmartSliderSettings::get('translate-url', '||')); }
<div id="n2-ss-slider-zoom"></div> <div class="n2-expert" id="n2-ss-lock"> <i class="n2-i n2-i-unlock"></i> </div> </div> </div> <div class="n2-td" id="n2-ss-devices"> <div class="n2-controls-panel n2-table n2-table-auto"> <div class="n2-tr"> </div> </div> </div> </div> </div> </div> </div> <?php $sliderManager = $this->appType->app->get('sliderManager'); $slider = $sliderManager->getSlider(); echo N2Html::tag('div', array('id' => 'smartslider-adjust-height', 'style' => 'overflow: auto; margin: 5px; padding: 5px'), N2Html::tag('div', array(), $sliderManager->render())); N2Localization::addJS(array('Add', 'Clear', 'in', 'loop', 'out')); $options = array('slideAsFile' => intval(N2SmartSliderSettings::get('slide-as-file', 0))); echo N2Html::script("\n nextend.ready(function(\$){\n var cb = function(){\n nextend.smartSlider.slideBackgroundMode = '" . $slider->params->get('backgroundMode', 'fill') . "';\n nextend.smartSlider.startEditor('" . $slider->elementId . "', 'slideslide', " . (defined('N2_IMAGE_UPLOAD_DISABLE') ? 1 : 0) . ", '" . N2Base::getApplication('system')->router->createAjaxUrl(array('browse/upload')) . "', 'slider" . $slider->sliderId . "', " . json_encode($options) . ");\n };\n if(typeof nextend.fontsDeferred !== 'undefined'){\n nextend.fontsDeferred.done(cb);\n }else {\n cb();\n }\n });\n "); ?> </div> <?php ?> <div style="height: 600px;"></div>