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


PHP waRequest::get方法代码示例

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


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

示例1: backendOrder

 public function backendOrder()
 {
     if (waRequest::get('hash')) {
         return array('info_section' => wa()->getView()->fetch($this->path . '/templates/actions/backend/BackendOrder.html'));
     }
     return null;
 }
开发者ID:quadrodesign,项目名称:ordersfilter,代码行数:7,代码来源:shopOrdersfilterPlugin.class.php

示例2: getId

 protected function getId()
 {
     if (!empty($this->params['limited_own_profile'])) {
         return wa()->getUser()->getId();
     }
     return (int) waRequest::get('id');
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:7,代码来源:contactsPhotoEditor.action.php

示例3: execute

 public function execute()
 {
     $extended = false;
     $this->view->assign('action', 'update');
     $update_counter = 0;
     $messages = installerMessage::getInstance()->handle(waRequest::get('msg'));
     $this->view->assign('error', false);
     $app = null;
     try {
         $app_list = installerHelper::getApps($messages, $update_counter);
         $slug = waRequest::get('slug');
         $vendor = waRequest::get('vendor');
         $edition = waRequest::get('edition');
         foreach ($app_list as $info) {
             if ($info['slug'] == $slug && $info['vendor'] == $vendor && $info['edition'] == $edition) {
                 $app = $info;
                 break;
             }
         }
         if (!$app) {
             throw new waException(_w('Application not found'));
         }
     } catch (Exception $ex) {
         $msg = installerMessage::getInstance()->raiseMessage($ex->getMessage(), installerMessage::R_FAIL);
         $this->redirect(array('module' => 'apps', 'msg' => $msg));
     }
     $this->view->assign('identity_hash', installerHelper::getHash());
     $this->view->assign('messages', $messages);
     $this->view->assign('update_counter', $update_counter);
     $this->view->assign('app', $app);
     $this->view->assign('title', sprintf(_w('Application "%s"'), $app['name']));
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:32,代码来源:installerAppsInfo.action.php

示例4: execute

 public function execute()
 {
     $path = null;
     $photo_rights_model = new photosPhotoRightsModel();
     $photo_id = waRequest::get('photo_id', null, waRequest::TYPE_INT);
     if ($photo_rights_model->checkRights($photo_id, true)) {
         $photo_model = new photosPhotoModel();
         if ($photo = $photo_model->getById($photo_id)) {
             if (waRequest::get('original')) {
                 $path = photosPhoto::getOriginalPhotoPath($photo);
             } else {
                 $path = photosPhoto::getPhotoPath($photo);
             }
         }
     }
     if ($path) {
         if ($attach = waRequest::get('attach') ? true : false) {
             $response = $this->getResponse();
             $response->addHeader('Expires', 'tomorrow');
             $response->addHeader('Cache-Control', ($photo['status'] == 1 ? 'public' : 'private') . ', max-age=' . 86400 * 30);
         }
         waFiles::readFile($path, $attach ? null : basename($photo['name'] . '.' . $photo['ext']), true, !$attach);
     } else {
         throw new waException(_w("Photo not found"), 404);
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:26,代码来源:photosPhotoDownload.controller.php

示例5: execute

 public function execute()
 {
     $this->setLayout(new shopBackendLayout());
     $status = waRequest::get('status');
     $tab = waRequest::get('tab');
     $model = new waModel();
     $cities = $model->query("SELECT * FROM shop_deliveryshop_city ORDER BY city ASC")->fetchAll();
     $city['data'] = $cities;
     $city['new'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_city WHERE status='new'")->fetchField();
     $city['completed'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_city WHERE status='completed'")->fetchField();
     $city['flag-white'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_city WHERE status='flag-white'")->fetchField();
     $city['refunded'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_city WHERE status='refunded'")->fetchField();
     $city['all'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_city")->fetchField();
     foreach ($city['data'] as $key => &$c) {
         if (is_numeric($c['region'])) {
             $c['region'] = $model->query("SELECT name FROM wa_region WHERE code='" . $c['region'] . "' AND country_iso3='rus'")->fetchField();
         }
         if ($status && $status != $c['status'] && $tab == 'shop') {
             unset($city['data'][$key]);
         }
     }
     $pvz['data'] = $model->query("SELECT * FROM shop_deliveryshop_pvz ORDER BY city ASC")->fetchAll();
     $pvz['new'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_pvz WHERE status='new'")->fetchField();
     $pvz['completed'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_pvz WHERE status='completed'")->fetchField();
     $pvz['flag-white'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_pvz WHERE status='flag-white'")->fetchField();
     $pvz['refunded'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_pvz WHERE status='refunded'")->fetchField();
     $pvz['all'] = $model->query("SELECT COUNT(*) FROM shop_deliveryshop_pvz")->fetchField();
     $this->view->assign('cities', $city);
     $this->view->assign('pvz', $pvz);
 }
开发者ID:quadrodesign,项目名称:deliveryshop,代码行数:30,代码来源:shopDeliveryshopPluginBackendDisplay.action.php

示例6: execute

 public function execute()
 {
     // only allowed to global admin
     if (!wa()->getUser()->getRights('webasyst', 'backend')) {
         throw new waRightsException('Access denied.');
     }
     $collection = new contactsCollection('users/all');
     $group = null;
     $memberIds = array();
     if ($id = waRequest::get('id')) {
         $group_model = new waGroupModel();
         $group = $group_model->getById($id);
     }
     if ($group) {
         $user_groups_model = new waUserGroupsModel();
         $memberIds = $user_groups_model->getContactIds($id);
     }
     $users = $collection->getContacts('id,name');
     // array(id => array(id=>...,name=>...))
     $members = array();
     foreach ($memberIds as $mid) {
         if (isset($users[$mid])) {
             $members[$mid] = $users[$mid];
             unset($users[$mid]);
         }
     }
     usort($members, array($this, '_cmp'));
     usort($users, array($this, '_cmp'));
     $this->view->assign('group', $group);
     $this->view->assign('notIncluded', $users);
     $this->view->assign('members', $members);
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:32,代码来源:contactsGroupsEditor.action.php

示例7: saveAction

 public function saveAction()
 {
     $plugin_id = waRequest::get('id');
     if (!$plugin_id) {
         throw new waException(_ws("Can't save plugin settings: unknown plugin id"));
     }
     $namespace = $this->getAppId() . '_' . $plugin_id;
     /**
      * @var shopPlugin $plugin
      */
     $plugin = waSystem::getInstance()->getPlugin($plugin_id);
     $settings = (array) $this->getRequest()->post($namespace);
     $files = waRequest::file($namespace);
     $settings_defenitions = $plugin->getSettings();
     foreach ($files as $name => $file) {
         if (isset($settings_defenitions[$name])) {
             $settings[$name] = $file;
         }
     }
     try {
         $response = $plugin->saveSettings($settings);
         $response['message'] = _w('Saved');
         $this->displayJson($response);
     } catch (Exception $e) {
         $this->setError($e->getMessage());
         $this->displayJson(array(), $e->getMessage());
     }
 }
开发者ID:Rupreht,项目名称:webasyst-framework,代码行数:28,代码来源:waPlugins.actions.php

示例8: execute

 public function execute()
 {
     $plugin_id = waRequest::get('id');
     if (!$plugin_id) {
         throw new waException(_ws("Can't save plugin settings: unknown plugin id"));
     }
     $namespace = 'photos_' . $plugin_id;
     /**
      * @var photosPlugin $plugin
      */
     $plugin = waSystem::getInstance()->getPlugin($plugin_id);
     $settings = (array) $this->getRequest()->post($namespace);
     $files = waRequest::file($namespace);
     $settings_defenitions = $plugin->getSettings();
     foreach ($files as $name => $file) {
         if (isset($settings_defenitions[$name])) {
             $settings[$name] = $file;
         }
     }
     try {
         $plugin->saveSettings($settings);
     } catch (Exception $e) {
         $this->errors = $e->getMessage();
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:25,代码来源:photosPluginsSave.controller.php

示例9: execute

 public function execute()
 {
     $app_id = waRequest::get('app_id');
     $app = wa()->getAppInfo($app_id);
     $this->view->assign('items', $this->getItems($app_id));
     $this->view->assign('app', $app);
     $domain = siteHelper::getDomain();
     $routes = wa()->getRouting()->getByApp($app_id, $domain);
     if ($routes) {
         $event_params = array('app_id' => $app_id, 'routes' => $routes);
         $result = wa($app_id)->event(array($app_id, 'personal.settings'), $event_params);
         if (!empty($result[$app_id])) {
             $this->view->assign('personal_settings', $result[$app_id]);
         }
         $domain = siteHelper::getDomain();
         $domain_config_path = $this->getConfig()->getConfigPath('domains/' . $domain . '.php');
         if (file_exists($domain_config_path)) {
             $domain_config = (include $domain_config_path);
         } else {
             $domain_config = array();
         }
     }
     $this->view->assign('domain_url', 'http://' . $domain);
     $this->view->assign('settled', $routes ? true : false);
     $this->view->assign('enabled', !isset($domain_config['personal'][$app_id]) || $domain_config['personal'][$app_id]);
     $this->template = wa()->getAppPath($this->getTemplate(), 'site');
 }
开发者ID:Favorskij,项目名称:webasyst-framework,代码行数:27,代码来源:sitePersonalApp.action.php

示例10: dispatch

 public function dispatch()
 {
     if ($this->system->getEnv() == 'frontend') {
         $module = 'frontend';
     } else {
         $module = waRequest::get($this->options['module'], $this->system->getEnv());
     }
     $module = waRequest::param('module', $module);
     $action = waRequest::param('action', waRequest::get($this->options['action']));
     $plugin = waRequest::param('plugin', waRequest::get('plugin', ''));
     // event init
     if (!waRequest::request('background_process')) {
         if (method_exists($this->system->getConfig(), 'onInit')) {
             $this->system->getConfig()->onInit();
         }
     }
     if ($widget = waRequest::param('widget')) {
         $this->executeWidget($widget, $action);
     } elseif ($this->system->getEnv() == 'backend') {
         $url = explode("/", $this->system->getConfig()->getRequestUrl(true));
         if (isset($url[2]) && isset($url[3]) && $url[2] == 'widgets') {
             $this->executeWidget($url[3], $action);
         } else {
             $this->execute($plugin, $module, $action);
         }
     } else {
         $this->execute($plugin, $module, $action);
     }
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:29,代码来源:waFrontController.class.php

示例11: execute

 public function execute()
 {
     $hash = $this->get('hash');
     $collection = new shopProductsCollection($hash);
     $offset = waRequest::get('offset', 0, 'int');
     if ($offset < 0) {
         throw new waAPIException('invalid_param', 'Param offset must be greater than or equal to zero');
     }
     $limit = waRequest::get('limit', 100, 'int');
     if ($limit < 0) {
         throw new waAPIException('invalid_param', 'Param limit must be greater than or equal to zero');
     }
     if ($limit > 1000) {
         throw new waAPIException('invalid_param', 'Param limit must be less or equal 1000');
     }
     $this->response['count'] = $collection->count();
     $this->response['offset'] = $offset;
     $this->response['limit'] = $limit;
     $this->response['products'] = array_values($collection->getProducts('*', $offset, $limit));
     $image_size = wa('shop')->getConfig()->getImageSize('thumb');
     foreach ($this->response['products'] as &$p) {
         if ($p['image_id']) {
             $p['image_url'] = shopImage::getUrl(array('id' => $p['image_id'], 'product_id' => $p['id'], 'ext' => $p['ext']), $image_size, true);
         }
     }
     unset($p);
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:27,代码来源:shop.product.search.method.php

示例12: execute

 public function execute()
 {
     $type = waRequest::get('type', '', waRequest::TYPE_STRING_TRIM);
     $parent_id = waRequest::get('parent_id', 0, waRequest::TYPE_INT);
     if ($parent_id) {
         $category_model = new shopCategoryModel();
         $parent = $category_model->getById($parent_id);
     }
     $this->template = 'DialogProduct' . ucfirst($type) . 'Create';
     $this->view->assign(array('type' => $type, 'parent' => $parent_id ? $parent : array()));
     if ($type == 'category') {
         $tag_model = new shopTagModel();
         $stuff = '%category_url%';
         $frontend_url = wa()->getRouteUrl('/frontend/category', array('category_url' => $stuff), true);
         $pos = strrpos($frontend_url, $stuff);
         $fontend_base_url = $pos !== false ? rtrim(substr($frontend_url, 0, $pos), '/') . '/' : $frontend_url;
         $feature_model = new shopFeatureModel();
         $features = $feature_model->getFeatures('selectable', 1);
         $features += $feature_model->getFeatures('type', 'boolean');
         $features = $feature_model->getValues($features);
         $this->view->assign(array('cloud' => $tag_model->getCloud(), 'currency' => wa()->getConfig()->getCurrency(), 'frontend_base_url' => $fontend_base_url, 'lang' => substr(wa()->getLocale(), 0, 2), 'features' => $features));
     } else {
         if ($type == 'set') {
             $this->view->assign('default_count', $this->set_dynamic_default_count);
         }
     }
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:27,代码来源:shopDialogProductListCreate.action.php

示例13: execute

 public function execute()
 {
     $product_id = (int) waRequest::get('id');
     $product = new shopProduct($product_id);
     $type_model = new shopTypeModel();
     $type = $type_model->getById($product['type_id']);
     if ($product['cross_selling'] === null) {
         $product['cross_selling'] = $type['cross_selling'] ? 1 : 0;
     }
     if ($product['upselling'] === null) {
         $product['upselling'] = $type['upselling'];
     }
     // if manually
     if ($product['cross_selling'] == 2 || $product['upselling'] == 2) {
         $related_model = new shopProductRelatedModel();
         $related = $related_model->getAllRelated($product_id);
     } else {
         $related = array();
     }
     if ($type['upselling']) {
         $type_upselling_model = new shopTypeUpsellingModel();
         $data = $type_upselling_model->getByType($type['id']);
         $type['upselling_html'] = shopSettingsRecommendationsAction::getConditionHTML($data);
     }
     if ($type['cross_selling'] && substr($type['cross_selling'], 0, 9) == 'category/') {
         $category_model = new shopCategoryModel();
         $type['category'] = $category_model->getById(substr($type['cross_selling'], 9));
     }
     $this->view->assign(array('type' => $type, 'product' => $product, 'related' => $related));
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:30,代码来源:shopProductRelated.action.php

示例14: execute

 public function execute()
 {
     $messages = installerMessage::getInstance()->handle(waRequest::get('msg'));
     installerHelper::checkUpdates($messages);
     if ($m = $this->view->getVars('messages')) {
         $messages = array_merge($m, $messages);
     }
     $this->view->assign('messages', $messages);
     $plugins = 'wa-plugins/payment';
     $apps = wa()->getApps();
     if (isset($apps['shop'])) {
         $plugins = 'shop';
     } else {
         ksort($apps);
         foreach ($apps as $app => $info) {
             if (!empty($info['plugins'])) {
                 $plugins = $app;
                 break;
             }
         }
     }
     $model = new waAppSettingsModel();
     $this->view->assign('update_counter', $model->get($this->getApp(), 'update_counter'));
     $this->view->assign('module', waRequest::get('module', 'backend'));
     $this->view->assign('default_query', array('plugins' => $plugins));
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:26,代码来源:installerBackend.layout.php

示例15: execute

 public function execute()
 {
     $parent_id = waRequest::get('parent_id');
     $category_model = new shopCategoryModel();
     $cats = $category_model->getTree($parent_id, waRequest::get('depth', null, 'int'));
     $stack = array();
     $result = array();
     foreach ($cats as $c) {
         $c['categories'] = array();
         // Number of stack items
         $l = count($stack);
         // Check if we're dealing with different levels
         while ($l > 0 && $stack[$l - 1]['depth'] >= $c['depth']) {
             array_pop($stack);
             $l--;
         }
         // Stack is empty (we are inspecting the root)
         if ($l == 0) {
             // Assigning the root node
             $i = count($result);
             $result[$i] = $c;
             $stack[] =& $result[$i];
         } else {
             // Add node to parent
             $i = count($stack[$l - 1]['categories']);
             $stack[$l - 1]['categories'][$i] = $c;
             $stack[] =& $stack[$l - 1]['categories'][$i];
         }
     }
     $this->response = $result;
     $this->response['_element'] = 'category';
 }
开发者ID:Lazary,项目名称:webasyst,代码行数:32,代码来源:shop.category.getTree.method.php


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