function nextend_smart_slider2()
 {
     nextendimportsmartslider2('nextend.smartslider.admin.controller');
     $controller = new NextendSmartsliderAdminController('com_smartslider2');
     $controller->initBase();
     $controller->run();
 }
Exemplo n.º 2
0
 function fetchElement()
 {
     global $smartslidercontroller, $ss2sliderafterform;
     $this->_value = htmlspecialchars($this->_form->get($this->_name, $this->_default), ENT_QUOTES);
     $this->_form->set($this->_name, $this->_value);
     $html = '<div style="display:none;">' . parent::fetchElement() . '</div>';
     $slider = null;
     $params = new NextendData();
     if (nextendIsJoomla()) {
         nextendimportsmartslider2('nextend.smartslider.joomla.slider');
         $module = new stdClass();
         $module->id = 0;
         $params->loadArray(array('slider' => intval($_GET['sliderid'])));
         $slider = new NextendSliderJoomla($module, $params, dirname(__FILE__), true);
     } else {
         if (nextendIsWordpress()) {
             nextendimportsmartslider2('nextend.smartslider.wordpress.slider');
             $slider = new NextendSliderWordpress(intval($_GET['sliderid']), $params, dirname(__FILE__), true);
         } else {
             if (nextendIsMagento()) {
                 nextendimportsmartslider2('nextend.smartslider.magento.slider');
                 $slider = new NextendSliderMagento(intval($_GET['sliderid']), $params, dirname(__FILE__), true);
             }
         }
     }
     ob_start();
     echo "<div id='smartslider-adjust-height' style='overflow:auto; margin: 5px; padding: 5px;'>";
     $slider->render();
     echo "</div>";
     echo "<div id='smart-slider-layer-dummy' class='smart-slider-layer'></div>";
     echo '<div class="smartslider-slide-advanced-layers" style="min-width: 1600px;"></div>';
     $ss2sliderafterform = ob_get_clean();
     $css = NextendCss::getInstance();
     $css->addCssLibraryFile('jqueryui/jquery.ui.resizable.css');
     $css->addCssFile(NEXTEND_SMART_SLIDER2_ASSETS . 'admin/css/layer.css');
     $js = NextendJavascript::getInstance();
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.core.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.widget.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.mouse.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.resizable.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.draggable.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.sortable.min.js');
     $js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.droppable.min.js');
     $js->addLibraryJsFile('jquery', NEXTENDLIBRARYASSETS . 'js' . DIRECTORY_SEPARATOR . 'base64.js');
     $js->addLibraryJsFile('jquery', NEXTENDLIBRARYASSETS . 'js' . DIRECTORY_SEPARATOR . 'sortable.js');
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'console.js');
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.js');
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.layer.js');
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.item.js');
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.layout.js');
     $js->addLibraryJs('jquery', "\r\n            njQuery(document).ready(function(){\r\n                var el = \$('#smartslider-adjust-height');\r\n                el.height(el[0].scrollHeight+10);\r\n                \$(window).trigger('resize');\r\n            });\r\n            ndojo.addOnLoad(function(){\r\n                SmartSliderAdminSlide('" . $slider->getId() . "','" . $slider->_activeSlide . "','" . $this->_id . "', '" . $smartslidercontroller->route('controller=layouts&action=create') . "');\r\n            });\r\n        ");
     if (NextendSmartSliderSettings::get('slideeditoralert', 1)) {
         $js->addLibraryJs('jquery', "\r\n                njQuery(window).on('beforeunload', function() {\r\n                    if (njQuery.now()-window.nextendtime > 60000 && !window.nextendsave) { // 1 min\r\n                        return '" . NextendText::_('Your_slide_settings_has_not_been_submitted_yet') . "';\r\n                    } else {\r\n                        return;\r\n                    }\r\n                });\r\n            ");
     }
     return $html;
 }
Exemplo n.º 3
0
 function fetchElement()
 {
     if (isset($_REQUEST['get'])) {
         $get = json_decode(get_magic_quotes_gpc() || nextendIsWordPress() ? stripslashes($_REQUEST['get']) : $_REQUEST['get'], true);
         if (isset($get['sliderid'])) {
             nextendimportsmartslider2('nextend.smartslider.settings');
             NextendSmartSliderFontSettings::initAdminFonts(intval($get['sliderid']));
         }
     }
     $this->_xml->addChild('option', 'None')->addAttribute('value', '');
     if (isset($GLOBALS['nextendfontmatrix']) && count($GLOBALS['nextendfontmatrix'])) {
         foreach ($GLOBALS['nextendfontmatrix'] as $k => $v) {
             $this->_xml->addChild('option', $v)->addAttribute('value', $k);
         }
     }
     return parent::fetchElement();
 }
Exemplo n.º 4
0
function smart_slider2_shortcode($atts)
{
    extract(shortcode_atts(array('id' => md5(time()), 'slider' => 0, 'tablet' => -1, 'phone' => -1), $atts));
    $loadCheck = false;
    if ($tablet >= 0 || $phone >= 0) {
        $loadCheck = true;
    }
    if ($loadCheck) {
        nextendimport('nextend.externals.mobiledetect');
        $detect = new Mobile_Detect();
        $istablet = $detect->isTablet();
        $ismobile = !$istablet && $detect->isMobile();
        if ($istablet) {
            if ($tablet == 0) {
                return '';
            }
            if ($tablet > 0) {
                $slider = intval($tablet);
            }
        }
        if ($ismobile) {
            if ($phone == 0) {
                return '';
            }
            if ($phone > 0) {
                $slider = intval($phone);
            }
        }
    }
    if ($slider == 0) {
        return '';
    }
    $params = array();
    nextendimportsmartslider2('nextend.smartslider.slidercache');
    nextendimportsmartslider2('nextend.smartslider.wordpress.slider');
    ob_start();
    new NextendSliderCache(new NextendSliderWordpress(intval($slider), $params, dirname(__FILE__)));
    return ob_get_clean();
}
Exemplo n.º 5
0
 function createAction()
 {
     if ($this->canDo('layout.create')) {
         if (NextendRequest::getInt('save')) {
             $layoutsModel = $this->getModel('layouts');
             if ($layoutid = $layoutsModel->create(NextendRequest::getVar('layout'))) {
                 if (NextendRequest::getVar('ajax')) {
                     nextendimport('nextend.parse.parse');
                     nextendimportsmartslider2('nextend.smartslider.items');
                     $items = new NextendSliderItems('nextend-smart-slider-0', true);
                     NextendSliderItems::$i['nextend-smart-slider-0'] = time();
                     $layout = $layoutsModel->getLayout($layoutid);
                     echo $items->render($layout['slide']);
                     exit;
                 }
                 header('LOCATION: ' . $this->route('controller=layouts&view=sliders_layouts&action=edit&layoutid=' . $layoutid));
                 exit;
             }
         }
         $this->display('edit', 'create');
     } else {
         $this->noaccess();
     }
 }
Exemplo n.º 6
0
<?php

nextendimportsmartslider2('nextend.smartslider.generator_abstract');
class NextendGeneratorFlickr_Peoplephotostream extends NextendGeneratorAbstract
{
    var $extraFields;
    function NextendGeneratorFlickr_Peoplephotostream($data)
    {
        parent::__construct($data);
        $this->_variables = array('title' => NextendText::_('Title_of_the_photo'), 'image' => NextendText::_('Image'), 'thumbnail' => NextendText::_('Thumbnail'), 'description' => NextendText::_('Description_of_the_photo'), 'url' => NextendText::_('Photos_url_of_the_photo_s_owner'), 'url_label' => NextendText::_('Label'), 'author_name' => NextendText::_('Real_name_of_the_photo_s_owner'), 'author_url' => NextendText::_('Profile_url_of_the_photo_s_owner'));
    }
    function getData($number)
    {
        $data = array();
        $api = getNextendFlickr();
        if (!$api) {
            return $data;
        }
        $peoplephotostreamprivacy = intval($this->_data->get('peoplephotostreamprivacy', 1));
        $result = $api->people_getPhotos('me', array('per_page' => $number, 'privacy_filter' => $peoplephotostreamprivacy, 'extras' => 'description, date_upload, date_taken, owner_name, geo, tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_q, url_m, url_n, url_z, url_c, url_l, url_o'));
        $people = array();
        foreach ($result['photos']['photo'] as $photo) {
            if (!isset($people[$photo['owner']])) {
                $people[$photo['owner']] = $api->people_getInfo($photo['owner']);
            }
            $ow = $people[$photo['owner']];
            $photo['owner_username'] = $ow['username'];
            $photo['owner_realname'] = isset($ow['realname']) ? $ow['realname'] : $ow['username'];
            $photo['owner_photosurl'] = $ow['photosurl'];
            $photo['owner_profileurl'] = $ow['profileurl'];
            $photo['image'] = isset($photo['url_o']) ? $photo['url_o'] : $photo['url_l'];
Exemplo n.º 7
0
<?php

nextendimportsmartslider2('nextend.smartslider.settings');
class plgNextendSliderGeneratorFlickr extends NextendPluginBase
{
    public static $_group = 'flickr';
    function onNextendSliderGeneratorList(&$group, &$list, $showall = false)
    {
        $group[self::$_group] = 'Flickr';
        if (!isset($list[self::$_group])) {
            $list[self::$_group] = array();
        }
        $configured = is_string(NextendSmartSliderStorage::get(self::$_group));
        $list[self::$_group][self::$_group . '_peoplephotostream'] = array(NextendText::_('My_photostream'), $this->getPath() . 'peoplephotostream' . DIRECTORY_SEPARATOR, $configured, true, true, 'image_extended');
        $list[self::$_group][self::$_group . '_peoplephotoset'] = array(NextendText::_('My_photoset'), $this->getPath() . 'peoplephotoset' . DIRECTORY_SEPARATOR, $configured, true, true, 'image_extended');
        $list[self::$_group][self::$_group . '_peoplephotogallery'] = array(NextendText::_('My_gallery'), $this->getPath() . 'peoplephotogallery' . DIRECTORY_SEPARATOR, $configured, true, true, 'image_extended');
    }
    function onNextendFlickr(&$flickr)
    {
        $config = new NextendData();
        $config->loadJson(NextendSmartSliderStorage::get(self::$_group));
        require_once dirname(__FILE__) . "/api/phpFlickr.php";
        $flickr = new phpFlickr($config->get('apikey', ''), $config->get('apisecret', ''));
        $flickr->setToken($config->get('token', ''));
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR;
    }
    function onNextendGeneratorConfigurationList(&$list)
    {
Exemplo n.º 8
0
<?php

nextendimportsmartslider2('nextend.smartslider.storage');
class NextendSmartSliderSettings
{
    static $settings = null;
    static function getAll()
    {
        if (self::$settings === null) {
            self::$settings = json_decode(NextendSmartSliderStorage::get('settings'), true);
            if (self::$settings === null) {
                self::$settings = array();
            }
        }
        return self::$settings;
    }
    static function get($key, $default = null)
    {
        if (self::$settings === null) {
            self::getAll();
        }
        if (!array_key_exists($key, self::$settings)) {
            return $default;
        }
        return self::$settings[$key];
    }
}
class NextendSmartSliderLayoutSettings
{
    static $settings = null;
    static function getAll()
Exemplo n.º 9
0
 function NextendSliderCache($slider)
 {
     nextendimportsmartslider2('nextend.smartslider.check');
     nextendimport('nextend.css.css');
     nextendimport('nextend.javascript.javascript');
     nextendimport('nextend.fonts.google');
     $this->slider = $slider;
     $sliderid = $slider->_sliderid;
     $recache = false;
     $cached = json_decode(NextendSmartSliderStorage::get('slidercache' . $sliderid), true);
     if (nextendIsWordpress()) {
         $time = current_time('timestamp');
     } else {
         $time = time();
     }
     nextendimportsmartslider2('nextend.smartslider.admin.models.slides');
     $slidesModel = new NextendSmartsliderAdminModelSlides(null);
     $slides = $slidesModel->getSlides($sliderid, '');
     $slideexpire = null;
     foreach ($slides as $s) {
         $publish_up = strtotime($s['publish_up']);
         if ($publish_up && $publish_up > $time && ($slideexpire == null || $publish_up < $slideexpire)) {
             $slideexpire = $publish_up;
         }
         $publish_down = strtotime($s['publish_down']);
         if ($publish_down && $publish_down > $time && ($slideexpire == null || $publish_down < $slideexpire)) {
             $slideexpire = $publish_down;
         }
     }
     if (is_array($cached)) {
         if (NextendSmartSliderStorage::get('sliderchanged' . $sliderid) == 1) {
             $recache = true;
         } else {
             if (isset($cached['time']) && isset($cached['expire']) && $cached['time'] < time() - $cached['expire'] * 60 * 60) {
                 $recache = true;
             } else {
                 if (isset($cached['slideexpire']) && $cached['slideexpire'] < $time) {
                     $recache = true;
                 }
             }
         }
     } else {
         $recache = true;
     }
     if (!$recache) {
         $data = $cached['data'];
         if (isset($data['css'])) {
             if (!NextendFilesystem::fileexists(NextendFilesystem::absoluteURLToPath($data['css']))) {
                 $recache = true;
             }
         } else {
             $recache = true;
         }
         if (!isset($data['libraries']) || !isset($data['libraries']['jquery']) || !isset($data['libraries']['jquery']['jsfiles']) || count($data['libraries']['jquery']['jsfiles']) == 0) {
             $recache = true;
         }
     }
     //$recache = true;
     if ($recache) {
         $data = $this->render();
         $cached = array('time' => time(), 'data' => $data);
         if ($this->slider->_generatorParams->get('enabled', 0)) {
             $generatorcached = json_decode(NextendSmartSliderStorage::get('generator' . $sliderid), true);
             if (is_array($generatorcached)) {
                 $cached['time'] = $generatorcached['time'];
                 $cached['expire'] = $this->slider->_generatorParams->get('cachetime', '24');
             }
         }
         if ($slideexpire) {
             $cached['slideexpire'] = $slideexpire;
         }
         NextendSmartSliderStorage::set('slidercache' . $sliderid, json_encode($cached));
         NextendSmartSliderStorage::set('sliderchanged' . $sliderid, '0');
     }
     $this->cssurl = $data['css'];
     if (nextendIsWordPress()) {
         add_action('nextend_css', array($this, 'addCSS'));
     } elseif (nextendIsMagento()) {
         Nextend_SmartSlider2_Model_Observer::$sliders[] = array($this, 'addCSS');
     } else {
         $this->addCSS();
     }
     $js = NextendJavascript::getInstance();
     foreach ($data['js']['core'] as $j) {
         $js->addJsFile($j);
     }
     if (isset($data['libraries']) && count($data['libraries'])) {
         foreach ($data['libraries'] as $library => $jss) {
             $js->loadLibrary($library);
             if (!empty($jss['js'])) {
                 $js->addLibraryJs($library, $jss['js']);
             }
             if (count($jss['jsfiles'])) {
                 foreach ($jss['jsfiles'] as $j) {
                     $js->addLibraryJsFile($library, $j);
                 }
             }
         }
     }
     if (isset($data['fonts']) && count($data['fonts'])) {
         $google = NextendFontsGoogle::getInstance();
         foreach ($data['fonts'] as $k => $v) {
             $style = explode(',', $v[0]);
             $subset = explode(',', $v[1]);
             for ($i = 0; $i < count($style); $i++) {
                 $google->addFont($k, $style[$i], $subset[$i]);
             }
         }
     }
     $slider = $data['html'];
     if (nextendIsJoomla()) {
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $article = new stdClass();
             $article->text = $slider;
             $_p = array();
             $dispatcher->trigger('onContentPrepare', array('com_smartslider2', &$article, &$_p, 0));
             if (!empty($article->text)) {
                 $slider = $article->text;
             }
         }
     } elseif (nextendIsWordPress()) {
         if (!function_exists('ss2_attr_shortcode')) {
             function ss2_attr_shortcode($matches)
             {
                 return 'data-' . $matches[1] . '="' . str_replace('"', '&quot;', do_shortcode(str_replace('&quot;', '"', $matches[2]))) . '"';
             }
         }
         $slider = preg_replace_callback("/data-(click|enter|leave)=\"(.*?)\"/", "ss2_attr_shortcode", $slider);
         $slider = do_shortcode($slider);
     }
     echo $slider;
 }
Exemplo n.º 10
0
 function widget($args, $instance)
 {
     $instance = array_merge(array('id' => md5(time()), 'smartslider2' => 0, 'smartslider2tablet' => -1, 'smartslider2phone' => -1), $instance);
     $slider = intval($instance['smartslider2']);
     $tablet = intval($instance['smartslider2tablet']);
     $phone = intval($instance['smartslider2phone']);
     $loadCheck = false;
     if ($tablet >= 0 || $phone >= 0) {
         $loadCheck = true;
     }
     if ($loadCheck) {
         nextendimport('nextend.externals.mobiledetect');
         $detect = new Mobile_Detect();
         $istablet = $detect->isTablet();
         $ismobile = !$istablet && $detect->isMobile();
         if ($istablet) {
             if ($tablet == 0) {
                 return '';
             }
             if ($tablet > 0) {
                 $slider = $tablet;
             }
         }
         if ($ismobile) {
             if ($phone == 0) {
                 return '';
             }
             if ($phone > 0) {
                 $slider = $phone;
             }
         }
     }
     $title = apply_filters('widget_title', $instance['title']);
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     $params = array();
     nextendimportsmartslider2('nextend.smartslider.slidercache');
     nextendimportsmartslider2('nextend.smartslider.wordpress.slider');
     new NextendSliderCache(new NextendSliderWordpress(intval($slider), $params, dirname(__FILE__)));
     echo $args['after_widget'];
 }
Exemplo n.º 11
0
<?php

/*
# author Roland Soos
# copyright Copyright (C) Nextendweb.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-3.0.txt GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
nextendimportsmartslider2('nextend.smartslider.plugin.widget');
nextendimport('nextend.image.color');
class plgNextendSliderWidgetBulletNumbers extends plgNextendSliderWidgetAbstract
{
    var $_name = 'numbers';
    function onNextendbulletList(&$list)
    {
        $list[$this->_name] = $this->getPath();
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'numbers' . DIRECTORY_SEPARATOR;
    }
    static function render($slider, $id, $params)
    {
        $html = '';
        $bullet = $params->get('bullet', false);
        if ($bullet && $bullet != -1) {
            $displayclass = self::getDisplayClass($params->get('widgetbulletdisplay', '0|*|always|*|0|*|0'), true) . 'nextend-widget-bullet ';
            $css = NextendCss::getInstance();
            $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'numbers' . DIRECTORY_SEPARATOR . 'style.css'));
            list($colorhex, $rgbacss) = NextendColor::colorToCss($params->get('bulletbackground', '00000060'));
            list($colorhexhover, $rgbacsshover) = NextendColor::colorToCss($params->get('bulletbackgroundhover', '7670C7ff'));
Exemplo n.º 12
0
 function loadSlides()
 {
     $slides = array();
     $generateslides = NextendParse::parse($this->_generatorParams->get('generateslides', '0|*|0|*|0'));
     $createslides = intval($generateslides[1]);
     $staticslides = intval($generateslides[2]);
     $publishbetween = (array) NextendParse::parse($this->_generatorSlideParams->get('publishdates', '|*|'));
     if (!isset($publishbetween[1])) {
         $publishbetween[1] = '';
     }
     if (!$this->_backend && $this->_generatorParams->get('enabled', 0) && $createslides == 0 && ($publishbetween[0] == '' || strtotime($publishbetween[0]) < time()) && ($publishbetween[1] == '' || strtotime($publishbetween[1]) > time())) {
         nextendimportsmartslider2('nextend.smartslider.generator');
         $this->generator = new NextendSmartsliderGenerator($this->_generatorParams, $this->_generatorSlideParams, $this->_sliderid);
         $slides = $this->generator->generateSlides($this->_sliderid);
     } else {
         nextendimportsmartslider2('nextend.smartslider.admin.models.slides');
         $slidesModel = new NextendSmartsliderAdminModelSlides(null);
         $where = '';
         $date = '';
         if (nextendIsWordpress()) {
             $date = current_time('mysql');
         } else {
             $date = date('Y-m-d H:i:s');
         }
         if ($this->_backend) {
             $where = " AND ((published = 1 AND (publish_up = '0000-00-00 00:00:00' OR publish_up < '" . $date . "') AND (publish_down = '0000-00-00 00:00:00' OR publish_down > '" . $date . "')) OR id = " . NextendRequest::getInt('slideid') . ") ";
         } else {
             $where = " AND published = 1 AND (publish_up = '0000-00-00 00:00:00' OR publish_up < '" . $date . "') AND (publish_down = '0000-00-00 00:00:00' OR publish_down > '" . $date . "') ";
         }
         $slides = $slidesModel->getSlides($this->_sliderid, $where);
         if (!$this->_backend && $createslides && !$staticslides) {
             nextendimportsmartslider2('nextend.smartslider.generator');
             $this->generator = new NextendSmartsliderGenerator($this->_generatorParams, $this->_generatorSlideParams, $this->_sliderid);
             $source = $this->_generatorParams->get('source', '');
             if ($source) {
                 $this->generator->initDatasource($source);
                 for ($i = 0; $i < count($slides); $i++) {
                     if ($slides[$i]['generator'] > 0) {
                         $slides[$i] = $this->generator->makeSlide($slides[$i]);
                     }
                 }
             }
         }
     }
     $this->_activeSlide = 0;
     return $slides;
 }
Exemplo n.º 13
0
<h2>Generator records</h2>
<div class="smartslider-button-wrap">
    <div class="smartslider-button smartslider-back smartslider-button-grey smartslider-button-blue-active smartslider-icon-container ">
        <a class="smartslider-button-link" href="<?php 
echo $this->route('controller=sliders&view=sliders_generator&action=generatorrecords&refreshcache=1&sliderid=' . NextendRequest::getInt('sliderid'));
?>
">
            <span class="smartslider-icon smartslider-action-icon smartslider-action-icon-refresh"></span>
            Refresh cache
        </a>
    </div>
</div>
<div style="clear:both;"></div>
<?php 
nextendimportsmartslider2('nextend.smartslider.generator');
$slidersModel = $this->getModel('sliders');
$slider = $slidersModel->getSlider(NextendRequest::getInt('sliderid'));
$smartslidergenerator = (array) json_decode($slider['generator'], true);
$generatorParams = new NextendData();
$generatorParams->loadArray($smartslidergenerator);
if ($generatorParams->get('enabled')) {
    $source = $generatorParams->get('source', '');
    if ($source) {
        $generator = new NextendSmartsliderGenerator($generatorParams, array(), NextendRequest::getInt('sliderid'));
        $generator->initDatasource($source, true);
        $generatorgroup = $generatorParams->get('generatorgroup', 1);
        if (!empty($generator->_datasource)) {
            for ($i = 0, $j = 1; $i < count($generator->_datasource); $j++) {
                ?>
<h2>Slide #<?php 
Exemplo n.º 14
0
<?php

/*
# author Roland Soos
# copyright Copyright (C) Nextendweb.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-3.0.txt GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
nextendimportsmartslider2('nextend.smartslider.slider');
nextendimport('nextend.data.data');
nextendimport('nextend.parse.parse');
class NextendSliderMagento extends NextendSlider
{
    var $_data;
    var $_sliderid;
    function NextendSliderMagento($sliderid, &$params, $path, $backend = false)
    {
        parent::NextendSlider($path, $backend);
        $this->_sliderid = $sliderid;
    }
    function preRender()
    {
        $this->loadSlider($this->_sliderid);
        $this->setTypePath();
        $this->setInstance();
    }
    function setTypePath()
    {
        $type = $this->_slider->get('type', 'default');
        $class = 'plgNextendSlidertype' . $type;
        if (!class_exists($class, false)) {
Exemplo n.º 15
0
 function refreshCache($sliderid)
 {
     $slider = $this->getSlider($sliderid);
     $generatorParams = new NextendData();
     $generatorParams->loadJSON($slider['generator']);
     $generatorSlideParams = new NextendData();
     $generatorSlideParams->loadJSON($slider['slide']);
     //refresh generator
     // Set the cache expired
     $cached = json_decode(NextendSmartSliderStorage::get('generator' . $sliderid), true);
     if (is_array($cached)) {
         $cached['time'] = 0;
         NextendSmartSliderStorage::set('generator' . $sliderid, json_encode($cached));
     }
     if ($generatorParams->get('enabled', 0)) {
         nextendimportsmartslider2('nextend.smartslider.generator');
         $generator = new NextendSmartsliderGenerator($generatorParams, $generatorSlideParams, $sliderid);
         $source = $generatorParams->get('source', '');
         if ($source) {
             $generator->initDatasource($source);
         }
     }
     self::markChanged($sliderid);
 }
Exemplo n.º 16
0
                                <div><?php 
echo NextendText::_('Default_layouts');
?>
</div>
                            </div>
                            <div
                                class="smartslider-layout-custom smartslider-toolbar-options smartslider-button-grey last">
                                <div><?php 
echo NextendText::_('Custom_layouts');
?>
</div>
                            </div>
                        </div>
                        <div class="smartslider-slide-layout-pane-inner nextend-clearfix">
                            <?php 
nextendimportsmartslider2('nextend.smartslider.items');
$items = new NextendSliderItems('nextend-smart-slider-0', $this, true);
$layoutsModel = $this->getModel('layouts');
?>
                            <div class="smartslider-slide-layout-default">
                                <?php 
$layouts = $layoutsModel->getCoreLayouts();
?>
                                <?php 
foreach ($layouts as $layout) {
    ?>
                                    <div class="smartslider-core-layout <?php 
    echo $layout['class'];
    ?>
">
                                        <a class="smartslider-load-layout" href="#"></a>
Exemplo n.º 17
0
<?php

nextendimportsmartslider2('nextend.smartslider.settings');
nextendimportsmartslider2('nextend.smartslider.check');
class plgNextendSliderGeneratorFacebook extends NextendPluginBase
{
    public static $_group = 'facebook';
    function onNextendSliderGeneratorList(&$group, &$list, $showall = false)
    {
        if ($showall || smartsliderIsFull()) {
            $group[self::$_group] = 'Facebook';
            if (!isset($list[self::$_group])) {
                $list[self::$_group] = array();
            }
            $configured = is_string(NextendSmartSliderStorage::get(self::$_group));
            $list[self::$_group][self::$_group . '_postsbypage'] = array(NextendText::_('Posts_by_page'), $this->getPath() . 'postsbypage' . DIRECTORY_SEPARATOR, $configured, true, true);
            $list[self::$_group][self::$_group . '_albumbypage'] = array(NextendText::_('Photos_by_page_album'), $this->getPath() . 'albumbypage' . DIRECTORY_SEPARATOR, $configured, true, true);
            $list[self::$_group][self::$_group . '_albumbyuser'] = array(NextendText::_('Photos_by_user_album'), $this->getPath() . 'albumbyuser' . DIRECTORY_SEPARATOR, $configured, true, true);
        }
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR;
    }
}
NextendPlugin::addPlugin('nextendslidergenerator', 'plgNextendSliderGeneratorFacebook');
Exemplo n.º 18
0
<?php

$this->loadFragment('headerstart');
$sliderid = NextendRequest::getInt('sliderid');
if (nextendIsJoomla()) {
    nextendimportsmartslider2('nextend.smartslider.joomla.slider');
    $slider = new NextendSliderJoomla($sliderid, $sliderid, dirname(__FILE__));
} else {
    if (nextendIsWordpress()) {
        nextendimportsmartslider2('nextend.smartslider.wordpress.slider');
        $d = array();
        $slider = new NextendSliderWordpress($sliderid, $d, dirname(__FILE__));
    } else {
        if (nextendIsMagento()) {
            nextendimportsmartslider2('nextend.smartslider.magento.slider');
            $d = array();
            $slider = new NextendSliderMagento($sliderid, $d, dirname(__FILE__));
        }
    }
}
$slidersModel = new NextendSmartsliderAdminModelSliders(null);
$fakeslider = $slidersModel->getSlider($sliderid);
global $layout, $sliderpreset;
$sliderParams = new NextendData();
$sliderParams->loadJSON($fakeslider['params']);
$sliders = array();
NextendPlugin::callPlugin('nextendslidergeneratorlayouts', 'onNextendSliderGeneratorSlider', array(&$sliders, $sliderParams->get('size', null)));
$sliderpreset = NextendRequest::getVar('sliderpreset', '');
if (isset($sliders[$sliderpreset])) {
    $fakeslider = $sliders[$sliderpreset]['slider'] + $fakeslider;
}
Exemplo n.º 19
0
<?php

nextendimportsmartslider2('nextend.smartslider.plugin.slideritem');
class plgNextendSliderItemFlipper extends plgNextendSliderItemAbstract
{
    static $cssAdded = array();
    var $_identifier = 'flipper';
    var $_title = 'Flipper';
    function getTemplate()
    {
        return '
        <div style="line-height:0; width:{width}; {css}" class="nextend-smartslider-flip-container {flipclass}">
          <a href="{url}" target="{target}" style="background: none !important;display: block;">
            <div class="nextend-smartslider-flip">
                <img alt="{alt_esc}" src="{imagefront}" style="width: 100%;" class="nextend-smartslider-flip-front-img" > 
                <img alt="{alt_esc}" src="{imageback}" style="width: 100%;" class="nextend-smartslider-flip-back-img" >
            </div>
          </a>
        
          <style>
          ' . $this->getCss('{{id}}') . '
          </style>
        </div>';
    }
    function _render($data, $id, $sliderid, $items)
    {
        $link = (array) NextendParse::parse($data->get('link', ''));
        if (!isset($link[1])) {
            $link[1] = '';
        }
        $attr = '';
Exemplo n.º 20
0
<?php

/*
# author Roland Soos
# copyright Copyright (C) Nextendweb.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-3.0.txt GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
nextendimportsmartslider2('nextend.smartslider.admin.models.base');
class NextendSmartsliderAdminModelSettings extends NextendSmartsliderAdminModelBase
{
    function form($xml)
    {
        $data = array();
        switch ($xml) {
            case 'layout':
                $data = NextendSmartSliderLayoutSettings::getAll();
                break;
            case 'font':
                $data = NextendSmartSliderFontSettings::getAll(NextendRequest::getInt('sliderid'));
                break;
            case 'joomla':
                $data = NextendSmartSliderJoomlaSettings::getAll();
                break;
            default:
                $data = NextendSmartSliderSettings::getAll();
                break;
        }
        $this->render(dirname(__FILE__) . '/forms/settings/' . $xml . '.xml', $data);
    }
    function render($xmlpath, $data)