本文整理汇总了PHP中JRequest::getCmd方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::getCmd方法的具体用法?PHP JRequest::getCmd怎么用?PHP JRequest::getCmd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::getCmd方法的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: display
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/users.php';
// Load the submenu.
UsersHelper::addSubmenu(JRequest::getCmd('view', 'users'));
$view = JRequest::getCmd('view', 'users');
$layout = JRequest::getCmd('layout', 'default');
$id = JRequest::getInt('id');
if (!$this->canView($view)) {
JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
return;
}
// Check for edit form.
if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));
return false;
} elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false));
return false;
} elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false));
return false;
}
return parent::display();
}
示例3: __construct
function __construct() {
$app = JFactory::getApplication();
parent::__construct();
$config = JFactory::getConfig();
$paramsC = JComponentHelper::getParams('com_phocadownload') ;
$defaultPagination = $paramsC->get( 'default_pagination', '20' );
$file_ordering = $paramsC->get( 'file_ordering', 1 );
$context = $this->_context.'.';
// Get the pagination request variables
$this->setState('limit', $app->getUserStateFromRequest($context.'limit', 'limit', $defaultPagination, 'int'));
$this->setState('limitstart', $app->input->get('limitstart', 0, 'int'));
// In case limit has been changed, adjust limitstart accordingly
$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
$this->setState('filter.language',$app->getLanguageFilter());
$this->setState('fileordering', $app->getUserStateFromRequest($context .'fileordering', 'fileordering', $file_ordering, 'int'));
// Get the filter request variables
$this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering'));
$this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC'));
}
示例4: getFolderList
/**
* Image Manager Popup
*
* @param string $listFolder The image directory to display
* @since 1.5
*/
function getFolderList($base = null)
{
global $mainframe;
// Get some paths from the request
if (empty($base)) {
$base = JA_WORKING_DATA_FOLDER;
}
// Get the list of folders
jimport('joomla.filesystem.folder');
$folders = JFolder::folders($base, '.', 4, true);
// Load appropriate language files
$lang =& JFactory::getLanguage();
$lang->load(JRequest::getCmd('option'), JPATH_ADMINISTRATOR);
$document =& JFactory::getDocument();
$document->setTitle(JText::_('Insert Image'));
// Build the array of select options for the folder list
$options[] = JHTML::_('select.option', "", "/");
foreach ($folders as $folder) {
$folder = str_replace(JA_WORKING_DATA_FOLDER, "", $folder);
$value = substr($folder, 1);
$text = str_replace(DS, "/", $folder);
$options[] = JHTML::_('select.option', $value, $text);
}
// Sort the folder list array
if (is_array($options)) {
sort($options);
}
// Create the drop-down folder select list
$list = JHTML::_('select.genericlist', $options, 'folderlist', "class=\"inputbox\" size=\"1\" onchange=\"ImageManager.setFolder(this.options[this.selectedIndex].value)\" ", 'value', 'text', $base);
return $list;
}
示例5: display
public function display($cachable = false, $urlparams = false)
{
// Redirect profile to integrated component if profile integration is turned on
$redirect = 1;
$active = $this->app->getMenu()->getActive();
if (!empty($active)) {
$params = $active->params;
$redirect = $params->get('integration', 1);
}
if ($redirect && JRequest::getCmd('format', 'html') == 'html') {
$profileIntegration = KunenaFactory::getProfile();
$layout = JRequest::getCmd('layout', 'default');
if ($profileIntegration instanceof KunenaProfileKunena) {
// Continue
} elseif ($layout == 'default') {
$url = $this->me->getUrl(false);
} elseif ($layout == 'list') {
$url = $profileIntegration->getUserListURL('', false);
}
if (!empty($url)) {
$this->setRedirect($url);
return;
}
}
$layout = JRequest::getCmd('layout', 'default');
if ($layout == 'list') {
if (KunenaFactory::getConfig()->userlist_allowed && JFactory::getUser()->guest) {
$this->redirectBack();
}
}
parent::display();
}
示例6: submissionsViewFile
function submissionsViewFile()
{
$lang = JFactory::getLanguage();
$lang->load('com_rsform', JPATH_ADMINISTRATOR);
$hash = JRequest::getCmd('hash');
if (strlen($hash) != 32) {
return $this->setRedirect('index.php');
}
$config = JFactory::getConfig();
$secret = $config->getValue('config.secret');
$this->_db->setQuery("SELECT * FROM #__rsform_submission_values WHERE MD5(CONCAT(SubmissionId,'" . $this->_db->getEscaped($secret) . "',FieldName)) = '" . $hash . "'");
$result = $this->_db->loadObject();
// Not found
if (empty($result)) {
return $this->setRedirect('index.php');
}
// Not an upload field
$this->_db->setQuery("SELECT c.ComponentTypeId FROM #__rsform_properties p LEFT JOIN #__rsform_components c ON (p.ComponentId=c.ComponentId) WHERE p.PropertyName='NAME' AND p.PropertyValue='" . $this->_db->getEscaped($result->FieldName) . "'");
$type = $this->_db->loadResult();
if ($type != 9) {
return $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_UPLOAD'));
}
jimport('joomla.filesystem.file');
if (JFile::exists($result->FieldValue)) {
RSFormProHelper::readFile($result->FieldValue);
}
$this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_FOUND'));
}
示例7: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
* @since 1.6
*/
protected function populateState($ordering = 'ordering', $direction = 'ASC')
{
$app = JFactory::getApplication();
// List state information
//$value = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
$value = JRequest::getUInt('limit', $app->getCfg('list_limit', 0));
$this->setState('list.limit', $value);
//$value = $app->getUserStateFromRequest($this->context.'.limitstart', 'limitstart', 0);
$value = JRequest::getUInt('limitstart', 0);
$this->setState('list.start', $value);
$orderCol = JRequest::getCmd('filter_order', 'a.ordering');
if (!in_array($orderCol, $this->filter_fields)) {
$orderCol = 'a.ordering';
}
$this->setState('list.ordering', $orderCol);
$listOrder = JRequest::getCmd('filter_order_Dir', 'ASC');
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) {
$listOrder = 'ASC';
}
$this->setState('list.direction', $listOrder);
$params = $app->getParams();
$this->setState('params', $params);
$user = JFactory::getUser();
$this->setState('layout', JRequest::getCmd('layout'));
}
示例8: display
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
JPluginHelper::importPlugin('content');
$vName = JRequest::getCmd('view', 'images');
switch ($vName) {
case 'imagesList':
$mName = 'list';
$vLayout = JRequest::getCmd('layout', 'default');
break;
case 'images':
default:
$vLayout = JRequest::getCmd('layout', 'default');
$mName = 'manager';
$vName = 'images';
break;
}
$document = JFactory::getDocument();
$vType = $document->getType();
// Get/Create the view
$view = $this->getView($vName, $vType);
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . '/views/' . strtolower($vName) . '/tmpl');
// Get/Create the model
if ($model = $this->getModel($mName)) {
// Push the model into the view (as default)
$view->setModel($model, true);
}
// Set the layout
$view->setLayout($vLayout);
// Display the view
$view->display();
return $this;
}
示例9: onContentPrepare
public function onContentPrepare($context, &$article, &$params, $limitstart)
{
$app = JFactory::getApplication();
/* @var $app JApplication */
// Do not render the buttons in administration area
if ($app->isAdmin()) {
return;
}
$doc = JFactory::getDocument();
/* @var $doc JDocumentHtml */
$docType = $doc->getType();
// Joomla! must render content of this plugin only in HTML document
if (strcmp("html", $docType) != 0) {
return;
}
$currentOption = JRequest::getCmd("option");
if ($currentOption != "com_content" or !isset($article) or empty($article->id) or !isset($this->params)) {
return;
}
JPlugin::loadLanguage('plg_mvsocialbuttons');
$buttons = $this->getButtons($article);
$position = $this->params->get('position');
switch ($position) {
case 1:
$article->text = $buttons . $article->text;
break;
case 2:
$article->text = $article->text . $buttons;
break;
default:
$article->text = $buttons . $article->text . $buttons;
break;
}
return true;
}
示例10: addToolBar
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::addNew('portfolio.add');
JToolBarHelper::editList('portfolio.edit');
JToolBarHelper::custom('portfolios.rebuild', 'refresh.png', 'refresh_f2.png', 'COM_BT_PORTFOLIO_PORTFOLIOS_REBUILD_IMAGES', false);
JToolBarHelper::divider();
JToolBarHelper::title(JText::_('COM_BT_PORTFOLIO_PORTFOLIOS_MANAGER'), 'portfolio.png');
JToolBarHelper::publish('portfolios.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('portfolios.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::custom('portfolios.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
JToolBarHelper::divider();
JToolBarHelper::checkin('portfolios.checkin');
JToolBarHelper::deleteList('', 'portfolios.delete');
JToolBarHelper::preferences('com_bt_portfolio');
$this->sidebar = '';
Bt_portfolioHelper::addSubmenu(JRequest::getCmd('view', 'cpanel'));
//added since 2.0 for j3.0
if (!$this->legacy) {
JHtmlSidebar::setAction('index.php?option=com_bt_portfolio&view=portfolios');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', Bt_portfolioHelper::getPublishedOptions(), 'value', 'text', $this->state->get('filter.published'), true));
JHtmlSidebar::addFilter(JText::_('COM_BT_PORTFOLIO_SELECT_FEATURED'), 'filter_featured', JHtml::_('select.options', Bt_portfolioHelper::getFeaturedOptions(), 'value', 'text', $this->state->get('filter.featured'), true));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_catid', JHtml::_('select.options', Bt_portfolioHelper::getCategoryOptions(), 'value', 'text', $this->state->get('filter.catid')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
$this->sidebar = JHtmlSidebar::render();
}
}
示例11: _displayForm
function _displayForm($tpl)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$uri = JFactory::getURI();
$user = JFactory::getUser();
$model = $this->getModel();
//get the project
$object =& $this->get('data');
$isNew = $object->id < 1;
// fail if checked out not by 'me'
if ($model->isCheckedOut($user->get('id'))) {
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_LEAGUE'), $object->name);
$mainframe->redirect('index.php?option=' . $option, $msg);
}
// Edit or Create?
if (!$isNew) {
$model->checkout($user->get('id'));
} else {
// initialise new record
$object->order = 0;
}
$extended = $this->getExtended($object->extended, 'league');
$this->assignRef('extended', $extended);
$this->assignRef('object', $object);
$this->assignRef('form', $this->get('form'));
$this->assign('cfg_which_media_tool', JComponentHelper::getParams($option)->get('cfg_which_media_tool', 0));
$this->addToolbar();
parent::display($tpl);
}
示例12: _displayDefault
function _displayDefault($tpl)
{
$option = JRequest::getCmd('option');
$mainframe =& JFactory::getApplication();
$uri =& JFactory::getURI();
$cid = JRequest::getCmd('cid');
$match_id = $cid[0];
$model =& $this->getModel();
/*
$filter_state = $mainframe->getUserStateFromRequest($option.'mc_filter_state', 'filter_state', '', 'word');
$filter_order = $mainframe->getUserStateFromRequest($option.'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.'mc_filter_order_Dir','filter_order_Dir', '', 'word');
$search = $mainframe->getUserStateFromRequest($option.'mc_search', 'search', '', 'string');
$search_mode = $mainframe->getUserStateFromRequest($option.'mc_search_mode', 'search_mode', '', 'string');
$division = $mainframe->getUserStateFromRequest($option.'mc_division', 'division', '', 'string');
$project_id = $mainframe->getUserState( $option . 'project' );
$search = JString::strtolower($search);
*/
$matches =& $this->get('Data');
$total =& $this->get('Total');
$pagination =& $this->get('Pagination');
$match = $model->getMatchData($match_id);
echo 'getModel<pre>' . print_r($model, true) . '</pre><br>';
$this->assignRef('homeplayer', $model->HomeTeamPlayer());
$this->assignRef('awayplayer', $model->AwayTeamPlayer());
$this->assignRef('matches', $matches);
$this->assignRef('match', $match);
$this->assignRef('pagination', $pagination);
$this->assignRef('lists', $lists);
$this->assignRef('request_url', $uri->toString());
parent::display($tpl);
}
示例13: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
* @since 1.6
*/
protected function populateState($ordering = 'ordering', $direction = 'ASC')
{
$app = JFactory::getApplication();
// List state information
$value = JRequest::getUInt('limit', $app->getCfg('list_limit', 0));
$this->setState('list.limit', $value);
$value = JRequest::getUInt('limitstart', 0);
$this->setState('list.start', $value);
$orderCol = JRequest::getCmd('filter_order', 'a.ordering');
if (!in_array($orderCol, $this->filter_fields)) {
$orderCol = 'a.ordering';
}
$this->setState('list.ordering', $orderCol);
$listOrder = JRequest::getCmd('filter_order_Dir', 'ASC');
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) {
$listOrder = 'ASC';
}
$this->setState('list.direction', $listOrder);
$params = $app->getParams();
$this->setState('params', $params);
$user = JFactory::getUser();
if (!$user->authorise('core.edit.state', 'com_content') && !$user->authorise('core.edit', 'com_content')) {
// filter on published for those who do not have edit or edit.state rights.
$this->setState('filter.published', 1);
}
$this->setState('filter.language', $app->getLanguageFilter());
// process show_noauth parameter
if (!$params->get('show_noauth')) {
$this->setState('filter.access', true);
} else {
$this->setState('filter.access', false);
}
$this->setState('layout', JRequest::getCmd('layout'));
}
示例14: display
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = array())
{
// set default view if not set
JRequest::setVar('view', JRequest::getCmd('view', 'websockets'));
// call parent behavior
parent::display($cachable, $urlparams);
}
示例15: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$user = JFactory::getUser();
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int');
$filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', '', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
$model = $this->getModel();
$total = $model->getTotalGroups();
if ($limitstart > $total - $limit) {
$limitstart = max(0, (int) (ceil($total / $limit) - 1) * $limit);
JRequest::setVar('limitstart', $limitstart);
}
$extraFieldGroups = $model->getGroups();
$this->assignRef('rows', $extraFieldGroups);
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
$this->assignRef('page', $pageNav);
JToolBarHelper::title(JText::_('K2_EXTRA_FIELD_GROUPS'), 'k2.png');
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
JToolBarHelper::editList();
JToolBarHelper::addNew();
if (K2_JVERSION != '15') {
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
} else {
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
}
$this->loadHelper('html');
K2HelperHTML::subMenu();
parent::display($tpl);
}