当前位置: 首页>>代码示例>>PHP>>正文


PHP N2Loader类代码示例

本文整理汇总了PHP中N2Loader的典型用法代码示例。如果您正苦于以下问题:PHP N2Loader类的具体用法?PHP N2Loader怎么用?PHP N2Loader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了N2Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 private static function load()
 {
     if (!self::$storage) {
         N2Loader::import("libraries.session.storage");
         self::$storage = new N2SessionStorage();
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:7,代码来源:session.php

示例2: install

 public function install()
 {
     foreach (self::$sql as $query) {
         $this->db->query($this->db->parsePrefix($query));
     }
     N2Loader::import('install', 'platform');
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:7,代码来源:Install.php

示例3: actionSearch

 public function actionSearch()
 {
     $this->validateToken();
     N2Loader::import('libraries.models.content', 'platform');
     $keyword = N2Request::getVar('keyword', '');
     $this->response->respond(N2ModelsContent::search($keyword));
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:7,代码来源:Content.php

示例4: renderType

 protected function renderType(&$context)
 {
     $params = $this->slider->params;
     N2Loader::import('libraries.image.color');
     $width = intval($context['width']);
     $height = intval($context['height']);
     $context['backgroundSize'] = $params->get('background-size');
     $context['backgroundAttachment'] = $params->get('background-fixed') ? 'fixed' : 'scroll';
     $borderWidth = $params->get('border-width');
     $borderColor = $params->get('border-color');
     $context['borderRadius'] = $params->get('border-radius') . 'px';
     $padding = N2Parse::parse($params->get('padding'));
     $context['paddingt'] = $padding[0] . 'px';
     $context['paddingr'] = $padding[1] . 'px';
     $context['paddingb'] = $padding[2] . 'px';
     $context['paddingl'] = $padding[3] . 'px';
     if ($context['canvas']) {
         $width += 2 * $borderWidth + $padding[1] + $padding[3];
         $height += 2 * $borderWidth + $padding[0] + $padding[2];
         $context['width'] = $width . "px";
         $context['height'] = $height . "px";
     }
     $context['border'] = $borderWidth . 'px';
     $rgba = N2Color::hex2rgba($borderColor);
     $context['borderrgba'] = 'RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ')';
     $context['borderhex'] = '#' . substr($borderColor, 0, 6);
     $width = $width - ($padding[1] + $padding[3]) - $borderWidth * 2;
     $height = $height - ($padding[0] + $padding[2]) - $borderWidth * 2;
     $context['inner1height'] = $height . 'px';
     $context['canvaswidth'] = $width . "px";
     $context['canvasheight'] = $height . "px";
     N2LESS::addFile(N2Filesystem::translate(dirname(__FILE__) . NDS . 'style.less'), $this->slider->cacheId, $context, NEXTEND_SMARTSLIDER_ASSETS . '/less' . NDS);
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:33,代码来源:css.php

示例5: subform

 public function subform($appType, $configurationXmlFile, $values, $control_name, $name)
 {
     if (N2Filesystem::fileexists($configurationXmlFile)) {
         N2Loader::import('libraries.form.form');
         $form = new N2Form($appType);
         $form->loadArray($values);
         //$subformValue = array();
         //$subformValue[N2Post::getVar('name')] = N2Post::getVar('value');
         //$form->loadArray($subformValue);
         $form->loadXMLFile($configurationXmlFile);
         ob_end_clean();
         // To clear the output of the platform
         ob_start();
         $subform = $form->getSubFormAjax(N2Post::getVar('tab'), $name);
         $subform->initAjax($control_name);
         echo $subform->renderForm();
         //echo N2AssetsManager::generateAjaxCSS();
         $scripts = N2AssetsManager::generateAjaxJS();
         $html = ob_get_clean();
         $response = array('html' => $html, 'scripts' => $scripts);
     } else {
         $response = array('error' => 'Configuration file not found: ' . $configurationXmlFile);
     }
     return $response;
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:25,代码来源:ajax.php

示例6: renderSetsForm

 public function renderSetsForm()
 {
     $configurationXmlFile = $this->getPath() . '/forms/' . $this->type . '/sets.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form();
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render($this->type . 'set');
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:8,代码来源:visual.php

示例7: actionExportHTML

 public function actionExportHTML()
 {
     if ($this->validateToken() && $this->validatePermission('smartslider_edit')) {
         N2Loader::import('libraries.export', 'smartslider');
         $export = new N2SmartSliderExport($this->sliderId);
         $export->createHTML();
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:8,代码来源:Slider.php

示例8: render

 public function render($cache = false)
 {
     if (!$cache) {
         return $this->slider->render();
     }
     N2Loader::import("libraries.slider.cache.slider", "smartslider");
     return $this->slider->addCMSFunctions($this->cacheSlider());
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:8,代码来源:manager.php

示例9: actionIndex

 public function actionIndex($secured = false)
 {
     if ($secured) {
         N2Loader::import('models.Install', 'system');
         $installModel = new N2SystemInstallModel();
         $installModel->install();
     }
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:8,代码来源:Install.php

示例10: getSliderTypeResource

 public function getSliderTypeResource($resourceName)
 {
     $type = $this->data->get('type', 'simple');
     $class = 'N2SSPluginType' . $type;
     N2Loader::importPath(call_user_func(array($class, "getPath")) . NDS . $resourceName);
     $class = 'N2SmartSlider' . $resourceName . $type;
     return new $class($this);
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:8,代码来源:abstract.php

示例11: renderRestoreFromServerForm

 public static function renderRestoreFromServerForm()
 {
     $configurationXmlFile = dirname(__FILE__) . '/forms/import/restorefromserver.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('slider');
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:8,代码来源:Sliders.php

示例12: renderForm

 public static function renderForm()
 {
     $configurationXmlFile = dirname(__FILE__) . '/forms/login.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('system')->getApplicationType('backend'));
     $form->loadXMLFile($configurationXmlFile);
     return $form->render('login');
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:8,代码来源:login.php

示例13: renderForm

 function renderForm($data = array())
 {
     N2Loader::import('libraries.animations.manager');
     $configurationXmlFile = dirname(__FILE__) . '/forms/layer.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form();
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('layer');
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:10,代码来源:Layers.php

示例14: autoload

 protected function autoload()
 {
     N2Loader::import("libraries.slider.helper", "smartslider");
     N2Loader::import("libraries.slider.manager", "smartslider");
     N2Form::$importPaths[] = dirname(__FILE__) . '/form';
     N2Filesystem::registerTranslate(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins', $this->info->getAssetsPath() . '/plugins');
     require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'loadplugin.php';
     N2Loader::import('plugins.loadplugin', 'smartslider.platform');
     N2Loader::import('libraries.link', 'smartslider');
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:10,代码来源:N2SmartsliderApplication.php

示例15: make

 /**
  * @param $slide N2SmartSliderSlide
  *
  * @return string
  */
 public function make($slide)
 {
     $dynamicHeight = intval($this->slider->params->get('dynamic-height', 0));
     $backgroundImageOpacity = min(100, max(0, $slide->parameters->get('backgroundImageOpacity', 100))) / 100;
     if ($slide->hasGenerator()) {
         $rawBackgroundImage = $slide->parameters->get('backgroundImage', '');
         $backgroundImage = $slide->fill($rawBackgroundImage);
         $imageData = N2ImageManager::getImageData($rawBackgroundImage);
         $imageData['desktop-retina']['image'] = $slide->fill($imageData['desktop-retina']['image']);
         $imageData['tablet']['image'] = $slide->fill($imageData['tablet']['image']);
         $imageData['tablet-retina']['image'] = $slide->fill($imageData['tablet-retina']['image']);
         $imageData['mobile']['image'] = $slide->fill($imageData['mobile']['image']);
         $imageData['mobile-retina']['image'] = $slide->fill($imageData['mobile-retina']['image']);
     } else {
         $backgroundImage = $slide->fill($slide->parameters->get('backgroundImage', ''));
         $imageData = N2ImageManager::getImageData($backgroundImage);
     }
     $sizes = $this->slider->assets->sizes;
     $backgroundColor = '';
     $color = $slide->parameters->get('backgroundColor', '');
     if (strlen($color) == 8 && substr($color, 6, 2) != '00') {
         $backgroundColor = 'background-color: #' . substr($color, 0, 6) . ';';
         if (!class_exists('N2Color')) {
             N2Loader::import("libraries.image.color");
         }
         $rgba = N2Color::hex2rgba($color);
         $rgba[3] = round($rgba[3] / 127, 2);
         $backgroundColor .= "background-color: RGBA({$rgba[0]}, {$rgba[1]}, {$rgba[2]}, {$rgba[3]});";
     }
     if (empty($backgroundImage)) {
         $src = N2Image::base64Transparent();
     } else {
         $src = $backgroundImage;
     }
     $alt = $slide->parameters->get('backgroundAlt', '');
     $title = $slide->parameters->get('backgroundTitle', '');
     $fillMode = $slide->parameters->get('backgroundMode', 'default');
     if ($fillMode == 'default') {
         $fillMode = $this->slider->params->get('backgroundMode', 'fill');
     }
     if ($dynamicHeight) {
         return $this->simple($backgroundColor, $backgroundImageOpacity, $src, $imageData, $alt, $title, $sizes);
     }
     switch ($fillMode) {
         case 'fit':
             return $this->fit($backgroundColor, $backgroundImageOpacity, $src, $imageData, $alt, $title, $sizes);
         case 'stretch':
             return $this->stretch($backgroundColor, $backgroundImageOpacity, $src, $imageData, $alt, $title);
         case 'center':
             return $this->center($backgroundColor, $backgroundImageOpacity, $src, $imageData);
         case 'tile':
             return $this->tile($backgroundColor, $backgroundImageOpacity, $src, $imageData);
     }
     return $this->fill($backgroundColor, $backgroundImageOpacity, $src, $imageData, $alt, $title, $sizes);
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:60,代码来源:slidebackground.php


注:本文中的N2Loader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。