本文整理汇总了PHP中N2Base类的典型用法代码示例。如果您正苦于以下问题:PHP N2Base类的具体用法?PHP N2Base怎么用?PHP N2Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了N2Base类的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));
}
示例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');
}
示例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/';
}
示例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;
}
示例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');
}
示例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'));
}
示例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);
}
示例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');
}
示例9: getInstance
/**
* @return N2SmartSliderHelper
*/
public static function getInstance()
{
static $instance = null;
if ($instance === null) {
$instance = new self(N2Base::getApplication('smartslider'));
}
return $instance;
}
示例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 '';
}
示例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') . '");
');
}
示例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;
}
示例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;
}
示例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()));
}
示例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>