本文整理汇总了PHP中JRequest::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::get方法的具体用法?PHP JRequest::get怎么用?PHP JRequest::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$mainframe =& JFactory::getApplication();
$row =& JTable::getInstance('K2UserGroup', 'Table');
if (!$row->bind(JRequest::get('post'))) {
$mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error');
}
if (!$row->check()) {
$mainframe->redirect('index.php?option=com_k2&view=userGroup&cid=' . $row->id, $row->getError(), 'error');
}
if (!$row->store()) {
$mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error');
}
$cache =& JFactory::getCache('com_k2');
$cache->clean();
switch (JRequest::getCmd('task')) {
case 'apply':
$msg = JText::_('Changes to User Group saved');
$link = 'index.php?option=com_k2&view=userGroup&cid=' . $row->id;
break;
case 'save':
default:
$msg = JText::_('User Group Saved');
$link = 'index.php?option=com_k2&view=userGroups';
break;
}
$mainframe->redirect($link, $msg);
}
示例2: save
/**
* Handle the save task
*
* @author RickG
*/
function save($data = 0){
JRequest::checkToken() or jexit( 'Invalid Token' );
$model = VmModel::getModel('config');
$data = JRequest::get('post');
$data['offline_message'] = JRequest::getVar('offline_message','','post','STRING',JREQUEST_ALLOWHTML);
if(strpos($data['offline_message'],'|')!==false){
$data['offline_message'] = str_replace('|','',$data['offline_message']);
}
if ($model->store($data)) {
$msg = JText::_('COM_VIRTUEMART_CONFIG_SAVED');
// Load the newly saved values into the session.
VmConfig::loadConfig();
}
else {
$msg = $model->getError();
}
$redir = 'index.php?option=com_virtuemart';
if(JRequest::getCmd('task') == 'apply'){
$redir = $this->redirectPath;
}
$this->setRedirect($redir, $msg);
}
示例3: save
function save()
{
$productfieldgroup = JTable::getInstance('productFieldGroup', 'jshop');
$post = JRequest::get("post");
JPluginHelper::importPlugin('jshoppingadmin');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeSaveProductFieldGroup', array(&$post));
if (!$productfieldgroup->bind($post)) {
JError::raiseWarning("", _JSHOP_ERROR_BIND);
$this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
return 0;
}
if (!$id) {
$productfieldgroup->ordering = null;
$productfieldgroup->ordering = $productfieldgroup->getNextOrder();
}
if (!$productfieldgroup->store()) {
JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
$this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
return 0;
}
$dispatcher->trigger('onAfterSaveProductFieldGroup', array(&$productfieldgroup));
if ($this->getTask() == 'apply') {
$this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups&task=edit&id=" . $productfieldgroup->id);
} else {
$this->setRedirect("index.php?option=com_jshopping&controller=productfieldgroups");
}
}
示例4: save
function save()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
$post = JRequest::get('post');
$model = $this->getModel();
if ($post['id'] == 0) {
if ($model->addNewCompany($post)) {
$msg = JText::_('Company added');
$link = 'index.php?option=com_rxcompanies';
$this->setRedirect($link, $msg);
} else {
$msg = JText::_('There was an error - the company was not added to the database');
$link = 'index.php?option=com_rxcompanies';
$this->setRedirect($link, $msg);
}
} else {
if ($model->updateCompany($post)) {
$msg = JText::_('Company updated');
$link = 'index.php?option=com_rxcompanies';
$this->setRedirect($link, $msg);
} else {
$msg = JText::_('There was an error - the lab was not updated');
$link = 'index.php?option=com_rxcompanies';
$this->setRedirect($link, $msg);
}
}
}
示例5: processSave
function processSave($id = 0, $post = null)
{
//save aclparam and core param in individual columns
$id = JRequest::getVar('id', $id);
$data = array();
if ($post === null) {
$post = JRequest::get('post');
}
$model = $this->getModel();
// Get the complete INI string of params
$param = new XiptParameter();
$post['coreparams']['core_display_message'] = base64_encode($post['coreparams']['core_display_message']);
$param->loadArray($post['coreparams'], 'xipt_coreparams');
$data['coreparams'] = $param->toString('XiptINI', 'xipt_coreparams');
$data['aclname'] = $post['aclname'];
$data['rulename'] = $post['rulename'];
$data['published'] = $post['published'];
$aclObject = XiptAclFactory::getAclObject($data['aclname']);
$data['aclparams'] = $aclObject->collectParamsFromPost($post);
// Save it // XITODO : clean it
if (!($info['id'] = $model->save($data, $id))) {
$info['msg'] = XiptText::_('ERROR_IN_SAVING_RULE');
} else {
$info['msg'] = XiptText::_('RULE_SAVED');
}
return $info;
}
示例6: store
function store()
{
$row =& JTable::getInstance('contactus', 'Table');
//$row =& $this->getTable();
$data = JRequest::get('post');
//print_r($data);
//exit();
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Make sure the hello record is valid
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the web link table to the database
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
//echo $this->_db->getErrorMsg();
//exit();
return true;
}
示例7: save
public function save($apply = 0)
{
$post = JRequest::get('post', JREQUEST_ALLOWRAW);
$giftcard_desc = JRequest::getVar('giftcard_desc', '', 'post', 'string', JREQUEST_ALLOWRAW);
$post["giftcard_desc"] = $giftcard_desc;
$showbuttons = JRequest::getVar('showbuttons');
$option = JRequest::getVar('option');
$model = $this->getModel('giftcard_detail');
$row = $model->store($post);
if ($row) {
$msg = JText::_('COM_REDSHOP_GIFTCARD_SAVED');
} else {
$msg = JText::_('COM_REDSHOP_ERROR_SAVING_GIFTCARD');
}
if (!$showbuttons) {
if ($apply == 1) {
$this->setRedirect('index.php?option=' . $option . '&view=giftcard_detail&task=edit&cid[]=' . $row->giftcard_id, $msg);
} else {
$this->setRedirect('index.php?option=' . $option . '&view=giftcard', $msg);
}
} else {
?>
<script language="javascript" type="text/javascript">
window.parent.SqueezeBox.close();
</script>
<?php
}
}
示例8: save
function save()
{
$dispatcher = JDispatcher::getInstance();
$currency_id = JRequest::getInt("currency_id");
$apply = JRequest::getVar("apply");
$currency = JSFactory::getTable('currency', 'jshop');
$post = JRequest::get("post");
$post['currency_value'] = saveAsPrice($post['currency_value']);
$dispatcher->trigger('onBeforeSaveCurrencie', array(&$post));
if (!$currency->bind($post)) {
JError::raiseWarning("", _JSHOP_ERROR_BIND);
$this->setRedirect("index.php?option=com_jshopping&controller=currencies");
return 0;
}
if ($currency->currency_value == 0) {
$currency->currency_value = 1;
}
$this->_reorderCurrency($currency);
if (!$currency->store()) {
JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
$this->setRedirect("index.php?option=com_jshopping&controller=currencies");
return 0;
}
$dispatcher->trigger('onAfterSaveCurrencie', array(&$currency));
if ($this->getTask() == 'apply') {
$this->setRedirect("index.php?option=com_jshopping&controller=currencies&task=edit¤cy_id=" . $currency->currency_id);
} else {
$this->setRedirect("index.php?option=com_jshopping&controller=currencies");
}
}
示例9: tranAlias
function tranAlias($easyset)
{
// set translate language
$SourceLan = $easyset->params->get('originLan');
$ResultLan = $easyset->params->get('tranLlan', 'en');
// get query
$post = JRequest::get('post');
if (!isset($post['jform']) || !isset($post['jform']['alias'])) {
return;
}
$alias = $post['jform']['alias'];
$title = $post['jform']['title'];
$titleTmp = explode('::', $post['jform']['title']);
if (!empty($titleTmp[1])) {
$title = $titleTmp[0];
$alias = JFilterOutput::stringURLSafe($titleTmp[1]);
}
if (trim($alias) == '') {
$alias = AKHelper::_('lang.translate', $title, $SourceLan, $ResultLan);
$alias = trim($alias);
$alias = JFilterOutput::stringURLSafe($alias);
$replace = array('aquot' => '', 'a39' => '', '--' => '-');
$alias = strtr($alias, $replace);
$alias = trim($alias, '-');
}
$post['jform']['alias'] = $alias;
$post['jform']['title'] = $title;
$input = JFactory::getApplication()->input;
JRequest::setVar('jform', $post['jform'], 'method', true);
$input->post->set('jform', $post['jform']);
$input->request->set('jform', $post['jform']);
}
示例10: display
function display($tpl = null)
{
$objPhpExcel = new PHPExcel();
$data = JRequest::get('donvi_id');
$user = JFactory::getUser();
$user_id = $user->id;
$model = JModelLegacy::getInstance('Tuan', 'BaocaotuanModel');
if ($data['task'] == "excelbctuan") {
$baocao_id = $data['baocao_id'];
$ketqua = $model->getThongtin('ju.name as tennhanvien, bc.*', 'zxbaocao bc', array('inner' => 'jos_users ju on ju.id = bc.user_id'), 'bc.trangthai = 1 and bc.user_id = ' . $user_id . ' and bc.id IN (' . $baocao_id . ')', 'batdau asc, ketthuc asc');
$this->assignRef('rows', $ketqua);
if (is_null($tpl)) {
$tpl = 'excel_baocaotuan';
}
}
if ($data['task'] == "excellamthemgio") {
$lamthemgio_id = $data['lamthemgio_id'];
$thongtin_all = $model->getThongtin('ju.name as tennhanvien, DATE_FORMAT(ltg.timebatdau,"%Hh%i") as timebatdau, DATE_FORMAT(ltg.timeketthuc,"%Hh%i") as timeketthuc,ltg.thoigian,ltg.congvieclamthem as congvieclamthem, DATE_FORMAT(ltg.ngaylamthem,"%d/%m/%Y") as ngaylamthem, DATE_FORMAT(ltg.ngaylamthem,"%m") as thanglamthem, DATE_FORMAT(ltg.ngaylamthem,"%Y") as namlamthem', 'zxlamthemgio ltg', array('inner' => 'jos_users ju on ju.id = ltg.user_id'), ' ltg.user_id = ' . $user_id . ' and ltg.id IN (' . $lamthemgio_id . ')', ' ngaylamthem asc');
$thanglamthem = $model->getThongtin('distinct(DATE_FORMAT(ltg.ngaylamthem,"%m")) as thanglamthem', 'zxlamthemgio ltg', null, ' ltg.user_id = ' . $user_id . ' and ltg.id IN (' . $lamthemgio_id . ')', ' ngaylamthem asc');
$ketqua = array();
for ($i = 0; $i < count($thanglamthem); $i++) {
for ($j = 0; $j < count($thongtin_all); $j++) {
if ($thanglamthem[$i]->thanglamthem == $thongtin_all[$j]->thanglamthem) {
$ketqua[$thanglamthem[$i]->thanglamthem][] = $thongtin_all[$j];
}
}
}
$this->assignRef('rows', $ketqua);
if (is_null($tpl)) {
$tpl = 'excel_lamthemgio';
}
}
parent::display($tpl);
}
示例11: store
function store()
{
$row =& JTable::getInstance('Referfriend', 'Table');
$data = JRequest::get('post');
if (isset($data['checkbox1'])) {
$data['checkbox1'] = 1;
} else {
$data['checkbox1'] = 0;
}
if (isset($data['checkbox2'])) {
$data['checkbox2'] = 1;
} else {
$data['checkbox2'] = 0;
}
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->check()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return true;
}
示例12: _displayInfo
private function _displayInfo($tpl)
{
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
$mainframe =& JFactory::getApplication();
$option = JRequest::getCmd('option');
$uri =& JFactory::getURI();
$db =& JFactory::getDBO();
$post = JRequest::get('post');
$model =& $this->getModel('jlextdfbnetplayerimport');
// Set toolbar items for the page
//JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_DFBNET_IMPORT_TITLE_3_3'),'generic.png');
//JToolBarHelper::back();
//JLToolBarHelper::onlinehelp();
$this->assignRef('starttime', $starttime);
$this->assignRef('importData', $model->importData($post));
$this->assignRef('postData', $post);
$revisionDate = '2011-04-28 - 12:00';
$this->assignRef('revisionDate', $revisionDate);
/*
echo 'view.html<br>';
echo '<pre>';
print_r($this->importData);
echo '</pre>';
*/
parent::display($tpl);
}
示例13: save
function save()
{
$post = JRequest::get('post');
$phocaSet = JRequest::getVar('phocaset', array(0), 'post', 'array');
$model = $this->getModel('phocadownloadset');
$errorMsg = '';
switch (JRequest::getCmd('task')) {
case 'apply':
if ($model->store($phocaSet, $errorMsg)) {
$msg = JText::_('Changes to Phoca Download Settings Saved');
if ($errorMsg != '') {
$msg .= '<br />' . JText::_($errorMsg);
}
} else {
$msg = JText::_('Error Saving Phoca Download Settings');
}
$this->setRedirect('index.php?option=com_phocadownload&view=phocadownloadset', $msg);
break;
case 'save':
default:
if ($model->store($phocaSet, $errorMsg)) {
$msg = JText::_('Phoca Download Settings Saved');
if ($errorMsg != '') {
$msg .= '<br />' . JText::_($errorMsg);
}
} else {
$msg = JText::_('Error Saving Phoca Download Settings');
}
$this->setRedirect('index.php?option=com_phocadownload', $msg);
break;
}
// Check the table in so it can be edited.... we are done with it anyway
$model->checkin();
}
示例14: save
/**
* save a record (and redirect to main page)
* @return void
*/
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$post = JRequest::get('post');
$task = JRequest::getVar('task');
$model =& $this->getModel('hotellinkedit');
if ($model->store($post)) {
switch ($task) {
case 'apply':
$link = 'index.php?option=com_hotelguide&view=hotellinkedit&cid[]=' . (int) $model->get('id');
break;
case 'saveandnew':
$link = 'index.php?option=com_hotelguide&view=hotellinkedit';
break;
default:
$link = 'index.php?option=com_hotelguide&view=hotellinks';
break;
}
$msg = JText::_('HG_LINK_SAVED');
} else {
$link = 'index.php?option=com_hotelguide&view=hotellinks';
$msg = JText::_('HG_ERROR_SAVING_LINK');
}
$this->setRedirect($link, $msg);
}
示例15: sendEmail
function sendEmail()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
$post = JRequest::get('post');
$this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models');
$model = $this->getModel('location');
$location = $model->getData();
$contact_name = $post['contact_name'];
$contact_email = $post['contact_email'];
$contact_message = $post['contact_message'];
if ($contact_name == null || $contact_message == null) {
echo JText::_('Please enter a name and message to send.');
return false;
} else {
if (false) {
return false;
} else {
JUtility::sendMail($contact_email, $contact_name, $location->email, 'Contact Message for: ' . $location->name, $contact_message, 0, null, null, null, $contact_email, $contact_name);
echo JText::_('Message Sent');
return true;
}
}
return false;
}