public function assetsBackend() { static $once; if ($once != null) { return; } $once = true; $path = $this->getAssetsPath(); N2CSS::addInline('.n2-expert {display: none !important;'); N2CSS::addFile($path . "/admin/css/smartslider.css", 'smartslider-backend'); foreach (glob($path . "/admin/js/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } if (!N2Base::getApplication('smartslider')->storage->get('free', 'rated')) { N2JS::addFile($path . "/admin/js/free/gopro.js", 'smartslider-free'); } foreach (glob($path . "/admin/js/element/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } N2Localization::addJS(array('Insert', 'Insert variable', 'Choose the group', 'Choose the variable', 'Result', 'Filter', 'No', 'Clean HTML', 'Remove HTML', 'Split', 'Chars', 'Words', 'Start', 'Length', 'Find image', 'Index', 'Find link', 'Index')); foreach (glob($path . "/admin/js/generator/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } foreach (glob($path . "/admin/js/item/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } foreach (glob($path . "/admin/js/item/parser/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } foreach (glob($path . "/admin/js/layer/*.js") as $file) { N2JS::addFile($file, 'smartslider-backend'); } N2Form::$documentation = 'http://doc.smartslider3.com/'; }
public static function show() { N2Localization::addJS(array('Show only errors', 'There are no messages to display.', 'Got it!', 'error', 'success', 'notice')); self::loadSessionError(); if (is_array(self::$error) && count(self::$error)) { foreach (self::$error as $error) { N2JS::addInline("nextend.notificationCenter.error(" . json_encode($error[0]) . ", " . json_encode($error[1]) . ");"); } self::$error = array(); } self::loadSessionSuccess(); if (is_array(self::$success) && count(self::$success)) { foreach (self::$success as $success) { N2JS::addInline("nextend.notificationCenter.success(" . json_encode($success[0]) . ", " . json_encode($success[1]) . ");"); } self::$success = array(); } self::loadSessionNotice(); if (is_array(self::$notice) && count(self::$notice)) { foreach (self::$notice as $notice) { N2JS::addInline("nextend.notificationCenter.notice(" . json_encode($notice[0]) . ", " . json_encode($notice[1]) . ");"); } self::$notice = array(); } self::$flushed = true; }
public function initialize() { $this->app = N2Base::getApplication('system'); parent::initialize(); N2Loader::import(array('models.visual'), 'system'); $this->loadModel(); N2Localization::addJS(array('visual', 'visuals', 'Static', 'Empty', 'Save as new', 'Overwrite current', '%s changed - %s', 'Save as', 'Sets', 'Add new', '%s sets', 'Create set', 'Add', 'Name', 'Please fill the name field!', 'Set added', 'Rename set', 'Rename', 'Delete', 'Set renamed', 'Delete set', 'Cancel', 'Yes', 'Do you really want to delete the set and all associated %s?', 'Unable to delete the set')); }
public function initialize() { parent::initialize(); N2JS::addFirstCode('window.ss2lang = {};'); N2Loader::import(array('models.GroupStorage', 'models.License', 'models.Update'), 'smartslider'); N2JS::addInline("new NextendSmartSliderCreateSlider('" . $this->appType->router->createUrl(array('slider/create')) . "');"); N2Localization::addJS(array('Create Slider', 'Slider name', 'Slider', 'Width', 'Height', 'Create', 'Preset', 'Default', 'Full width', 'Full page', 'Block', 'Thumbnail - horizontal', 'Thumbnail - vertical', 'Caption', 'Horizontal accordion', 'Vertical accordion', 'Showcase', 'Saved slide')); }
static function load_plugin_textdomain($path, $domain = 'nextend') { $locale = N2Localization::getLocale(); $mofile = $locale . '.mo'; if ($loaded = N2Localization::load_textdomain($domain, $path . '/languages/' . $mofile)) { return $loaded; } }
function fetchElement() { N2Localization::addJS('Done'); if (N2XmlHelper::getAttribute($this->_xml, 'fixed')) { $this->fixedMode = true; } $html = parent::fetchElement(); N2JS::addInline('new NextendElementSkin("' . $this->_id . '", "' . str_replace($this->_name, '', $this->_id) . '", ' . json_encode($this->skins) . ', ' . json_encode($this->fixedMode) . ');'); return $html; }
private static function form($force = false) { static $once; if ($once != null && !$force) { return; } $once = true; N2JS::addFiles(N2LIBRARYASSETS . "/js", array('form.js', 'element.js'), 'nextend-backend'); N2Localization::addJS('The changes you made will be lost if you navigate away from this page.'); N2JS::addFiles(N2LIBRARYASSETS . "/js/element", array('text.js'), 'nextend-backend'); foreach (glob(N2LIBRARYASSETS . "/js/element/*.js") as $file) { N2JS::addFile($file, 'nextend-backend'); } }
public function getOutput() { $output = ""; $globalInline = $this->getGlobalInlineScripts(); if (!empty($globalInline)) { $output .= N2Html::script($globalInline . "\n"); } foreach ($this->urls as $url) { $output .= N2Html::script($url, true) . "\n"; } if (!N2Platform::$isAdmin && N2Settings::get('async', '0')) { $jsCombined = new N2CacheCombine('js', N2Settings::get('minify-js', '0') ? 'N2MinifierJS::minify' : false); foreach ($this->getFiles() as $file) { if (basename($file) == 'n2.js') { $output .= N2Html::script(N2Uri::pathToUri($file) . '?' . filemtime($file), true) . "\n"; } else { $jsCombined->add($file); } } $combinedFile = $jsCombined->make(); $scripts = 'nextend.loadScript("' . N2Uri::pathToUri($combinedFile) . '?' . filemtime($combinedFile) . '");'; $output .= N2Html::script($scripts . "\n"); } else { if (!N2Platform::$isAdmin && N2Settings::get('combine-js', '0')) { $jsCombined = new N2CacheCombine('js', N2Settings::get('minify-js', '0') ? 'N2MinifierJS::minify' : false); foreach ($this->getFiles() as $file) { $jsCombined->add($file); } $combinedFile = $jsCombined->make(); $output .= N2Html::script(N2Uri::pathToUri($combinedFile) . '?' . filemtime($combinedFile), true) . "\n"; } else { foreach ($this->getFiles() as $file) { $output .= N2Html::script(N2Uri::pathToUri($file) . '?' . filemtime($file), true) . "\n"; } } } $output .= N2Html::script(N2Localization::toJS() . "\n" . $this->getInlineScripts() . "\n"); return $output; }
<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(); $slider->setStatic($slideData->get('static-slide', 0)); 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')); echo N2Html::script("\n nextend.ready(function(\$){\n var cb = function(){\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 . "');\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>
public function initialize() { parent::initialize(); N2Loader::import(array('models.Sliders', 'models.generator', 'models.Layouts', 'models.Layers', 'models.Item', 'models.Slides'), 'smartslider'); N2Localization::addJS(array('In animation', 'Loop animation', 'Out animation')); }
public function loadLocale() { static $loaded; if ($loaded == null) { N2Localization::load_plugin_textdomain($this->getPath()); $loaded = true; } }
public function __construct($appType, $defaultParams) { N2Localization::addJS(array('Drop files anywhere to upload or', 'Select files')); parent::__construct($appType, $defaultParams); }
public function initialize() { parent::initialize(); N2Localization::addJS(array('Load layout', 'Load whole slide', 'Load only layers')); }
public function __construct($appType, $defaultParams) { $this->logoText = n2_('Animation'); N2Localization::addJS(array('animation', 'animations')); parent::__construct($appType, $defaultParams); }
function fetchElement() { N2Localization::addJS(array('Disabled', 'Multiple animations', 'Single animation')); N2JS::addInline('new NextendElementAnimationManager("' . $this->_id . '", "backgroundanimationManager");'); return N2Html::tag('div', array('class' => 'n2-form-element-option-chooser n2-border-radius'), parent::fetchElement() . N2Html::tag('input', array('type' => 'text', 'class' => 'n2-h5', 'style' => 'width: 130px;' . N2XmlHelper::getAttribute($this->_xml, 'css'), 'disabled' => 'disabled'), false) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-clear'), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-empty n2-i-grey-opacity'), '')) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-button n2-h5 n2-uc'), n2_('Animations'))); }
public function __construct($appType, $defaultParams) { $this->logoText = n2_('Style manager'); N2Localization::addJS(array('style', 'styles')); parent::__construct($appType, $defaultParams); }
<div id="n2-ss-slides" class="<?php if (count($slides)) { echo "n2-ss-has-slides"; } ?> "> <div class="n2-ss-slides-container"> <?php $parameters = array(); if (N2Platform::$isWordpress) { $parameters['nonce'] = wp_create_nonce('internal-linking'); $parameters['wpAjaxUrl'] = admin_url('admin-ajax.php'); } N2JS::addInline('new NextendSmartSliderAdminSidebarSlides("' . $this->appType->router->createAjaxUrl(array("slides/index", array("sliderid" => $slider['id']))) . '","' . N2Base::getApplication('system')->getApplicationType('backend')->router->createUrl("content/search") . '", ' . json_encode($parameters) . ', ' . (defined('N2_IMAGE_UPLOAD_DISABLE') ? 1 : 0) . ", '" . N2Base::getApplication('system')->router->createAjaxUrl(array('browse/upload')) . "', 'slider" . $slider['id'] . "');"); N2Localization::addJS(array('Add video', 'Video url', 'Examples', 'Add post', 'Keyword', 'No search term specified. Showing recent items.', 'Showing items match for "%s"', 'Select')); $slidesObj = array(); foreach ($slides as $i => $slide) { $slidesObj[$i] = new N2SmartSliderSlide($sliderObj, $slide); $slidesObj[$i]->initGenerator(); } foreach ($slidesObj as $slideObj) { $slideObj->fillSample(); echo N2SmartsliderSlidesModel::box($slideObj, $sliderObj, $this->widget, $this->appType); } ?> <a class="n2-box n2-box-slide-add n2-h3 n2-uc" href="#"><?php printf(n2_('SLIDE #%d'), 1); ?> </a> <a class="n2-box n2-box-slide-add n2-h3 n2-uc" href="#"><?php
public function __construct($appType, $defaultParams) { $this->logoText = n2_('Image manager'); N2Localization::addJS(array('Generate', 'Desktop image is empty!', 'image', 'images')); parent::__construct($appType, $defaultParams); }
<?php N2Loader::import('libraries.form.element.text'); N2Localization::addJS(array('Link', 'Lightbox', 'Create lightbox from image, video or iframe.', 'Content list', 'One per line', 'Autoplay duration', 'Examples', 'Image', 'Insert', 'Keyword', 'No search term specified. Showing recent items.', 'Showing items match for "%s"', 'Select')); class N2ElementUrl extends N2ElementText { function fetchElement() { $html = parent::fetchElement(); N2JS::addInline("new NextendElementUrl('" . $this->_id . "', " . self::getNextendElementUrlParameters() . " );"); return $html; } public static function getNextendElementUrlParameters() { $params = array('hasPosts' => N2Platform::$hasPosts); $params['imageUrl'] = N2Uri::pathToUri(N2LIBRARYASSETS . "/images"); $params['url'] = N2Base::getApplication('system')->getApplicationType('backend')->router->createUrl("link/search"); return json_encode(N2ElementUrlParams::extend($params)); } protected function post() { if (!N2Platform::$hasPosts && !N2PRO) { return ''; } return N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-clear'), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-empty n2-i-grey-opacity'), '')) . '<a id="' . $this->_id . '_button" class="n2-form-element-button n2-h5 n2-uc" href="#">' . n2_('Link') . '</a>'; } } N2Loader::import('libraries.form.element.url', 'platform');