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


PHP N2Request::getCmd方法代码示例

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


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

示例1: save

 public function save()
 {
     $namespace = N2Request::getCmd('namespace', 'default');
     $settings = N2Request::getVar('settings');
     if ($namespace && $settings) {
         if ($namespace == 'default') {
             $namespace = 'settings';
         }
         if ($namespace == 'font' && N2Request::getInt('sliderid')) {
             $namespace .= N2Request::getInt('sliderid');
             self::markChanged(N2Request::getInt('sliderid'));
         }
         if ($namespace == 'joomla') {
             $license = empty($settings['license']) ? '' : $settings['license'];
             $updates = $this->db->queryAll("SELECT b.update_site_id FROM " . $this->db->tableAlias("extensions") . " AS a LEFT JOIN " . $this->db->tableAlias("update_sites_extensions") . " AS b ON a.extension_id = b.extension_id WHERE a.element = 'com_smartslider3'");
             if (count($updates)) {
                 $id = $updates[0]['update_site_id'];
                 unset($updates[0]);
                 if (count($updates)) {
                     foreach ($updates as $u) {
                         $this->db->setTableName("update_sites");
                         $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id']));
                         $this->db->setTableName("update_sites_extensions");
                         $this->db->deleteByAttributes(array("update_site_id" => $u['update_site_id']));
                     }
                 }
                 $this->db->setTableName("update_sites");
                 $this->db->update(array("location" => 'http://www.nextendweb.com/update2/joomla/update.php?license=' . urlencode($license) . '&fake=extension.xml'), array("update_site_id" => $id));
             }
         }
         N2SmartSliderSettings::store($namespace, json_encode($settings));
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:33,代码来源:Settings.php

示例2: actionEdit

 public function actionEdit()
 {
     $this->validateToken();
     $this->validatePermission('smartslider_edit');
     if (N2Request::getInt('save')) {
         $slidersModel = new N2SmartsliderSlidersModel();
         $slider = $slidersModel->get(N2Request::getInt('sliderid'));
         $this->validateDatabase($slider);
         if ($sliderid = $slidersModel->save($slider['id'], N2Request::getVar('slider'))) {
             N2Message::success(n2_('Slider saved.'));
             $this->response->respond();
         }
     }
     $response = null;
     $id = N2Request::getCmd('id');
     $ajaxModel = new N2SmartSliderAjaxModel();
     ob_start();
     switch ($id) {
         case 'slidertype':
             $response = $ajaxModel->sliderType($this->appType);
             break;
         case 'sliderresponsivemode':
             $response = $ajaxModel->sliderResponsiveMode($this->appType);
             break;
         case 'sliderwidgetarrow':
             $response = $ajaxModel->sliderWidget($this->appType, 'arrow');
             break;
         case 'sliderwidgetbullet':
             $response = $ajaxModel->sliderWidget($this->appType, 'bullet');
             break;
         case 'sliderwidgetautoplay':
             $response = $ajaxModel->sliderWidget($this->appType, 'autoplay');
             break;
         case 'sliderwidgetindicator':
             $response = $ajaxModel->sliderWidget($this->appType, 'indicator');
             break;
         case 'sliderwidgetfullscreen':
             $response = $ajaxModel->sliderWidget($this->appType, 'fullscreen');
             break;
         case 'sliderwidgetbar':
             $response = $ajaxModel->sliderWidget($this->appType, 'bar');
             break;
         case 'sliderwidgetthumbnail':
             $response = $ajaxModel->sliderWidget($this->appType, 'thumbnail');
             break;
         case 'sliderwidgetshadow':
             $response = $ajaxModel->sliderWidget($this->appType, 'shadow');
             break;
         case 'sliderwidgethtml':
             $response = $ajaxModel->sliderWidget($this->appType, 'html');
             break;
     }
     if ($response == null) {
         $response = array('html' => '', 'script' => '');
     }
     $response['html'] .= ob_get_clean();
     $this->response->respond($response);
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:58,代码来源:Slider.php

示例3: actionEnd

 public function actionEnd()
 {
     $this->validateToken();
     $this->validatePermission('smartslider_edit');
     $key = N2Request::getCmd('key');
     N2SmartSliderSettings::set('guide-' . $key, 0);
     N2Message::notice('The ' . $key . ' guide completed. If you need it again, you can turn it on in the "Settings"!');
     $this->response->respond();
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:9,代码来源:Guide.php

示例4: actionOrderBy

 public function actionOrderBy()
 {
     $time = N2Request::getCmd('time', null);
     if ($time == 'DESC' || $time == 'ASC') {
         N2SmartSliderSettings::set('slidersOrder', 'time');
         N2SmartSliderSettings::set('slidersOrderDirection', $time);
     }
     $title = N2Request::getCmd('title', null);
     if ($title == 'DESC' || $title == 'ASC') {
         N2SmartSliderSettings::set('slidersOrder', 'title');
         N2SmartSliderSettings::set('slidersOrderDirection', $title);
     }
     $this->redirectToSliders();
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:14,代码来源:Sliders.php

示例5: actionAviary

 public function actionAviary()
 {
     if ($this->canDo('nextend_config')) {
         N2Loader::import('libraries.image.aviary');
         $aviary = N2Request::getVar('aviary', false);
         if ($aviary) {
             if ($this->validateToken()) {
                 N2ImageAviary::storeSettings($aviary);
                 N2Message::success(n2_('Saved.'));
                 N2Request::redirect($this->appType->router->createUrl(array("settings/aviary", array('layout' => N2Request::getCmd('layout', '')))));
             } else {
                 $this->refresh();
             }
         }
         $this->addView("../../inline/sidebar/settings", array("appObj" => $this), "sidebar");
         $this->addView("aviary");
         $this->render();
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:19,代码来源:Settings.php

示例6: defined

<?php

/**
* @author    Roland Soos
* @copyright (C) 2015 Nextendweb.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die('Restricted access');
$action = N2Request::getCmd('nextendaction', 'default');
$settings = array(array('id' => 'index', 'title' => n2_('General settings')));
$settings[] = array('id' => 'fonts', 'title' => n2_('Fonts'));
$dl = array();
foreach ($settings as $setting) {
    $dl[] = array('title' => $setting['title'], 'link' => $this->appType->router->createUrl("settings/{$setting['id']}"), 'class' => $setting['id'] == $action ? 'active ' : '');
}
echo $this->widget->init("definitionlist", array("dl" => $dl));
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:16,代码来源:settings.php

示例7: array

<?php

$actions = array();
if (isset($slider)) {
    $actions[] = N2Html::tag('a', array('href' => $this->appType->router->createUrl(array("generator/create", array("sliderid" => $slider['id']))), 'class' => 'n2-button n2-button-red n2-button-big n2-h4 n2-b n2-uc'), n2_('Cancel'));
}
$actions[] = N2Html::tag('a', array('href' => '#', 'class' => 'n2-button n2-button-green n2-button-big n2-h4 n2-b n2-uc', 'onclick' => 'return NextendForm.submit("#smartslider-form");'), n2_('Save'));
$this->widget->init('topbar', array("actions" => $actions));
?>

<form id="smartslider-form" action="" method="post">
    <?php 
echo $configuration->render();
?>
    <input name="save" value="1" type="hidden"/>
</form>
<?php 
N2SS3::showBeacon(ucfirst(N2Request::getCmd('group')) . ' generator');
开发者ID:MBerguer,项目名称:wp-demo,代码行数:18,代码来源:check_configuration.php

示例8: array

<?php

$this->widget->init('topbar', array("actions" => array(N2Html::tag('a', array('href' => $this->appType->router->createUrl(array("slider/edit", array("sliderid" => $slider['id']))), 'class' => 'n2-button n2-button-red n2-button-big n2-h4 n2-b n2-uc'), n2_('Cancel')), N2Html::tag('a', array('href' => '#', 'class' => 'n2-button n2-button-green n2-button-big n2-h4 n2-b n2-uc', 'onclick' => 'return NextendForm.submit("#smartslider-form");'), n2_('Save')))));
?>

    <form id="smartslider-form" action="" method="post">
        <?php 
$group = N2Request::getCmd('group');
$type = N2Request::getCmd('type');
$generatorModel = new N2SmartsliderGeneratorModel();
$info = $generatorModel->getGeneratorInfo($group, $type);
$this->widget->init('heading', array('title' => $info->group . ' - ' . $info->title));
$xml = $generatorModel->generatorSpecificForm($group, $type);
$generatorModel->generatorCommonForm();
?>
        <input name="generator[group]" value="<?php 
echo $group;
?>
" type="hidden"/>
        <input name="generator[type]" value="<?php 
echo $type;
?>
" type="hidden"/>
        <input name="slider-id" value="<?php 
echo N2Request::getInt('sliderid');
?>
" type="hidden"/>
        <input name="save" value="1" type="hidden"/>
    </form>
    <style>
        #generatorrecords {
开发者ID:MBerguer,项目名称:wp-demo,代码行数:31,代码来源:create_settings.php

示例9: makeSlides

 public function makeSlides($extend = array())
 {
     if (N2Request::getCmd('nextendcontroller') == 'slides') {
         $slides =& $this->slides;
         if (N2Request::getCmd('nextendaction') == 'create') {
             if ($this->maximumSlideCount > 0) {
                 array_splice($slides, $this->maximumSlideCount - 1);
             }
             $staticSlide = N2Request::getInt('static', 0);
             $slide = $this->createSlide(array('id' => 0, 'title' => 'Title', 'slider' => N2Request::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'description' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'params' => json_encode(array('static-slide' => $staticSlide)), 'ordering' => count($slides), 'generator_id' => 0));
             if ($slide->isStatic()) {
                 $this->slider->addStaticSlide($slide);
                 if (count($slides) == 0) {
                     $slide2 = $this->createSlide(array('id' => 0, 'title' => 'Title', 'slider' => N2Request::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'description' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'params' => '', 'ordering' => count($slides), 'generator_id' => 0));
                     array_push($slides, $slide2);
                 }
             } else {
                 for ($i = 0; $i < count($slides); $i++) {
                     if ($slides[$i]->isStatic()) {
                         $this->slider->addStaticSlide($slides[$i]);
                         array_splice($slides, $i, 1);
                         $i--;
                     }
                 }
                 array_push($slides, $slide);
                 $this->slider->_activeSlide = count($slides) - 1;
             }
         } else {
             $currentlyEdited = N2Request::getInt('slideid');
             $currentlyEditedSlide = null;
             $isStatic = false;
             for ($i = 0; $i < count($slides); $i++) {
                 if ($slides[$i]->isStatic()) {
                     if ($slides[$i]->id == $currentlyEdited) {
                         $isStatic = true;
                     }
                     $this->slider->addStaticSlide($slides[$i]);
                     array_splice($slides, $i, 1);
                     $i--;
                 }
             }
             if ($isStatic) {
                 for ($i = 0; $i < count($this->slider->staticSlides); $i++) {
                     if ($this->slider->staticSlides[$i]->id != $currentlyEdited) {
                         array_splice($this->slider->staticSlides, $i, 1);
                         $i--;
                     }
                 }
             }
             for ($i = 0; $i < count($slides); $i++) {
                 $slides[$i]->initGenerator($extend);
             }
             for ($i = count($slides) - 1; $i >= 0; $i--) {
                 if ($slides[$i]->hasGenerator()) {
                     array_splice($slides, $i, 1, $slides[$i]->expandSlide());
                 }
             }
             if (!$isStatic) {
                 for ($i = 0; $i < count($slides); $i++) {
                     if ($slides[$i]->id == $currentlyEdited) {
                         $this->slider->_activeSlide = $i;
                         $currentlyEditedSlide = $slides[$i];
                         break;
                     }
                 }
             } else {
                 if (count($slides) == 0) {
                     if (count($slides) == 0) {
                         $slide2 = $this->createSlide(array('id' => 0, 'title' => 'Title', 'slider' => N2Request::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'description' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'params' => '', 'ordering' => count($slides), 'generator_id' => 0));
                         array_push($slides, $slide2);
                     }
                 }
                 $this->slider->_activeSlide = 0;
                 $currentlyEditedSlide = $slides[0];
             }
             if ($this->maximumSlideCount > 0) {
                 array_splice($slides, $this->maximumSlideCount);
                 $found = false;
                 for ($i = 0; $i < count($slides); $i++) {
                     if ($slides[$i] == $currentlyEditedSlide) {
                         $found = true;
                         break;
                     }
                 }
                 if (!$found) {
                     $this->slider->_activeSlide = count($slides) - 1;
                     $slides[$this->slider->_activeSlide] = $currentlyEditedSlide;
                 }
             }
             if ($currentlyEditedSlide) {
                 $currentlyEditedSlide->setCurrentlyEdited();
             }
         }
     }
 }
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:95,代码来源:slidesadmin.php

示例10: array

<div class="n2-sidebar-inner">
    <?php 
N2Loader::import('libraries.browse.browse');
$app = N2Base::getApplication('smartslider');
$accessEdit = N2Acl::canDo('smartslider_edit', $app->info);
$accessDelete = N2Acl::canDo('smartslider_delete', $app->info);
$sliderid = N2Request::getInt('sliderid', 0);
$generatorId = N2Request::getInt('generator_id', 0);
$controller = N2Request::getCmd('nextendcontroller');
$slidersModel = new N2SmartsliderSlidersModel();
$showSlideManager = false;
$dl = array();
if (!$sliderid) {
    $orderBy = N2SmartSliderSettings::get('slidersOrder', 'time');
    $orderByDirection = N2SmartSliderSettings::get('slidersOrderDirection', 'DESC');
    $actions = N2Html::tag('a', array("class" => 'n2-button n2-button-grey n2-button-medium' . ($orderBy == 'title' ? ' n2-active' : ''), "href" => $this->appType->router->createUrl(array('sliders/orderby', array('title' => $orderBy == 'title' ? $orderByDirection == 'ASC' ? 'DESC' : 'ASC' : 'ASC') + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-16' . ($orderBy == 'title' ? $orderByDirection == 'ASC' ? ' n2-i-sortalphabetic1' : ' n2-i-sortalphabetic2' : ' n2-i-sortalphabetic1')), ''));
    $actions .= N2Html::tag('a', array("class" => 'n2-button n2-button-grey n2-button-medium' . ($orderBy == 'time' ? ' n2-active' : ''), "href" => $this->appType->router->createUrl(array('sliders/orderby', array('time' => $orderBy == 'time' ? $orderByDirection == 'ASC' ? 'DESC' : 'ASC' : 'DESC') + N2Form::tokenizeUrl()))), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-16' . ($orderBy == 'time' ? $orderByDirection == 'ASC' ? ' n2-i-sortdate1' : ' n2-i-sortdate2' : ' n2-i-sortdate2')), ''));
    $dl[] = array('title' => '<span>' . n2_('SLIDER LIST') . '</span>', 'class' => 'n2-ss-slider-ordering n2-ss-slide2-list', 'tooltip' => null, 'actions' => $actions);
    $sliders = $slidersModel->getAll($orderBy, $orderByDirection);
} else {
    // Show only one sliders's sidebar in this context
    $sliders = array($slidersModel->get($sliderid));
}
if ($sliders) {
    foreach ($sliders as $slider) {
        $active = $sliderid == $slider['id'];
        $preUl = '';
        if ($active) {
            $showSlideManager = true;
            ob_start();
            $this->widget->init("buttonmenu", array("content" => N2Html::tag('div', array('class' => 'n2-button-menu'), N2Html::tag('div', array('class' => 'n2-button-menu-inner n2-border-radius'), N2Html::link(n2_('Add images'), '#', array('class' => 'n2-add-quick-image n2-h4')) . N2Html::link(n2_('Add video'), '#', array('class' => 'n2-add-quick-video n2-h4' . (N2Platform::$hasPosts ? '' : ' n2-separator'))) . (N2Platform::$hasPosts ? N2Html::link(n2_('Add post'), '#', array('class' => 'n2-add-quick-post n2-h4')) : '') . N2Html::link(n2_('Create empty slide'), $app->router->createUrl(array("slides/create", array("sliderid" => N2Request::getInt('sliderid'), "static" => 0))), array('class' => 'n2-h4 n2-separator')) . N2Html::link(n2_('Create static slide'), $app->router->createUrl(array("slides/create", array("sliderid" => N2Request::getInt('sliderid'), "static" => 1))), array('class' => 'n2-h4')) . N2Html::link(n2_('Create dynamic slides'), $app->router->createUrl(array("generator/create", array("sliderid" => N2Request::getInt('sliderid')))), array('class' => 'n2-h4'))))));
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:31,代码来源:_sliders.php

示例11: actionGetData

 public function actionGetData()
 {
     $this->validateToken();
     $this->validatePermission('smartslider_edit');
     $group = N2Request::getVar('group');
     $type = N2Request::getVar('type');
     $generatorModel = new N2SmartsliderGeneratorModel();
     $info = $generatorModel->getGeneratorInfo($group, $type);
     $configuration = $info->getConfiguration();
     try {
         $this->response->respond(call_user_func(array($configuration, N2Request::getCmd('method'))));
     } catch (Exception $e) {
         N2Message::error($e->getMessage());
         $this->response->error();
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:16,代码来源:Generator.php


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