本文整理匯總了PHP中vRequest::getRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP vRequest::getRequest方法的具體用法?PHP vRequest::getRequest怎麽用?PHP vRequest::getRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vRequest
的用法示例。
在下文中一共展示了vRequest::getRequest方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: disableDangerousTools
/**
*
* Task for disabling dangerous database tools, used after install
* @author Max Milbers
*/
public function disableDangerousTools(){
$data = vRequest::getRequest();
$config = VmModel::getInstance('config', 'VirtueMartModel');
$config->setDangerousToolsOff();
$this->display();
}
示例2: saveJS
function saveJS()
{
vRequest::vmCheckToken();
$model = VmModel::getModel($this->_cname);
$data = vRequest::getRequest();
$id = $model->store($data);
$errors = $model->getErrors();
if (empty($errors)) {
$msg = vmText::sprintf('COM_VIRTUEMART_STRING_SAVED', $this->mainLangKey);
$type = 'message';
} else {
$type = 'error';
}
foreach ($errors as $error) {
$msg = $error . '<br />';
}
$json['msg'] = $msg;
if ($id) {
$json['product_id'] = $id;
$json['ok'] = 1;
} else {
$json['ok'] = 0;
}
echo json_encode($json);
jExit();
}
示例3: save
function save($data = 0)
{
$fileModel = VmModel::getModel('media');
//Now we try to determine to which this media should be long to
$data = array_merge(vRequest::getRequest(), vRequest::get('media'));
//$data['file_title'] = vRequest::getVar('file_title','','post','STRING',JREQUEST_ALLOWHTML);
if (!empty($data['file_description'])) {
$data['file_description'] = JComponentHelper::filterText($data['file_description']);
//vRequest::filter(); vRequest::getHtml('file_description','');
}
/*$data['media_action'] = vRequest::getCmd('media[media_action]');
$data['media_attributes'] = vRequest::getCmd('media[media_attributes]');
$data['file_type'] = vRequest::getCmd('media[file_type]');*/
if (empty($data['file_type'])) {
$data['file_type'] = $data['media_attributes'];
}
$msg = '';
if ($id = $fileModel->store($data)) {
$msg = vmText::_('COM_VIRTUEMART_FILE_SAVED_SUCCESS');
}
$cmd = vRequest::getCmd('task');
if ($cmd == 'apply') {
$redirection = 'index.php?option=com_virtuemart&view=media&task=edit&virtuemart_media_id=' . $id;
} else {
$redirection = 'index.php?option=com_virtuemart&view=media';
}
$this->setRedirect($redirection, $msg);
}
示例4: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
$data = vRequest::getRequest();
$data['calc_name'] = vRequest::getHtml('calc_name', '');
$data['calc_descr'] = vRequest::getHtml('calc_descr', '');
parent::save($data);
}
示例5: save
/**
* Handle the save task
* Checks already in the controller the rights and sets the data by filtering the post
*
* @author Max Milbers
*/
function save($data = 0)
{
/* Load the data */
$data = vRequest::getRequest();
/* add the mf desc as html code */
$data['mf_desc'] = vRequest::getHtml('mf_desc', '');
parent::save($data);
}
示例6: save
/**
* We want to allow html in the descriptions.
*
* @author Max Milbers
*/
function save($data = 0)
{
$data = vRequest::getRequest();
// TODO disallow shipment_name as HTML
$data['shipment_name'] = vRequest::getHtml('shipment_name', '');
$data['shipment_desc'] = vRequest::getHtml('shipment_desc', '');
parent::save($data);
}
示例7: save
function save($data = 0)
{
$data = vRequest::getRequest();
// TODO disallow html in paym_name ?
$data['payment_name'] = vRequest::getHtml('payment_name', '');
$data['payment_desc'] = vRequest::getHtml('payment_desc', '');
parent::save($data);
}
示例8: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
$data = vRequest::getRequest();
$data['calc_name'] = vRequest::getHtml('calc_name', '');
$data['calc_descr'] = vRequest::getHtml('calc_descr', '');
if (isset($data['params'])) {
$data['params'] = vRequest::getHtml('params', '');
}
parent::save($data);
}
示例9: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
//ACL
if (!JFactory::getUser()->authorise('vm.category.edit', 'com_virtuemart')) {
JFactory::getApplication()->redirect('index.php?option=com_virtuemart', vmText::_('JERROR_ALERTNOAUTHOR'), 'error');
}
$data = vRequest::getRequest();
$data['category_name'] = vRequest::getHtml('category_name', '');
$data['category_description'] = vRequest::getHtml('category_description', '');
parent::save($data);
}
示例10: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
//ACL
if (!vmAccess::manager('category.edit')) {
JFactory::getApplication()->redirect('index.php?option=com_tsmart', tsmText::_('JERROR_ALERTNOAUTHOR'), 'error');
}
$data = vRequest::getRequest();
$data['category_name'] = vRequest::getHtml('category_name', '');
$data['category_description'] = vRequest::getHtml('category_description', '');
parent::save($data);
}
示例11: display
/**
* Override of display
*
* @return JController A JController object to support chaining.
* @since 11.1
*/
public function display($cachable = false, $urlparams = false)
{
if (VmConfig::get('use_as_catalog', 0)) {
// Get a continue link
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId();
$categoryLink = '';
if ($virtuemart_category_id) {
$categoryLink = '&virtuemart_category_id=' . $virtuemart_category_id;
}
$ItemId = shopFunctionsF::getLastVisitedItemId();
$ItemIdLink = '';
if ($ItemId) {
$ItemIdLink = '&Itemid=' . $ItemId;
}
$continue_link = JRoute::_('index.php?option=com_virtuemart&view=category' . $categoryLink . $ItemIdLink, FALSE);
$app = JFactory::getApplication();
$app->redirect($continue_link, 'This is a catalogue, you cannot acccess the cart');
}
$document = JFactory::getDocument();
$viewType = $document->getType();
$viewName = vRequest::getCmd('view', $this->default_view);
$viewLayout = vRequest::getCmd('layout', 'default');
$view = $this->getView($viewName, $viewType, '', array('layout' => $viewLayout));
$view->assignRef('document', $document);
$cart = VirtueMartCart::getCart();
$cart->order_language = vRequest::getString('order_language', $cart->order_language);
$cart->prepareCartData();
$request = vRequest::getRequest();
$task = vRequest::getCmd('task');
if (($task == 'confirm' or isset($request['confirm'])) and !$cart->getInCheckOut()) {
$cart->confirmDone();
$view = $this->getView('cart', 'html');
$view->setLayout('order_done');
$cart->_fromCart = false;
$view->display();
return true;
} else {
//$cart->_inCheckOut = false;
$redirect = (isset($request['checkout']) or $task == 'checkout');
$cart->_inConfirm = false;
$cart->checkoutData($redirect);
}
$cart->_fromCart = false;
$view->display();
return $this;
}
示例12: save
/**
* Handle the save task
* Checks already in the controller the rights todo so and sets the data by filtering the post
*
* @author Max Milbers
*/
function save($data = 0)
{
$document = JFactory::getDocument();
$viewType = $document->getType();
$view = $this->getView('user', $viewType);
$_currentUser = JFactory::getUser();
// TODO sortout which check is correctt.....
// if (!$_currentUser->authorise('administration', 'manage', 'components', 'com_users')) {
if (!$_currentUser->authorise('core.edit', 'com_users')) {
$msg = vmText::_(_NOT_AUTH);
} else {
$model = VmModel::getModel('user');
$data = vRequest::getRequest();
// Store multiple selectlist entries as a ; separated string
if (array_key_exists('vendor_accepted_currencies', $data) && is_array($data['vendor_accepted_currencies'])) {
$data['vendor_accepted_currencies'] = implode(',', $data['vendor_accepted_currencies']);
}
// TODO disallow vendor_store_name as HTML ?
$data['vendor_store_name'] = vRequest::getHtml('vendor_store_name');
$data['vendor_store_desc'] = vRequest::getHtml('vendor_store_desc');
$data['vendor_terms_of_service'] = vRequest::getHtml('vendor_terms_of_service');
$data['vendor_legal_info'] = vRequest::getHtml('vendor_legal_info');
$data['vendor_letter_css'] = vRequest::getHtml('vendor_letter_css');
$data['vendor_letter_header_html'] = vRequest::getHtml('vendor_letter_header_html');
$data['vendor_letter_footer_html'] = vRequest::getHtml('vendor_letter_footer_html');
$ret = $model->store($data);
if (!$ret) {
$msg = '';
} else {
$msg = $ret['message'];
}
}
$cmd = vRequest::getCmd('task');
$lastTask = vRequest::getCmd('last_task');
if ($cmd == 'apply') {
if ($lastTask == 'editshop') {
$redirection = 'index.php?option=com_virtuemart&view=user&task=editshop';
} else {
$redirection = 'index.php?option=com_virtuemart&view=user&task=edit&virtuemart_user_id[]=' . $ret['newId'];
}
} else {
if ($lastTask == 'editshop') {
$redirection = 'index.php?option=com_virtuemart';
} else {
$redirection = 'index.php?option=com_virtuemart&view=user';
}
}
// $this->setRedirect($redirection, $ret['message']);
$this->setRedirect($redirection);
}
示例13: save
/**
* Generic save task
*
* @author Max Milbers
* @param post $data sometimes we just want to override the data to process
*/
function save($data = 0)
{
vRequest::vmCheckToken();
$input = JFactory::getApplication()->input;
if ($data === 0) {
$data = vRequest::getRequest();
}
$model = tmsModel::getModel($this->_cname);
$id = $model->store($data);
$msg = 'failed';
if (!empty($id)) {
$msg = tsmText::sprintf('com_tsmart_STRING_SAVED', $this->mainLangKey);
$type = 'message';
} else {
$type = 'error';
}
$redir = $this->redirectPath;
if (JFactory::getApplication()->isSite()) {
$redir .= '';
}
$task = vRequest::getCmd('task');
$show_in_parent_window = $data['show_in_parent_window'];
if ($show_in_parent_window == 1 & $task == 'save') {
$redir .= '&task=edit&close_window_children=1&show_in_parent_window=1&' . $this->_cidName . '[]=' . $id;
} elseif ($show_in_parent_window == 1 & $task == 'apply') {
$redir .= '&task=edit&show_in_parent_window=1&' . $this->_cidName . '[]=' . $id;
} elseif ($show_in_parent_window == 1 & $task == 'apply') {
$redir .= '&task=edit&show_in_parent_window=1&' . $this->_cidName . '[]=' . $id;
} else {
if ($task == 'apply') {
$redir .= '&task=edit&' . $this->_cidName . '[]=' . $id;
}
}
$this->setRedirect($redir, $msg, $type);
}
示例14: add
/**
* Add a product to the cart
*
* @author Max Milbers
* @access public
*/
public function add($virtuemart_product_ids = null, &$errorMsg = '')
{
$updateSession = false;
$post = vRequest::getRequest();
if (empty($virtuemart_product_ids)) {
$virtuemart_product_ids = vRequest::getInt('virtuemart_product_id');
//is sanitized then
}
if (empty($virtuemart_product_ids)) {
vmWarn('COM_VIRTUEMART_CART_ERROR_NO_PRODUCT_IDS');
return false;
}
$products = array();
$this->_productAdded = true;
$productModel = VmModel::getModel('product');
$customFieldsModel = VmModel::getModel('customfields');
//Iterate through the prod_id's and perform an add to cart for each one
foreach ($virtuemart_product_ids as $p_key => $virtuemart_product_id) {
$product = false;
$updateSession = true;
$productData = array();
if (empty($virtuemart_product_id)) {
vmWarn('Product could not be added with virtuemart_product_id = 0');
return false;
} else {
$productData['virtuemart_product_id'] = (int) $virtuemart_product_id;
}
if (!empty($post['quantity'][$p_key])) {
$productData['quantity'] = (int) $post['quantity'][$p_key];
} else {
continue;
}
if (!empty($post['customProductData'][$virtuemart_product_id])) {
//$productData['customProductData']
$customProductData = $post['customProductData'][$virtuemart_product_id];
} else {
$customProductData = array();
}
//Now we check if the delivered customProductData is correct and add missing
$product = $productModel->getProduct($virtuemart_product_id, true, false, true, $productData['quantity']);
if (VmConfig::get('multixcart', 0) == 'byproduct') {
if (empty($this->vendorId)) {
$this->vendorId = $product->virtuemart_vendor_id;
}
if (!empty($this->vendorId) and $this->vendorId != $product->virtuemart_vendor_id) {
//Product of another vendor recognised, for now we just return false,
//later we will create here another cart (multicart)
return false;
}
}
$product->customfields = $customFieldsModel->getCustomEmbeddedProductCustomFields($product->allIds, 0, 1);
$customProductDataTmp = array();
// Some customfields may prevent the product being added to the cart
$customFiltered = false;
foreach ($product->customfields as $customfield) {
if (!class_exists('vmCustomPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
}
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JDispatcher::getInstance();
$addToCartReturnValues = $dispatcher->trigger('plgVmOnAddToCartFilter', array(&$product, &$customfield, &$customProductData, &$customFiltered));
if (!$customFiltered && $customfield->is_input == 1) {
if (isset($customProductData[$customfield->virtuemart_custom_id][$customfield->virtuemart_customfield_id])) {
if (is_array($customProductData[$customfield->virtuemart_custom_id][$customfield->virtuemart_customfield_id])) {
if (!class_exists('vmFilter')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'vmfilter.php';
}
foreach ($customProductData[$customfield->virtuemart_custom_id][$customfield->virtuemart_customfield_id] as &$customData) {
$value = vmFilter::hl($customData, array('deny_attribute' => '*'));
//to strong
/* $value = preg_replace('@<[\/\!]*?[^<>]*?>@si','',$value);//remove all html tags */
//lets use instead
$value = JComponentHelper::filterText($value);
$value = (string) preg_replace('#on[a-z](.+?)\\)#si', '', $value);
//replace start of script onclick() onload()...
$value = trim(str_replace('"', ' ', $value), "'");
$customData = (string) preg_replace('#^\'#si', '', $value);
}
}
if (!isset($customProductDataTmp[$customfield->virtuemart_custom_id])) {
$customProductDataTmp[$customfield->virtuemart_custom_id] = array();
}
$customProductDataTmp[$customfield->virtuemart_custom_id][$customfield->virtuemart_customfield_id] = $customProductData[$customfield->virtuemart_custom_id][$customfield->virtuemart_customfield_id];
} else {
if (isset($customProductData[$customfield->virtuemart_custom_id])) {
$customProductDataTmp[$customfield->virtuemart_custom_id] = $customProductData[$customfield->virtuemart_custom_id];
vmdebug('my customp product data ', $customProductData[$customfield->virtuemart_custom_id]);
}
}
} else {
if (!isset($customProductDataTmp[$customfield->virtuemart_custom_id])) {
$customProductDataTmp[$customfield->virtuemart_custom_id] = array();
} else {
if (!is_array($customProductDataTmp[$customfield->virtuemart_custom_id])) {
//.........這裏部分代碼省略.........
示例15: defined
* @subpackage Modules
* @license GNU/GPL, see LICENSE.php
* @link http://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module
* mod_helloworld is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
// No direct access
defined('_JEXEC') or die;
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
JLoader::import('expressly.vendor.autoload');
JLoader::import('expressly.ExpresslyMerchantProvider');
// require helper file
JLoader::register('ExpresslyHelper', JPATH_SITE . DS . "components" . DS . "com_expressly" . DS . 'helpers' . DS . 'expressly.php');
$request = vRequest::getRequest();
$task = vRequest::getCmd('task');
if ($task == 'confirm' || isset($request['confirm'])) {
// TODO: Need to create MerchantType VIRTUEMART
/*$client = new \Expressly\Client(\Expressly\Entity\MerchantType::WOOCOMMERCE);
$app = $client->getApp();
$app['merchant.provider'] = $app->share(function () {
return new ExpresslyMerchantProvider();
});
$app['version'] = $app->share(function () {
return 'v2';
});
$merchant = $app['merchant.provider']->getMerchant();
$user = JFactory::getUser();