• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP N2Loader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: renderFontsConfigurationForm

 public function renderFontsConfigurationForm()
 {
     $values = N2Fonts::loadSettings();
     $form = new N2Form($this->appType);
     $form->loadArray($values);
     $form->loadArray($values['plugins']->toArray());
     $form->loadXMLFile(N2Loader::getPath('models', 'system') . '/forms/fonts.xml');
     echo N2Html::openTag("form", array("id" => "nextend-config", "method" => "post", "action" => N2Request::getRequestUri()));
     $form->render('fonts');
     echo N2Html::closeTag("form");
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:11,代码来源:_view.php


示例17: render

 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') . '");
     ');
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:11,代码来源:Settings.php


示例18: actionGenerateImage

 public function actionGenerateImage()
 {
     $this->validateToken();
     $device = N2Request::getVar('device');
     $this->validateVariable($device == 'tablet' || $device == 'mobile', 'device');
     $image = N2Request::getVar('image');
     $this->validateVariable(!empty($image), 'image');
     N2Loader::import('libraries.image.image');
     $scale = array('tablet' => 0.5, 'mobile' => 0.3);
     $newImage = N2Image::scaleImage('image', $image, $scale[$device], true);
     $this->response->respond(array('image' => N2ImageHelper::fixed($newImage)));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:12,代码来源:Image.php


示例19: install

 public function install()
 {
     foreach (self::$sql as $query) {
         $this->db->query($this->db->parsePrefix($query));
     }
     N2Loader::import('install', 'smartslider.platform');
     $sliders = $this->db->queryAll($this->db->parsePrefix('SELECT * FROM #__nextend2_smartslider3_sliders LIMIT 1'));
     if (empty($sliders)) {
         foreach (self::$sampleSlider as $query) {
             $this->db->query($this->db->parsePrefix($query));
         }
     }
 }
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:13,代码来源:Install.php


示例20: __construct

 /**
  * @param $slide N2SmartSliderSlide
  * @param $slider
  * @param $extend
  */
 public function __construct($slide, $slider, $extend)
 {
     N2Loader::import("libraries.slider.cache.generator", "smartslider");
     N2Loader::import("models.generator", "smartslider");
     $this->slide = $slide;
     $this->slider = $slider;
     $this->generatorModel = new N2SmartsliderGeneratorModel();
     $this->currentGenerator = $this->generatorModel->get($this->slide->generator_id);
     $this->currentGenerator['params'] = new N2Data($this->currentGenerator['params'], true);
     if (isset($extend[$this->slide->generator_id])) {
         $extend = new N2Data($extend[$this->slide->generator_id]);
         $slide->parameters->set('record-slides', $extend->get('record-slides', 1));
         $extend->un_set('record-slides');
         $this->currentGenerator['params']->loadArray($extend->toArray());
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:21,代码来源:generator.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP N2Plugin类代码示例发布时间:2022-05-23
下一篇:
PHP N2JS类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap