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

PHP N2Base类代码示例

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

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



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


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


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


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


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


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


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


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

<?php

/* @var $this N2Layout */
?>

    <div id="n2-admin" class="n2 n2-border-radius">

        <?php 
/**
 * @var $widget Nav
 */
$logoUrl = N2Base::getApplication('system')->getLogo();
$cmd = N2Request::getVar("nextendcontroller", "dashboard");
echo $this->widget->init('nav', array('logoUrl' => $this->appType->router->createUrl("dashboard/index"), 'logoImageUrl' => $logoUrl, 'views' => array(N2Html::tag('a', array('href' => $this->appType->router->createUrl("dashboard/index"), 'class' => 'n2-h4 n2-uc ' . ($cmd == "dashboard" ? "n2-active" : "")), n2_('Dashboard')), N2Html::tag('a', array('href' => $this->appType->router->createUrl("settings/index"), 'class' => 'n2-h4 n2-uc ' . ($cmd == "settings" ? "n2-active" : "")), n2_('Settings')), N2Html::tag('a', array('href' => $this->appType->router->createUrl("help/index"), 'class' => 'n2-h4 n2-uc ' . ($cmd == "help" ? "n2-active" : "")), n2_('Help'))), 'actions' => $this->getFragmentValue('actions')));
?>

        <div class="n2-table n2-table-fixed n2-content">
            <div class="n2-tr">
                <div class="n2-td n2-sidebar n2-sidebar-base-bg">
                    <?php 
$this->renderFragmentBlock('nextend_sidebar');
?>
                </div>

                <div class="n2-td n2-content-base-bg">
                    <!-- Begin Content -->
                    <div class="n2-content-area n2-border-radius-br">
                        <?php 
$this->renderFragmentBlock('nextend_content');
?>
                    </div>
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:31,代码来源:default.php


示例16: init

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


示例17: array

                            <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>
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:30,代码来源:edit.php


示例18: simpleEditForm

 public function simpleEditForm($data = array())
 {
     $configurationXmlFile = dirname(__FILE__) . '/forms/slide.xml';
     N2Loader::import('libraries.form.form');
     $form = new N2Form(N2Base::getApplication('smartslider')->getApplicationType('backend'));
     $data['publishdates'] = isset($data['publishdates']) ? $data['publishdates'] : (isset($data['publish_up']) ? $data['publish_up'] : '') . '|*|' . (isset($data['publish_down']) ? $data['publish_down'] : '');
     if (isset($data['slide'])) {
         $data['slide'] = base64_encode($data['slide']);
     }
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('slide');
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:13,代码来源:Slides.php


示例19: store

 static function store($key, $value)
 {
     N2Base::getApplication('smartslider')->storage->set($key, '', $value);
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:4,代码来源:settings.php


示例20: load

 public static function load()
 {
     N2Base::getApplication('system')->getApplicationType('backend')->run(array('useRequest' => false, 'controller' => 'browse', 'action' => 'index'));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:4,代码来源:browse.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP N2Filesystem类代码示例发布时间:2022-05-23
下一篇:
PHP MysqliDb类代码示例发布时间: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