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


PHP N2Base::getApplication方法代码示例

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


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

示例1: getNextendElementUrlParameters

 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));
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:7,代码来源:url.php

示例2: assetsBackend

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

示例3: backend

 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');
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:32,代码来源:predefined.php

示例4: initialize

 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'));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:8,代码来源:VisualManager.php

示例5: install_new_blog

 public static function install_new_blog($blog_id)
 {
     global $wpdb;
     $tmpPrefix = $wpdb->prefix;
     $wpdb->prefix = $wpdb->get_blog_prefix($blog_id);
     N2Base::getApplication("system")->getApplicationType('backend')->render(array("controller" => "install", "action" => "index", "useRequest" => false), array(true));
     $wpdb->prefix = $tmpPrefix;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:8,代码来源:nextend.php

示例6: renderForm

 function renderForm($type, $item, $data = array())
 {
     $configurationXmlFile = $item[4] . 'configuration.xml';
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('item_' . $type);
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:8,代码来源:Item.php

示例7: 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

示例8: 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

示例9: getInstance

 /**
  * @return N2SmartSliderHelper
  */
 public static function getInstance()
 {
     static $instance = null;
     if ($instance === null) {
         $instance = new self(N2Base::getApplication('smartslider'));
     }
     return $instance;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:11,代码来源:helper.php

示例10: render

 public static function render($parameters, $usage = 'WordPress Shortcode')
 {
     $parameters = shortcode_atts(array('id' => md5(time()), 'slider' => 0), $parameters);
     if (intval($parameters['slider']) > 0) {
         ob_start();
         N2Base::getApplication("smartslider")->getApplicationType('widget')->render(array("controller" => 'home', "action" => 'wordpress', "useRequest" => false), array(intval($parameters['slider']), $usage));
         return ob_get_clean();
     }
     return '';
 }
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:10,代码来源:shortcode.php

示例11: 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

示例12: isActive

 public function isActive($cacheAccepted = true)
 {
     if ($cacheAccepted && $this->maybeActive()) {
         return 'OK';
     }
     $status = $this->checkKey($this->key);
     if ($this->hasKey() && $status == 'OK') {
         N2Base::getApplication('smartslider')->storage->set('license', 'isActive', time());
         return $status;
     }
     N2Base::getApplication('smartslider')->storage->set('license', 'isActive', 0);
     return $status;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:13,代码来源:License.php

示例13: getDashboardButtons

 public function getDashboardButtons($slider)
 {
     $sliderid = $slider['id'];
     $app = N2Base::getApplication('smartslider');
     $accessEdit = N2Acl::canDo('smartslider_edit', $app->info);
     $accessDelete = N2Acl::canDo('smartslider_delete', $app->info);
     $buttons = '';
     if ($accessEdit) {
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Quick Edit - Slides'), 'href' => '#', 'id' => 'n2-quick-slides-edit'), N2Html::tag('i', array('class' => 'n2-i n2-i-slideedit')));
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Clear slider cache'), 'href' => $this->appType->router->createUrl(array('slider/clearcache', array('sliderid' => $sliderid) + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-i-a-refresh')));
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Export slider as HTML'), 'href' => $this->appType->router->createUrl(array('slider/exporthtml', array('sliderid' => $sliderid) + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-i-a-html')));
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Export'), 'href' => $this->appType->router->createUrl(array('slider/export', array('sliderid' => $sliderid) + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-i-a-export')));
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Duplicate slider'), 'href' => $this->appType->router->createUrl(array('slider/duplicate', array('sliderid' => $sliderid) + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-i-a-duplicate')));
     }
     if ($accessDelete) {
         $buttons .= N2Html::tag('a', array('data-label' => n2_('Delete slider'), "onclick" => "return NextendDeleteModalLink(this, 'slider-delete', " . json_encode($slider['title']) . ");", 'href' => $this->appType->router->createUrl(array('slider/delete', array('sliderid' => $sliderid) + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-i-a-delete')));
     }
     return $buttons;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:19,代码来源:_view.php

示例14: fetchElement

 function fetchElement()
 {
     $attributes = array('class' => 'n2-form-element-single-button n2-button n2-button-big n2-uc n2-button-grey', 'href' => '#', 'onclick' => 'return false;', 'id' => $this->_id);
     $url = N2XmlHelper::getAttribute($this->_xml, 'url');
     if (!empty($url)) {
         $attributes['href'] = $url;
         $attributes['target'] = N2XmlHelper::getAttribute($this->_xml, 'target');
     } else {
         $app = (string) $this->_xml->app;
         if ($app) {
             $queries = (array) $this->_xml->queries;
             $route = $queries['controller'] . '/' . $queries['action'];
             unset($queries['controller']);
             unset($queries['action']);
             $attributes['href'] = N2Base::getApplication($app)->router->createUrl(array($route, $queries), true);
             unset($attributes['onclick']);
         }
     }
     return N2Html::tag('a', $attributes, n2_($this->getValue()));
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:20,代码来源:button.php

示例15: importVisuals

 private function importVisuals($records, $linkedVisuals)
 {
     if (count($records)) {
         if (!$linkedVisuals) {
             foreach ($records as $record) {
                 $this->sectionTranslation[$record['id']] = $record['value'];
             }
         } else {
             $sets = array();
             foreach ($records as $record) {
                 $storage = N2Base::getApplication($record['application'])->storage;
                 if (!isset($sets[$record['application'] . '_' . $record['section']])) {
                     $sets[$record['application'] . '_' . $record['section']] = $storage->add($record['section'] . 'set', null, $this->backup->slider['title']);
                 }
                 $this->sectionTranslation[$record['id']] = $storage->add($record['section'], $sets[$record['application'] . '_' . $record['section']], $record['value']);
             }
         }
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:19,代码来源:import.php


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