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


PHP Request::getValueByKey方法代码示例

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


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

示例1: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $key = $request->getValueByKey('key');
     $passwd = array('passwd' => $request->getValueByKey('new_password'), 're-type' => $request->getValueByKey('retype_password'));
     $account_name = modApiFunc('Customer_Account', 'getAccountByActivationKey', $key);
     $errors = array();
     if ($account_name != null) {
         $validator =& $application->getInstance('CAValidator');
         if (!$validator->isValid('passwd', $passwd)) {
             $errors[] = 'E_INVALID_PASSWD';
         }
     }
     if (!empty($errors)) {
         modApiFunc('Session', 'set', 'RegisterErrors', $errors);
         $request->setView('CustomerNewPassword');
         $request->setKey('key', $key);
     } else {
         modApiFunc('Session', 'set', 'ResultMessage', 'MSG_PASSWD_UPDATED');
         modApiFunc('Customer_Account', 'dropActivationKey', $account_name, 'customer_account');
         $obj =& $application->getInstance('CCustomerInfo', $account_name);
         $obj->setPersonInfo(array(array('Status', 'A', 'base')));
         $obj->changePassword($passwd['passwd']);
         $obj->SignIn();
         $request->setView('CustomerAccountHome');
     }
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:29,代码来源:save_account_password.php

示例2: OrderList

 function OrderList()
 {
     global $application;
     #check if fatal errors of the block tag exist
     $this->NoView = false;
     if ($application->issetBlockTagFatalErrors("OrderList")) {
         $this->NoView = true;
     }
     $settings = modApiFunc('Customer_Account', 'getSettings');
     if ($settings['CHECKOUT_TYPE'] == CHECKOUT_TYPE_QUICK) {
         $this->NoView = true;
     }
     loadCoreFile('html_form.php');
     $this->customer_obj = null;
     $this->incoming_filter = null;
     $email = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     if ($email !== null) {
         $this->customer_obj =& $application->getInstance('CCustomerInfo', $email);
         $request = new Request();
         $filter = $request->getValueByKey('filter');
         if ($filter != null) {
             $orders_search_filter = null;
             if ($filter == 'id') {
                 $orders_search_filter = array('type' => 'id', 'order_status' => ORDER_STATUS_ALL, 'order_id' => intval($request->getValueByKey('order_id')));
             } elseif ($filter != 'custom' and defined('ORDER_STATUS_' . _ml_strtoupper($filter))) {
                 $orders_search_filter = array('type' => 'quick', 'order_status' => constant('ORDER_STATUS_' . _ml_strtoupper($filter)));
             } elseif ($filter == 'custom') {
                 $orders_search_filter = array('type' => 'custom', 'order_status' => $request->getValueByKey('order_status'), 'order_payment_status' => $request->getValueByKey('order_payment_status'), 'day_from' => $request->getValueByKey('day_from'), 'month_from' => $request->getValueByKey('month_from'), 'year_from' => $request->getValueByKey('year_from'), 'day_to' => $request->getValueByKey('day_to'), 'month_to' => $request->getValueByKey('month_to'), 'year_to' => $request->getValueByKey('year_to'));
             }
             $this->incoming_filter = $orders_search_filter;
             $this->customer_obj->setOrdersHistoryFilter($this->incoming_filter);
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:34,代码来源:customer_order_list_cz.php

示例3: ManageCustomFields

 function ManageCustomFields()
 {
     global $application;
     loadCoreFile('html_form.php');
     $this->MessageResources =& $application->getInstance('MessageResources');
     $this->TemplateFiller = $application->getInstance('TmplFiller');
     $this->HtmlForm = new HtmlForm();
     $request = new Request();
     $this->mode = isset($_POST["mode"]) ? $_POST["mode"] : $request->getValueByKey("mode");
     $this->var_id = isset($_POST["variant_id"]) ? $_POST["variant_id"] : $request->getValueByKey("variant_id");
     $this->attr_id = isset($_POST["attribute_id"]) ? $_POST["attribute_id"] : $request->getValueByKey("attribute_id");
     $custom_fields_data = modApiFunc("Checkout", 'getPersonCustomAttributes', $this->var_id);
     if ($this->attr_id == null && $this->mode != "add") {
         if (count($custom_fields_data) != 0) {
             $this->attr_id = $custom_fields_data[0]['person_attribute_id'];
         }
     }
     if ($this->mode == null) {
         $this->mode = "edit";
     }
     if (count($custom_fields_data) == 0) {
         $this->mode = "add";
     }
     if ($this->attr_id != null) {
         $this->field_data = modAPIFunc("Checkout", "getPersonAttributeData", $this->var_id, $this->attr_id);
     }
     if (modApiFunc("Session", "is_set", "FormData")) {
         $this->field_data['postdata'] = modApiFunc("Session", "get", "FormData");
         modApiFunc("Session", "un_set", "FormData");
     }
     if (modApiFunc("Session", "is_set", "UpdateParent") && modApiFunc("Session", "get", "UpdateParent") == true) {
         modApiFunc("Session", "un_set", "UpdateParent");
         $application->UpdateParent();
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:35,代码来源:checkout-manage-custom-fields.php

示例4: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $account_name = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     $errors = array();
     if ($account_name != null) {
         $current_password = $request->getValueByKey('current_password');
         if (!modApiFunc('Customer_Account', 'isCorrectAccountAndPasswd', $account_name, $current_password)) {
             $errors[] = 'E_INVALID_CURRENT_PASSWD';
         } else {
             $validator =& $application->getInstance('CAValidator');
             $passwd = array('passwd' => $request->getValueByKey('new_password'), 're-type' => $request->getValueByKey('retype_password'));
             if (!$validator->isValid('passwd', $passwd)) {
                 $errors[] = 'E_INVALID_PASSWD';
             }
         }
         if (!empty($errors)) {
             modApiFunc('Session', 'set', 'RegisterErrors', $errors);
         } else {
             modApiFunc('Session', 'set', 'ResultMessage', 'MSG_PASSWD_UPDATED');
             $obj =& $application->getInstance('CCustomerInfo', $account_name);
             $obj->changePassword($passwd['passwd']);
         }
     }
     $request->setView('CustomerChangePassword');
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:28,代码来源:change_account_password.php

示例5: onAction

 function onAction()
 {
     $r = new Request();
     $to_cc = $r->getValueByKey('to_currency_code');
     $from_cc = $r->getValueByKey('from_currency_code');
     $base = $r->getValueByKey('base_rate');
     $rate = trim($base);
     $errors = array();
     if (modApiFunc('Currency_Converter', 'doesManRateExists', $from_cc, $to_cc)) {
         $errors[] = 'E_MAN_RATE_EXISTS';
     }
     #
     # base rate validation. should be integer or decimal value
     #
     if ($this->validateDecimal($rate) != true) {
         $errors[] = 'E_MAN_INVALID_RATE';
     }
     if (empty($errors)) {
         if (!modApiFunc('Currency_Converter', 'addManualRate', $from_cc, $to_cc, $rate)) {
             $errors[] = 'E_MAN_RATE_NOT_ADDED';
         }
     }
     if (empty($errors)) {
         modApiFunc('Session', 'set', 'ResultMessage', 'MSG_MAN_RATE_ADDED');
     } else {
         modApiFunc('Session', 'set', 'Errors', $errors);
     }
     $r->setView('PopupWindow');
     $r->setKey('page_view', 'CurrencyRateEditor');
     global $application;
     $application->redirect($r);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:32,代码来源:add_ccrate.php

示例6: OrderSearchByIdForm

 function OrderSearchByIdForm()
 {
     global $application;
     #check if fatal errors of the block tag exist
     $this->NoView = false;
     if ($application->issetBlockTagFatalErrors("OrderSearchByIdForm")) {
         $this->NoView = true;
     }
     $settings = modApiFunc('Customer_Account', 'getSettings');
     if ($settings['CHECKOUT_TYPE'] == CHECKOUT_TYPE_QUICK) {
         $this->NoView = true;
     }
     loadCoreFile('html_form.php');
     $this->customer_obj = null;
     $this->incoming_filter = null;
     $email = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     if ($email !== null) {
         $this->customer_obj =& $application->getInstance('CCustomerInfo', $email);
         $request = new Request();
         $filter = $request->getValueByKey('filter');
         if ($filter != null) {
             $orders_search_filter = null;
             if ($filter == 'id') {
                 $o_id = $request->getValueByKey('order_id');
                 if (!$o_id || !is_int($o_id)) {
                     return;
                 }
                 $orders_search_filter = array('type' => 'id', 'order_status' => ORDER_STATUS_ALL, 'order_id' => intval($o_id));
             }
             $this->incoming_filter = $orders_search_filter;
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:33,代码来源:customer_order_search_by_id_form_cz.php

示例7: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $category_id = $request->getValueByKey('category_id');
     $tree_id = $request->getValueByKey('tree_id');
     $bs_ids = $request->getValueByKey('to_save');
     modApiFunc('Bestsellers_API', 'deleteAllBSLinksFromCategory', $category_id);
     $errors = array();
     if ($bs_ids != null) {
         if (!modApiFunc('Bestsellers_API', 'addBSLinksToCategory', $category_id, $bs_ids)) {
             $errors[] = 'E_BS_NOT_SAVED';
         }
     }
     if (empty($errors)) {
         $sets = $request->getValueByKey('sets');
         $sets['BS_FROM_STAT_PERIOD'] = $sets['BS_FROM_STAT_PERIOD']['count'] * $sets['BS_FROM_STAT_PERIOD']['type'];
         modApiFunc('Bestsellers_API', 'updateSettings', $category_id, $sets);
     }
     if (empty($errors)) {
         modApiFunc('Session', 'set', 'ResultMessage', 'MSG_BS_SAVED');
     } else {
         modApiFunc('Session', 'set', 'Errors', $errors);
     }
     $request->setView('PopupWindow');
     // $request->setView('BS_LinksList');
     $request->setKey('page_view', 'BS_LinksList');
     $request->setKey('category_id', $category_id);
     $request->setKey('tree_id', $tree_id);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:31,代码来源:save_bs_links_and_settings.php

示例8: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $category_id = $request->getValueByKey('category_id');
     $tree_id = $request->getValueByKey('tree_id');
     $fp_ids = $request->getValueByKey('to_save');
     modApiFunc('Featured_Products', 'deleteAllFPLinksFromCategory', $category_id);
     $errors = array();
     if ($fp_ids != null) {
         if (!modApiFunc('Featured_Products', 'addFPLinksToCategory', $category_id, $fp_ids)) {
             $errors[] = 'E_FP_NOT_SAVED';
         }
     }
     if (empty($errors)) {
         modApiFunc('Session', 'set', 'ResultMessage', 'MSG_FP_SAVED');
     } else {
         modApiFunc('Session', 'set', 'Errors', $errors);
     }
     $request->setView('PopupWindow');
     $request->setKey('page_view', 'FP_LinksList');
     $request->setKey('category_id', $category_id);
     $request->setKey('tree_id', $tree_id);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:25,代码来源:save_fp_links.php

示例9: OrderDownloadLinks

 function OrderDownloadLinks()
 {
     global $application;
     #check if fatal errors of the block tag exist
     $this->NoView = false;
     if ($application->issetBlockTagFatalErrors("OrderDownloadLinks")) {
         $this->NoView = true;
     }
     $settings = modApiFunc('Customer_Account', 'getSettings');
     if ($settings['CHECKOUT_TYPE'] == CHECKOUT_TYPE_QUICK) {
         $this->NoView = true;
     }
     $this->customer_obj = null;
     $this->order_id = null;
     $email = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     if ($email != null) {
         $this->customer_obj =& $application->getInstance('CCustomerInfo', $email);
         $request = new Request();
         $this->order_id = $request->getValueByKey('order_id');
         $this->order_product_id = $request->getValueByKey('order_product_id');
         $q_filter = array('type' => 'quick', 'order_status' => ORDER_STATUS_ALL);
         $this->customer_obj->setOrdersHistoryFilter($q_filter);
         if (!in_array($this->order_id, $this->customer_obj->getOrdersIDs())) {
             $this->order_id = null;
         }
         if ($this->order_id != null and $this->order_product_id != null) {
             $pids = modApiFunc('Checkout', 'getOrderProductsIDs', $this->order_id);
             if (!in_array($this->order_product_id, $pids)) {
                 $this->order_product_id = null;
             }
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:33,代码来源:customer_order_download_links_cz.php

示例10: OrderSearchForm

 function OrderSearchForm()
 {
     global $application;
     #check if fatal errors of the block tag exist
     $this->NoView = false;
     if ($application->issetBlockTagFatalErrors("OrderSearchForm")) {
         $this->NoView = true;
     }
     $settings = modApiFunc('Customer_Account', 'getSettings');
     if ($settings['CHECKOUT_TYPE'] == CHECKOUT_TYPE_QUICK) {
         $this->NoView = true;
     }
     loadCoreFile('html_form.php');
     $this->customer_obj = null;
     $this->incoming_filter = null;
     $email = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     if ($email !== null) {
         $this->customer_obj =& $application->getInstance('CCustomerInfo', $email);
         $request = new Request();
         $filter = $request->getValueByKey('filter');
         if ($filter != null) {
             $orders_search_filter = null;
             if ($filter == 'custom') {
                 $orders_search_filter = array('type' => 'custom', 'order_status' => $request->getValueByKey('order_status'), 'order_payment_status' => $request->getValueByKey('order_payment_status'), 'day_from' => $request->getValueByKey('day_from'), 'month_from' => $request->getValueByKey('month_from'), 'year_from' => $request->getValueByKey('year_from'), 'day_to' => $request->getValueByKey('day_to'), 'month_to' => $request->getValueByKey('month_to'), 'year_to' => $request->getValueByKey('year_to'));
             }
             $this->incoming_filter = $orders_search_filter;
         }
     }
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:29,代码来源:customer_order_search_form_cz.php

示例11: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $group_name = $request->getValueByKey('GroupName');
     $sort_order = $request->getValueByKey('SortOrder_hidden');
     if ($group_name != null and $sort_order != null) {
         $sort_order = explode("|", $sort_order);
         modApiFunc('Customer_Account', 'updateGroupAttrsSortOrder', $group_name, $sort_order);
     }
     modApiFunc('Session', 'set', 'ResultMessage', 'MSG_SORT_ORDER_UPDATED');
     $request->setView(CURRENT_REQUEST_URL);
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:14,代码来源:update_group_sort_order.php

示例12: onAction

 function onAction()
 {
     $request = new Request();
     $tree_str = $request->getValueByKey('tree_str');
     $tree_id = $request->getValueByKey('tree_id');
     $ctg_id = $request->getValueByKey('ctg_id');
     modApiFunc('Catalog', 'saveFullCategoriesStructure', $tree_str);
     modApiFunc('CProductListFilter', 'changeCurrentCategoryId', $ctg_id);
     global $_RESULT;
     loadClass('CategoriesBrowserDynamic');
     $cb_obj = new CategoriesBrowserDynamic(CB_MODE_MANAGE, $tree_id);
     $_RESULT['tree_json'] = $cb_obj->outputJSON();
     $_RESULT['ctg_id'] = modApiFunc('Catalog', 'getEditableCategoryID');
     $_RESULT['tree_id'] = $tree_id;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:15,代码来源:save_ctg_tree.php

示例13: onAction

 function onAction()
 {
     global $application;
     $request = new Request();
     $customers_ids = $request->getValueByKey('customers_ids');
     if ($customers_ids != null) {
         $customers_ids = explode('|', $customers_ids);
     } else {
         $customers_ids = array();
     }
     $errors = array();
     for ($i = 0; $i < count($customers_ids); $i++) {
         $account_name = modApiFunc('Customer_Account', 'getCustomerAccountNameByCustomerID', $customers_ids[$i]);
         if ($account_name == null) {
             continue;
         }
         $customer_obj =& $application->getInstance('CCustomerInfo', $account_name);
         if ($customer_obj->getPersonInfo('Status') != 'N') {
             continue;
         }
         $customer_obj->setPersonInfo(array(array('Status', 'A', 'base')));
         modApiFunc('EventsManager', 'throwEvent', 'AdminActivateCustomer', $account_name);
         modApiFunc('Customer_Account', 'dropActivationKey', $account_name, 'customer_account');
     }
     if (empty($errors)) {
         modApiFunc('Session', 'set', 'ResultMessage', 'MSG_CUSTOMERS_ACTIVATED');
     } else {
         modApiFunc('Session', 'set', 'Errors', $errors);
     }
     $request->setView('Customers');
     $application->redirect($request);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:32,代码来源:activate_customers_accounts.php

示例14: OrderInvoice

 function OrderInvoice()
 {
     global $application;
     #check if fatal errors of the block tag exist
     $this->NoView = false;
     if ($application->issetBlockTagFatalErrors("OrderInvoice")) {
         $this->NoView = true;
     }
     $settings = modApiFunc('Customer_Account', 'getSettings');
     if ($settings['CHECKOUT_TYPE'] == CHECKOUT_TYPE_QUICK) {
         $this->NoView = true;
     }
     $this->customer_obj = null;
     $this->order_id = null;
     $email = modApiFunc('Customer_Account', 'getCurrentSignedCustomer');
     if ($email != null) {
         $this->customer_obj =& $application->getInstance('CCustomerInfo', $email);
         $request = new Request();
         $this->order_id = $request->getValueByKey('order_id');
         $q_filter = array('type' => 'quick', 'order_status' => ORDER_STATUS_ALL);
         $this->customer_obj->setOrdersHistoryFilter($q_filter);
         if (!in_array($this->order_id, $this->customer_obj->getOrdersIDs())) {
             $this->order_id = null;
         }
     }
     $this->order_info_groups = array();
     $this->key_details = array('ID', 'Date', 'Status', 'PaymentStatus', 'PaymentMethod', 'PaymentProcessorOrderId', 'ShippingMethod', 'TrackId');
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:28,代码来源:customer_order_invoice_cz.php

示例15: onAction

 function onAction()
 {
     $request = new Request();
     $category_id = $request->getValueByKey('category_id');
     /*
      *       :
      *                                                     ,                     .
      *                                                         default
      *               AZ (                                 AZ).
      *
      *        :
      *                   Catalog::getProductListByGlobalFilter       ,
      *                                                                                      .
      *                                 default                     .
      */
     //              default
     loadClass('CProductListFilter');
     $f = new CProductListFilter();
     $params = $f->getProductListParamsObject();
     $params->category_id = $category_id;
     $params->select_mode_recursiveness = IN_CATEGORY_ONLY;
     //
     $products_array = modApiFunc('Catalog', 'getProductListByFilter', $params, RETURN_AS_ID_LIST);
     $products = array();
     if (!empty($products_array)) {
         foreach ($products_array as $pinfo) {
             $obj = new CProductInfo($pinfo['product_id']);
             $products[] = array('id' => $pinfo['product_id'], 'name' => $obj->getProductTagValue('Name'));
         }
     }
     global $_RESULT;
     $_RESULT['products'] = $products;
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:33,代码来源:ajax_get_plist.php


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