本文整理汇总了PHP中vRequest类的典型用法代码示例。如果您正苦于以下问题:PHP vRequest类的具体用法?PHP vRequest怎么用?PHP vRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: move
/**
* swap the ordering of a record in the Xref tables
* @param $direction , 1/-1 The increment to reorder by
*/
function move($direction, $where = '', $orderingkey = 0)
{
if (empty($this->_skey)) {
vmError('No secondary keys defined in VmTableXarray ' . $this->_tbl);
return false;
}
$skeyId = vRequest::getInt($this->_skey, 0);
// Initialize variables
$db = JFactory::getDBO();
$cid = vRequest::getInt($this->_pkey);
$order = vRequest::getInt('order');
//I found now two times "order" instead of ordering.
//This sql is broken
$query = 'SELECT `id` FROM `' . $this->_tbl . '` WHERE ' . $this->_pkey . ' = ' . (int) $cid[0] . ' AND `tsmart_category_id` = ' . (int) $skeyId;
$db->setQuery($query);
$id = $db->loadResult();
$keys = array_keys($order);
// TODO next 2 lines not used ????
if ($direction > 0) {
$idToSwap = $order[$keys[array_search($id, $keys)] + 1];
} else {
$idToSwap = $order[$keys[array_search($id, $keys)] - 1];
}
if (isset($cid[0])) {
$query = 'UPDATE `' . $this->_tbl . '` ' . ' SET `' . $this->_orderingKey . '` = `' . $this->_orderingKey . '` + ' . $direction . ' WHERE `' . $this->_pkey . '` = ' . (int) $cid[0] . ' AND `' . $this->_skey . '` = ' . (int) $skeyId;
$db->setQuery($query);
if (!$db->execute()) {
$err = $db->getErrorMsg();
JError::raiseError(500, get_class($this) . ':: move ' . $err);
}
}
}
示例2: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = tmsModel::getModel();
$this->setLayout('default');
$config = JFactory::getConfig();
$layoutName = vRequest::getCmd('layout', 'default');
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
JToolBarHelper::editList();
JToolBarHelper::addNew();
JToolBarHelper::deleteList();
$this->SetViewTitle();
$this->addStandardDefaultViewLists($model, 0, 'ASC');
$this->items = $model->getItemList(vRequest::getCmd('search', false));
$this->pagination = $model->getPagination();
$cid = vRequest::getInt('cid');
$model->setId($cid);
$this->item = $model->getItem();
$this->SetViewTitle('', $this->item->title);
parent::display($tpl);
}
示例3: getItemList
/**
* Retireve a list of currencies from the database.
* This function is used in the backend for the currency listing, therefore no asking if enabled or not
* @author Max Milbers
* @return object List of currency objects
*/
function getItemList($search = '')
{
$select = ' supplier.* FROM #__tsmart_supplier AS supplier';
$where = array();
$user = JFactory::getUser();
$shared = '';
if (vmAccess::manager()) {
$shared = 'OR `supplier.shared`="1"';
}
if (empty($search)) {
$search = vRequest::getString('search', false);
}
// add filters
if ($search) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$where[] = '`supplier.supplier_name` LIKE ' . $search;
}
$whereString = '';
if (count($where) > 0) {
$whereString = ' WHERE ' . implode(' AND ', $where);
}
$data = $this->exeSortSearchListQuery(0, $select, '', $whereString, '', $this->_getOrdering());
return $data;
}
示例4: display
function display ($tpl = null) {
// Load the helper(s)
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
$log_path = $config->get('log_path', VMPATH_ROOT . "/log");
$layoutName = vRequest::getCmd('layout', 'default');
VmConfig::loadJLang('com_virtuemart_log');
if ($layoutName == 'edit') {
$logFile = vRequest::getString('logfile', '');
$this->SetViewTitle('LOG', $logFile);
$fileContent = file_get_contents($log_path . DS . $logFile);
$fileContentByLine = explode("\n", $fileContent);
$this->assignRef('fileContentByLine', $fileContentByLine);
JToolBarHelper::cancel();
} else {
if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');
$logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));
$this->SetViewTitle('LOG');
$this->assignRef('logFiles', $logFiles);
$this->assignRef('path', $log_path);
}
parent::display($tpl);
}
示例5: getListQuery
function getListQuery()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('language.*')->from('#__tsmart_language AS language');
$user = JFactory::getUser();
$shared = '';
if (vmAccess::manager()) {
//$query->where('transferaddon.shared=1','OR');
}
$search = vRequest::getCmd('search', false);
if (empty($search)) {
$search = vRequest::getString('search', false);
}
// add filters
if ($search) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$query->where('language.language_name LIKE ' . $search);
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'language.tsmart_language_id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol == 'language.ordering') {
$orderCol = $db->quoteName('language.language_name') . ' ' . $orderDirn . ', ' . $db->quoteName('language.ordering');
}
$query->order($db->escape($orderCol . ' ' . $orderDirn));
return $query;
}
示例6: updateOrderItems
function updateOrderItems()
{
vRequest::vmCheckToken();
$model = VmModel::getModel('report');
$model->updateOrderItems();
$this->setRedirect($this->redirectPath, 'Order Items updated');
}
示例7: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$config = JFactory::getConfig();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$cid = vRequest::getInt('cid');
$task = vRequest::getCmd('task', 'add');
if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
$cid = (int) $cid[0];
} else {
$cid = 0;
}
$model->setId($cid);
$currency = $model->getCurrency();
$this->SetViewTitle('', $currency->currency_name);
$this->assignRef('currency', $currency);
$this->addStandardEditViewCommands();
} else {
$this->SetViewTitle();
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model, 0, 'ASC');
$currencies = $model->getCurrenciesList(vRequest::getCmd('search', false));
$this->assignRef('currencies', $currencies);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例8: 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);
}
示例9: display
function display($tpl = null)
{
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$this->vendorId = VmConfig::isSuperVendor();
// TODO add icon for media view
$this->SetViewTitle();
$model = VmModel::getModel('media');
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$this->media = $model->getFile();
$this->addStandardEditViewCommands();
} else {
$virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$cat_id = vRequest::getInt('virtuemart_category_id', 0);
JToolBarHelper::custom('synchronizeMedia', 'new', 'new', vmText::_('COM_VIRTUEMART_TOOLS_SYNC_MEDIA_FILES'), false);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model, null, null, 'searchMedia');
$options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_TYPES'), 'product' => vmText::_('COM_VIRTUEMART_PRODUCT'), 'category' => vmText::_('COM_VIRTUEMART_CATEGORY'), 'manufacturer' => vmText::_('COM_VIRTUEMART_MANUFACTURER'), 'vendor' => vmText::_('COM_VIRTUEMART_VENDOR'));
$this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"');
$options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_ROLES'), 'file_is_displayable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_FORSALE'));
$this->lists['search_role'] = VmHTML::selectList('search_role', vRequest::getVar('search_role'), $options, 1, '', 'onchange="this.form.submit();"');
$this->files = $model->getFiles(false, false, $virtuemart_product_id, $cat_id);
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例10: getListQuery
function getListQuery()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('state.*, countries.flag AS country_flag,countries.country_name,COUNT(cityarea.tsmart_cityarea_id) AS total_city')->from('#__tsmart_states AS state')->leftJoin('#__tsmart_countries AS countries using (tsmart_country_id)')->leftJoin('#__tsmart_cityarea AS cityarea using (tsmart_state_id)')->group('state.tsmart_state_id')->leftJoin('#__tsmart_states AS states ON states.tsmart_state_id=cityarea.tsmart_state_id')->leftJoin('#__tsmart_airport AS airport ON airport.tsmart_cityarea_id=cityarea.tsmart_cityarea_id')->select('GROUP_CONCAT(airport.airport_name,"(",airport.ata_code,")") AS list_airport_name');
$user = JFactory::getUser();
$shared = '';
if (vmAccess::manager()) {
//$query->where('transferaddon.shared=1','OR');
}
$search = vRequest::getCmd('search', false);
if (empty($search)) {
$search = vRequest::getString('search', false);
}
// add filters
if ($search) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$query->where('state.state_name LIKE ' . $search);
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'state.tsmart_state_id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol == 'state.ordering') {
$orderCol = $db->quoteName('state.tsmart_state_id') . ' ' . $orderDirn . ', ' . $db->quoteName('state.ordering');
}
$query->order($db->escape($orderCol . ' ' . $orderDirn));
return $query;
}
示例11: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if ($this->showVendors()) {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例12: getListQuery
function getListQuery()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('excursion_addon.*')->from('#__tsmart_excursion_addon AS excursion_addon')->leftJoin('me1u8_tsmart_cityarea AS cityarea USING(tsmart_cityarea_id)')->select('cityarea.city_area_name AS city_area_name');
$user = JFactory::getUser();
$shared = '';
if (vmAccess::manager()) {
//$query->where('excursionaddon.shared=1','OR');
}
$search = vRequest::getCmd('search', false);
if (empty($search)) {
$search = vRequest::getString('search', false);
}
// add filters
if ($search) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$query->where('excursion_addon.excursion_addon_name LIKE ' . $search);
}
if (empty($this->_selectedOrdering)) {
vmTrace('empty _getOrdering');
}
if (empty($this->_selectedOrderingDir)) {
vmTrace('empty _selectedOrderingDir');
}
$query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir);
return $query;
}
示例13: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
$cid = vRequest::getvar('cid', NULL, 'array');
if (is_Array($cid)) {
$virtuemart_paymentmethod_id = $cid[0];
} else {
$virtuemart_paymentmethod_id = $cid;
}
$http = JURI::root() . 'index.php?option=com_virtuemart&view=vmplg&task=notify&nt=ipn&tmpl=component&pm=' . $virtuemart_paymentmethod_id;
$https = str_replace('http://', 'https://', $http);
$class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="text_area"';
if ($node->attributes('editable') == 'true') {
$size = $node->attributes('size') ? 'size="' . $node->attributes('size') . '"' : '';
return '<input type="text" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" ' . $class . ' ' . $size . ' />';
} else {
$string = "<div " . $class . ">";
$string .= '<div class="ipn-sandbox">' . $http . ' <br /></div>';
if (strcmp($https, $http) !== 0) {
$string .= '<div class="ipn-sandbox">' . vmText::_('VMPAYMENT_AMAZON_OR') . '<br /></div>';
$string .= $https;
$string .= "</div>";
}
return $string;
}
}
示例14: getListQuery
function getListQuery()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('faq.*,categoryfaq.categoryfaq_name')->from('#__tsmart_faq AS faq')->leftJoin('#__tsmart_categoryfaq AS categoryfaq ON categoryfaq.tsmart_categoryfaq_id=faq.tsmart_categoryfaq_id');
$user = JFactory::getUser();
$shared = '';
if (vmAccess::manager()) {
//$query->where('transferaddon.shared=1','OR');
}
$search = vRequest::getCmd('search', false);
if (empty($search)) {
$search = vRequest::getString('search', false);
}
// add filters
if ($search) {
$db = JFactory::getDBO();
$search = '"%' . $db->escape($search, true) . '%"';
$query->where('faq.title LIKE ' . $search);
}
if (empty($this->_selectedOrdering)) {
vmTrace('empty _getOrdering');
}
if (empty($this->_selectedOrderingDir)) {
vmTrace('empty _selectedOrderingDir');
}
$query->order($this->_selectedOrdering . ' ' . $this->_selectedOrderingDir);
return $query;
}
示例15: 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();
}