public static function backend($force = false) { static $once; if ($once != null && !$force) { return; } $once = true; $family = n2_x('Montserrat', 'Default Google font family for admin'); foreach (explode(',', n2_x('latin', 'Default Google font charset for admin')) as $subset) { N2GoogleFonts::addSubset($subset); } N2GoogleFonts::addFont($family); N2CSS::addInline('.n2,html[dir="rtl"] .n2,.n2 td,.n2 th,.n2 select, .n2 textarea, .n2 input{font-family: "' . $family . '", Arial, sans-serif;}'); N2CSS::addFiles(N2LIBRARYASSETS . "/css", array('nextend-font.css', 'font.css', 'admin.css', 'form.css', 'notificationcenter.css', 'spectrum.css', 'contextMenu.css'), 'nextend-backend'); foreach (glob(N2LIBRARYASSETS . "/css/tabs/*.css") as $file) { N2CSS::addFile($file, 'nextend-backend'); } foreach (glob(N2LIBRARYASSETS . "/css/jquery/*.css") as $file) { N2CSS::addFile($file, 'nextend-backend'); } N2JS::addFiles(N2LIBRARYASSETS . "/js", array('json2.js', 'admin.js', 'color.js', 'query-string.js', 'md5.js', 'css.js', 'imagehelper.js', 'modal.js', 'notificationcenter.js', 'spectrum.js', 'expert.js'), 'nextend-backend'); N2Localization::addJS(array('Cancel', 'Delete', 'Delete and never show again', 'Are you sure you want to delete?', 'Documentation')); self::form($force); N2JS::addFiles(N2LIBRARYASSETS . "/js/core/jquery", array("fixto.js", "jstorage.js", "jquery.datetimepicker.js", "jquery.tinyscrollbar.min.js", "jquery.unique-element-id.js", "vertical-pane.js"), "nextend-backend"); wp_enqueue_script('nextend-ui', N2Uri::pathToUri(N2LIBRARYASSETS . "/js/core/jquery/ui/jquery-ui.nextend.js"), array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-autocomplete', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-resizable', 'jquery-ui-sortable', 'jquery-ui-slider'), '1.0', 1); wp_enqueue_script('nextend-ui-iframe-transport', N2Uri::pathToUri(N2LIBRARYASSETS . "/js/core/jquery/ui/jquery.iframe-transport.js"), array('jquery-ui-core', 'jquery-ui-widget'), '1.0', 1); wp_enqueue_script('nextend-ui-fileupload', N2Uri::pathToUri(N2LIBRARYASSETS . "/js/core/jquery/ui/jquery.fileupload.js"), array('jquery-ui-core', 'jquery-ui-widget'), '1.0', 1); N2JS::addFiles(N2LIBRARYASSETS . "/js/core/jquery/ui", array('jquery.contextMenu.js'), "nextend-backend"); N2Base::getApplication('system')->info->assetsBackend(); N2JS::addFirstCode("NextendAjaxHelper.addAjaxArray(" . json_encode(N2Form::tokenizeUrl()) . ");"); N2Plugin::callPlugin('fontservices', 'onFontManagerLoadBackend'); }
public static function init() { $parameters = array('siteKeywords' => self::$siteKeywords, 'imageUrls' => self::$imageUrls, 'protocolRelative' => self::$protocolRelative); $parameters['placeholderImage'] = '$system$/images/placeholder/image.png'; $parameters['placeholderRepeatedImage'] = '$system$/images/placeholder/image.png'; N2JS::addFirstCode('new NextendImageHelper(' . json_encode($parameters) . ', ' . N2ImageHelper::getLightboxFunction() . ',' . N2ImageHelper::getLightboxMultipleFunction() . ', ' . N2ImageHelper::getLightboxFoldersFunction() . ');'); }
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')); }
protected function renderType() { $params = $this->slider->params; N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("MainAnimationSimple.js", "TypeSimple.js", "ResponsiveSimple.js"), "smartslider-simple-type-frontend"); N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("BackgroundAnimation.js"), "smartslider-simple-type-frontend"); N2JS::addFiles(NEXTEND_SMARTSLIDER_ASSETS . "/js/animation", array("BackgroundAnimationAbstract.js", 'Flux.js'), "smartslider-simple-type-frontend"); $background = $params->get('background'); $css = $params->get('slider-css'); $slidecss = $params->get('slide-css'); if (!empty($background)) { $css = 'background-image: url(' . N2ImageHelper::fixed($background) . ');'; } $this->initBackgroundAnimation(); echo $this->openSliderElement(); ?> <div class="n2-ss-slider-1" style="<?php echo $css; ?> "> <?php echo $this->getBackgroundVideo($params); ?> <div class="n2-ss-slider-2"> <?php if ($this->backgroundAnimation) { ?> <div class="n2-ss-background-animation"></div> <?php } ?> <div class="n2-ss-slider-3" style="<?php echo $slidecss; ?> "> <?php echo $this->slider->staticHtml; foreach ($this->slider->slides as $i => $slide) { echo N2Html::tag('div', $slide->attributes + array('class' => 'n2-ss-slide n2-ss-canvas ' . $slide->classes, 'style' => $slide->style), $slide->background . $slide->getHTML()); } ?> </div> </div> </div> <?php $this->widgets->echoRemainder(); echo N2Html::closeTag('div'); $this->javaScriptProperties['mainanimation'] = array('type' => $params->get('animation'), 'duration' => intval($params->get('animation-duration')), 'delay' => intval($params->get('animation-delay')), 'ease' => $params->get('animation-easing'), 'parallax' => floatval($params->get('animation-parallax')), 'shiftedBackgroundAnimation' => $params->get('animation-shifted-background-animation')); $this->javaScriptProperties['mainanimation']['shiftedBackgroundAnimation'] = 0; $this->javaScriptProperties['carousel'] = intval($params->get('carousel')); $this->javaScriptProperties['dynamicHeight'] = intval($params->get('dynamic-height', '0')); $this->javaScriptProperties['dynamicHeight'] = 0; N2Plugin::callPlugin('nextendslider', 'onNextendSliderProperties', array(&$this->javaScriptProperties)); N2JS::addFirstCode("new NextendSmartSliderSimple('#{$this->slider->elementId}', " . json_encode($this->javaScriptProperties) . ");"); echo N2Html::clear(); }
public function renderGlobalConfigurationForm() { $values = N2Settings::getAll(); $form = new N2Form($this->appType); $form->loadArray($values); $form->loadXMLFile(N2Loader::getPath('models', 'system') . '/forms/globalconfig.xml'); echo N2Html::openTag("form", array("id" => "nextend-config", "method" => "post", "action" => N2Request::getRequestUri())); $form->render('global'); echo N2Html::closeTag("form"); N2JS::addFirstCode("\n new NextendForm(\n 'nextend-config',\n '" . $this->appType->router->createAjaxUrl(array('settings/index')) . "',\n " . json_encode($values) . "\n );\n "); }
public function render($xmlpath, $data) { N2Loader::import('libraries.form.form'); $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend')); $form->loadArray($data); $form->loadXMLFile($xmlpath); echo $form->render('settings'); N2JS::addFirstCode(' new NextendForm("smartslider-form", ' . json_encode($form->_data) . ', null, "' . N2Filesystem::toLinux(N2Filesystem::pathToRelativePath($xmlpath)) . '", "settings", "' . N2Uri::ajaxUri('nextend', 'smartslider') . '"); '); }
private static function editForm($data = array()) { $configurationXmlFile = dirname(__FILE__) . '/forms/slider.xml'; N2Loader::import('libraries.form.form'); $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend')); $form->set('class', 'nextend-smart-slider-admin'); $form->loadArray($data); $form->loadXMLFile($configurationXmlFile); echo $form->render('slider'); N2Loader::import('libraries.form.element.url'); N2JS::addFirstCode('nextend.NextendElementUrlParams=' . N2ElementUrl::getNextendElementUrlParameters() . ';'); return $data; }
public function loadFonts() { $familyQuery = array(); if (count($this->files)) { foreach ($this->files as $family => $styles) { if (count($styles)) { $familyQuery[] = $family . ':' . implode(',', $styles); } } } if (empty($familyQuery)) { return false; } $subsets = array_unique($this->inline); $familyQuery[count($familyQuery) - 1] .= ':' . implode(',', $subsets); N2JS::addFiles(N2LIBRARYASSETS . "/js", array('webfontloader.js'), 'nextend-webfontloader'); N2JS::addInline("\r\n nextend.fontsLoaded = false;\r\n nextend.fontsLoadedActive = function () {nextend.fontsLoaded = true;};\r\n var fontData = {\r\n google: {\r\n families: " . json_encode($familyQuery) . "\r\n },\r\n active: function(){nextend.fontsLoadedActive()},\r\n inactive: function(){nextend.fontsLoadedActive()}\r\n };\r\n if(typeof WebFont === 'undefined'){\r\n window.WebFontConfig = fontData;\r\n }else{\r\n WebFont.load(fontData);\r\n }", true); N2JS::addFirstCode("\r\n nextend.fontsDeferred = n2.Deferred();\r\n if(nextend.fontsLoaded){\r\n nextend.fontsDeferred.resolve();\r\n }else{\r\n nextend.fontsLoadedActive = function () {\r\n nextend.fontsLoaded = true;\r\n nextend.fontsDeferred.resolve();\r\n };\r\n }", true); }
<?php /** * @var $model N2SystemImageModel */ N2JS::addFirstCode("\r\n new NextendImageManager({\r\n visuals: " . json_encode(N2ImageManager::$loaded) . ",\r\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('image/index')) . "'\r\n });\r\n"); $model->renderForm();
<?php /** * @var $model N2SystemStyleModel */ $sets = $model->getSets(); N2StyleRenderer::$sets[] = $sets[0]['id']; $styles = array(); foreach (array_unique(N2StyleRenderer::$sets) as $setId) { $styles[$setId] = $model->getVisuals($setId); } N2JS::addFirstCode("\r\n new NextendStyleManager({\r\n setsIdentifier: '" . $model->type . "set',\r\n sets: " . json_encode($sets) . ",\r\n visuals: " . json_encode($styles) . ",\r\n renderer: {\r\n pre: '" . N2StyleRenderer::$pre . "',\r\n usedStyles: " . json_encode(N2StyleRenderer::$styles) . ",\r\n modes: " . json_encode(N2StyleRenderer::$mode) . "\r\n },\r\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('style/index')) . "'\r\n });\r\n"); ?> <div class="n2-form-tab "> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table n2-table-fixed"> <div class="n2-tr"> <div class="n2-td n2-h2"> <?php n2_e('Style settings'); ?> </div> <div class="n2-td n2-last n2-visual-editor-tabs"> <a href="#" class="n2-button n2-button-v n2-button-medium n2-button-grey n2-editor-clear-tab n2-h5 n2-uc" style="display: none;"><?php n2_e('Clear tab'); ?> </a> <div class="n2-form-element-radio-tab">
<?php /** * @var $model N2SystemAnimationModel */ $sets = $model->getSets(); N2AnimationRenderer::$sets[] = $sets[0]['id']; $animations = array(); foreach (array_unique(N2AnimationRenderer::$sets) as $setId) { $animations[$setId] = $model->getVisuals($setId); } N2JS::addFirstCode("\r\n new NextendAnimationManager({\r\n setsIdentifier: '" . $model->type . "set',\r\n sets: " . json_encode($sets) . ",\r\n visuals: " . json_encode($animations) . ",\r\n renderer: {\r\n modes: " . json_encode(N2AnimationRenderer::$mode) . "\r\n },\r\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('animation/index')) . "'\r\n });\r\n"); ?> <div class="n2-form-tab "> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table"> <div class="n2-tr"> <div class="n2-td n2-h2" style="white-space: nowrap"> <?php n2_e('Animation settings'); ?> </div> <div class="n2-td n2-last n2-visual-editor-tabs"> <div class="n2-form-element-radio-tab"> <div class="n2-radio-option n2-h4 n2-first n2-last n2-active"> #0 </div> <input type="hidden" autocomplete="off" value="0" name="n2-animation-editor-tabs" id="n2-animation-editor-tabs"> </div>
public static function init() { self::loadSettings(); N2JS::addFirstCode(' window.nextend.getFeatherEditor = function(){ if(typeof window.nextend.featherEditor !== "undefined"){ return $.when(window.nextend.featherEditor); } var deferred = $.Deferred(); $.getScript("https://dme0ih8comzn4.cloudfront.net/imaging/v1/editor.js").done(function(){ window.nextend.featherEditorHiRes = -1; window.nextend.featherEditor = new Aviary.Feather({ apiKey: "' . self::$config['public'] . '", encryptionMethod: "sha1", maxSize: 1920, displayImageSize: true, onLoad: function(){ deferred.resolve(); }, onReady: function(){ if(window.nextend.featherEditorHiRes == -1){ AV.controlsWidgetInstance.serverMessaging.sendMessage({ id: "avpw_auth_form", action: AV.controlsWidgetInstance.assetManager.getManifestURL(), method: "GET", dataType: "json", announcer: AV.build.asyncFeatherTargetAnnounce, origin: AV.build.asyncImgrecvBase, callback: function(response){ window.nextend.featherEditorHiRes = false; for(var i = 0; i < response.permissions.length; i++){ if(response.permissions[i] == "hires"){ window.nextend.featherEditorHiRes = true; break; } } } }); } }, onError: function(error){ if(error.code == 8){ nextend.notificationCenter.error("Aviary not set up. <a target=\\"_blank\\" href=\\"' . N2Base::getApplication('system')->router->createUrl('settings/aviary') . '\\">Click here to setup!</a>"); }else{ nextend.notificationCenter.error(error.message); } if(typeof error.args !== "undefined" && typeof error.args[1] !== "undefined"){ nextend.notificationCenter.error(error.args[1].Error); } window.nextend.featherEditor.close(); deferred.reject(); }, onSaveButtonClicked: function(){ if(window.nextend.featherEditorHiRes === true){ NextendAjaxHelper.ajax({ type: "POST", url: NextendAjaxHelper.makeAjaxUrl(window.nextend.featherEditor.ajaxUrl, { nextendaction: "getHighResolutionAuth" }), dataType: "json" }) .done(function (response) { var auth = response.data.highResolutionAuth; window.nextend.featherEditor.updateConfig({ salt: auth.salt, timestamp: auth.timestamp, signature: auth.signature }); window.nextend.featherEditor.saveHiRes(); }); return false; } } }); window.nextend.featherEditor.ajaxUrl = "' . N2Base::getApplication('system')->getApplicationType('backend')->router->createAjaxUrl(array('aviary/index')) . '"; }); return deferred; }; '); }
margin: 0; border: 0; } body, .n2-form-tab { background-color: #e9edf0; } <?php N2Platform::adminHideCSS(); ?> </style> <?php N2JS::addFirstCode("\r\n if(window.parent != window){\r\n parentDocument = window.parent.n2(window.parent.document);\r\n \$(window).on('keydown keyup keypress', function(e){\r\n if(e.keyCode == 27){\r\n parentDocument.trigger(e);\r\n }\r\n });\r\n }\r\n\r\n var container = n2('.n2-ss-container-device'),\r\n autoHeight = function(){\r\n var minHeight = n2(window).height() - container.offset().top ;\r\n container.css('height', 'auto');\r\n if(container.height() < minHeight){\r\n container.height(minHeight);\r\n }\r\n };\r\n\r\n autoHeight();\r\n n2(window).on('resize', autoHeight);\r\n n2('.n2-ss-slider').on('SliderResize', autoHeight)\r\n .data('ss').ready(autoHeight);\r\n"); ?> <div class="n2-form-tab " style="display: block;"> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table"> <div class="n2-tr"> <div class="n2-td n2-h2"> <?php echo n2_('Preview'); ?> </div> <div class="n2-td" id="n2-ss-zoom"> <div class="n2-ss-slider-zoom-container">
/** * @param array $data */ private function editForm($data = array()) { $this->simpleEditForm($data); $slidersModel = new N2SmartsliderSlidersModel(); $slider = $slidersModel->get(N2Request::getInt('sliderid', 0)); $slidersSliderXml = call_user_func(array('N2SSPluginType' . $slider['type'], "getPath")) . '/slide.xml'; if ((!isset($data['static-slide']) || $data['static-slide'] != 1) && N2Filesystem::existsFile($slidersSliderXml)) { $form = new N2Form(); $form->loadArray($data); $form->loadXMLFile($slidersSliderXml); echo $form->render('slide'); } if (isset($data['generator_id']) && $data['generator_id'] > 0) { $form = new N2Form(); $form->loadArray($data); $form->loadXMLFile(dirname(__FILE__) . '/forms/slide_generator.xml'); echo $form->render('slide'); } N2JS::addFirstCode("new NextendForm('smartslider-form','', {});"); }
public function renderForm($slider) { $values = N2SmartsliderSlidersModel::renderEditForm($slider); // Used by AJAX widget subforms N2JS::addFirstCode("\r\n new NextendForm(\r\n 'smartslider-form',\r\n '" . $this->appType->router->createAjaxUrl(array('slider/edit', array('sliderid' => $slider['id']))) . "',\r\n " . json_encode($values) . "\r\n );\r\n "); }
</div> </div> <div class="n2-td n2-manage-set"> <?php $model->renderSetsForm(); ?> <div id="layoutset-manage" class="n2-button n2-button-medium n2-button-grey n2-h5 n2-uc"><?php n2_e('Manage'); ?> </div> </div> </div> </div> </div> <?php $ul = array(); $ul[] = array('class' => 'n2-button-container n2-save-as-new-container', 'contents' => N2Html::tag('a', array('class' => 'n2-button n2-button-big n2-button-green n2-uc n2-layout-save-as-new', 'href' => '#'), n2_('Save as new layout'))); $this->widget->init("listn", array("ul" => $ul)); ?> <div class="n2-lightbox-sidebar-list"> </div> <?php $sets = $model->getSets(); $setId = $sets[0]['id']; $layouts = array(); $layouts[$setId] = $model->getVisuals($setId); N2JS::addFirstCode("\r\n new NextendLayoutManager({\r\n setsIdentifier: '" . $model->type . "set',\r\n sets: " . json_encode($sets) . ",\r\n visuals: " . json_encode($layouts) . ",\r\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('layout/index')) . "'\r\n });\r\n");
* @author Roland Soos * @copyright (C) 2015 Nextendweb.com * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('_JEXEC') or die('Restricted access'); /** * @var $model N2SystemFontModel */ $sets = $model->getSets(); N2FontRenderer::$sets[] = $sets[0]['id']; $fonts = array(); foreach (array_unique(N2FontRenderer::$sets) as $setId) { $fonts[$setId] = $model->getVisuals($setId); } $fontSettings = N2Fonts::loadSettings(); N2JS::addFirstCode("\r\n new NextendFontManager({\r\n setsIdentifier: '" . $model->type . "set',\r\n sets: " . json_encode($sets) . ",\r\n visuals: " . json_encode($fonts) . ",\r\n renderer: {\r\n pre: '" . N2FontRenderer::$pre . "',\r\n usedFonts: " . json_encode(N2FontRenderer::$fonts) . ",\r\n modes: " . json_encode(N2FontRenderer::$mode) . "\r\n },\r\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('font/index')) . "',\r\n defaultFamily: " . json_encode($fontSettings['default-family']) . "\r\n });\r\n"); ?> <div class="n2-form-tab "> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table n2-table-fixed"> <div class="n2-tr"> <div class="n2-td n2-h2"> <?php n2_e('Font settings'); ?> </div> <div class="n2-td n2-last n2-visual-editor-tabs"> <a href="#" class="n2-button n2-button-v n2-button-medium n2-button-grey n2-editor-clear-tab n2-h5 n2-uc" style="display: none;"><?php
public function actionIndex() { N2JS::addFirstCode("new NextendBrowse('" . $this->appType->router->createUrl('browse/index') . "', " . (defined('N2_IMAGE_UPLOAD_DISABLE') ? 0 : 1) . ");"); }
margin: 0; border: 0; } body, .n2-form-tab { background-color: #e9edf0; } <?php N2Platform::adminHideCSS(); ?> </style> <?php N2JS::addFirstCode("\n if(window.parent != window){\n parentDocument = window.parent.n2(window.parent.document);\n \$(window).on('keydown keyup keypress', function(e){\n if(e.keyCode == 27){\n parentDocument.trigger(e);\n }\n });\n }\n\n var container = n2('.n2-ss-container-device'),\n autoHeight = function(){\n var minHeight = n2(window).height() - container.offset().top ;\n container.css('height', 'auto');\n if(container.height() < minHeight){\n container.height(minHeight);\n }\n };\n\n autoHeight();\n n2(window).on('resize', autoHeight);\n n2('.n2-ss-slider').on('SliderResize', autoHeight);\n window[n2('.n2-ss-slider').attr('id')].startedDeferred.done(function(slider){\n slider.ready(autoHeight);\n });\n"); ?> <div class="n2-form-tab " style="display: block;"> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table"> <div class="n2-tr"> <div class="n2-td n2-h2"> <?php echo n2_('Preview'); ?> </div> <div class="n2-td" id="n2-ss-zoom"> <div class="n2-ss-slider-zoom-container">
<?php /** * @var $model N2SystemAnimationModel */ $sets = $model->getSets(); $backgroundAnimations = new stdClass(); N2JS::addFirstCode("\n new NextendBackgroundAnimationManager({\n setsIdentifier: '" . $model->type . "set',\n sets: " . json_encode($sets) . ",\n visuals: " . json_encode($backgroundAnimations) . ",\n ajaxUrl: '" . $this->appType->router->createAjaxUrl(array('backgroundanimation/index')) . "'\n });\n"); ?> <div class="n2-form-tab "> <div class="n2-heading-controls n2-content-box-title-bg"> <div class="n2-table n2-table-fixed"> <div class="n2-tr"> <div class="n2-td n2-h2"> <?php n2_e('Preview'); ?> </div> <div class="n2-td n2-last n2-visual-editor-tabs"> <div class="n2-form-element-radio-tab"> <div class="n2-radio-option n2-h4 n2-first n2-active"> <?php n2_e('Forward'); ?> </div><!-- --><div class="n2-radio-option n2-h4 n2-last"> <?php n2_e('Backward'); ?> </div> <input type="hidden" autocomplete="off" value="0" name="n2-background-animation-preview-tabs"