本文整理汇总了PHP中JRequest::getCMD方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::getCMD方法的具体用法?PHP JRequest::getCMD怎么用?PHP JRequest::getCMD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::getCMD方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItem
function getItem()
{
$app = JFactory::getApplication();
$id = JRequest::getVar('id', 0, '', 'int');
$token = JRequest::getCMD('token', '');
$row = JTable::getInstance('Items', 'DJClassifiedsTable');
$db = JFactory::getDBO();
if ($id > 0) {
$user = JFactory::getUser();
$row->load($id);
if ($user->id != $row->user_id || $user->id == 0) {
$message = JText::_("COM_DJCLASSIFIEDS_WRONG_AD");
$redirect = 'index.php?option=com_djclassifieds&view=additem';
$app->redirect($redirect, $message, 'error');
}
} else {
if ($token) {
$query = "SELECT i.id FROM #__djcf_items i " . "WHERE i.user_id=0 AND i.token=" . $db->Quote($db->escape($token));
$db->setQuery($query);
$id = $db->loadResult();
if ($id) {
$row->load($id);
}
}
}
return $row;
}
示例2: display
function display($tpl = null)
{
$option = JRequest::getCMD('option');
$mainframe = JFactory::getApplication();
$app =& JFactory::getApplication();
$helper = new comZonalesHelper();
// url de retorno según sección del menu actual
$menu =& JSite::getMenu();
$item = $menu->getActive();
$return = $item ? $item->link . '&Itemid=' . $item->id : 'index.php';
// si debe retornarse una respuesta mediante ajax
$this->ajax = JRequest::getBool('ajax');
$this->task = JRequest::getBool('ajax') ? 'setZonalAjax' : 'setZonal';
$zName = $helper->getZonal();
$this->zonal = is_object($zName) ? $zName->name : $zName;
// parametros - alto y ancho
$zonalesParams =& JFactory::getApplication('site')->getParams('com_zonales');
$this->width = $zonalesParams->get('width_mapa_flash', '');
$this->height = $zonalesParams->get('height_mapa_flash', '');
$this->flashfile = $zonalesParams->get('flash_file', '');
$this->assignRef('j2f', $helper->getZif2SifMap());
$this->assignRef('template', $app->getTemplate());
$this->assignRef('return', $return);
parent::display($tpl);
}
示例3: getResultsCounter
/**
* Create and return the pagination result set counter string, ie. Results 1-10 of 42
*
* @access public
* @return string Pagination result set counter string
* @since 1.5
*/
function getResultsCounter()
{
// Initialize variables
$app = JFactory::getApplication();
$view = JRequest::getCMD('view');
$html = null;
$fromResult = $this->limitstart + 1;
// If the limit is reached before the end of the list
if ($this->limitstart + $this->limit < $this->total) {
$toResult = $this->limitstart + $this->limit;
} else {
$toResult = $this->total;
}
// If there are results found
$fc_view_total = 0;
//(int) $app->getUserState('fc_view_total_'.$view);
if (!$fc_view_total) {
$fc_view_total = $this->total;
}
if ($fc_view_total > 0) {
// Check for maximum allowed of results
$fc_view_limit_max = JRequest::getWord('view') != 'search' ? 0 : (int) $app->getUserState('fc_view_limit_max_' . $view);
$items_total_msg = $fc_view_limit_max && $this->total >= $fc_view_limit_max ? 'FLEXI_ITEM_S_OR_MORE' : 'FLEXI_ITEM_S';
$html = "<span class='flexi label item_total_label'>" . JText::_('FLEXI_TOTAL') . "</span> " . "<span class='flexi item_total_value'>" . $fc_view_total . " " . JText::_($items_total_msg) . "</span>" . "<span class='flexi label item_total_label'>" . JText::_('FLEXI_DISPLAYING') . "</span> " . "<span class='flexi item_total_value'>" . $fromResult . " - " . $toResult . " " . JText::_('FLEXI_ITEM_S') . "</span>";
} else {
$html .= "\n" . JText::_('JLIB_HTML_NO_RECORDS_FOUND');
}
return $html;
}
示例4: setZonal
/**
* Setea o actualiza la variable de sesión con el zonal actualmente
* seleccionado por el usuario, y redirecciona a la URL de retorno
* especificada.
*/
function setZonal($zname = null)
{
$option = JRequest::getCMD('option');
// parametros
if (is_null($zname)) {
$zname = JRequest::getVar('zname', NULL, 'post', 'string');
}
$return = JRequest::getVar('return', 'index.php', 'post', 'string');
// al utilizar flashbar & para separar variables el url puede estar divido
$view = JRequest::getVar('view', NULL, 'post', 'string');
$item = JRequest::getVar('Itemid', NULL, 'post', 'int');
if ($view && $item) {
$return .= '&view=' . $view . '&Itemid=' . $item;
}
$session = JFactory::getSession();
if ($zname) {
$zonal = $this->_zonalesHelper->getZonal($zname);
if ($zonal) {
$session->set('zonales_zonal_name', $zonal->name);
$session->set('zonales_zonal_label', $zonal->label);
} else {
$session->set('zonales_zonal_name', NULL);
$session->set('zonales_zonal_label', NULL);
}
} else {
$session->set('zonales_zonal_name', NULL);
$session->set('zonales_zonal_label', NULL);
}
$this->setRedirect($return);
}
示例5: display
function display($tpl = null)
{
$option = JRequest::getCMD('option');
$mainframe = JFactory::getApplication();
$this->_context = $option . 'ListaMenu';
// nombre del contexto
$this->_orderfield = 'm.id';
// campo de ordenamiento
$this->_searchfield = 'm.id';
// campo de búsqueda
$this->configure();
$this->setPagination();
// setea la paginación
$menus =& $this->get('All');
foreach ($menus as $menu) {
$menu->link = JRoute::_('index.php?option=' . $option . '&cid[]=' . $menu->id . '&task=editMenu');
$menu->jmenu_edit_link = JRoute::_('index.php?option=com_menus&menutype=mainmenu&task=edit&cid[]=' . $menu->menu_id);
}
// Titulo
$document =& JFactory::getDocument();
$document->setTitle(JText::_('Administrar Asociaciones de Menu'));
// Asigna variables en la vista y la muestra
$this->assignRef('menus', $menus);
parent::display($tpl);
}
示例6: copy
function copy()
{
$plugins = JRequest::getVar('cid', array(), '', 'array');
$result = true;
if (!empty($plugins)) {
$type = JRequest::getCMD('plugin_type');
if (!in_array($type, array('payment', 'shipping'))) {
$this->listing();
return false;
}
$pluginsClass = hikashop_get('class.' . $type);
foreach ($plugins as $plugin) {
$data = $pluginsClass->get($plugin);
if ($data) {
$key = $type . '_id';
unset($data->{$key});
if (!$pluginsClass->save($data)) {
$result = false;
}
}
}
}
if ($result) {
$app = JFactory::getApplication();
if (!HIKASHOP_J30) {
$app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'), 'success');
} else {
$app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'));
}
return $this->listing();
}
return $this->listing();
}
示例7: __construct
/**
* Constructor
*
* @access protected
* @param array $options options
*/
function __construct($options)
{
$this->_options =& $options;
// Get the default group and caching
if (isset($options['language'])) {
$this->_options['language'] = $options['language'];
} else {
$options['language'] = 'en-GB';
}
if (isset($options['cachebase'])) {
$this->_options['cachebase'] = $options['cachebase'];
} else {
$this->_options['cachebase'] = JPATH_ROOT . DS . 'cache';
}
if (isset($options['defaultgroup'])) {
$this->_options['defaultgroup'] = $options['defaultgroup'];
} else {
$this->_options['defaultgroup'] = 'default';
}
if (isset($options['caching'])) {
$this->_options['caching'] = $options['caching'];
} else {
$this->_options['caching'] = true;
}
if (isset($options['storage'])) {
$this->_options['storage'] = $options['storage'];
} else {
$this->_options['storage'] = 'file';
}
//Fix to detect if template positions are enabled...
if (JRequest::getCMD('tpl', 0)) {
$this->_options['caching'] = false;
}
}
示例8: display
function display($tpl = null)
{
$option = JRequest::getCMD('option');
$mainframe = JFactory::getApplication();
$this->_context = $option . 'ListAttributes';
// nombre del contexto
$this->_orderfield = 'a.label';
// campo de ordenamiento
$this->_searchfield = 'a.label';
// campo de búsqueda
$this->configure();
$this->setPagination();
// setea la paginación
$attributes =& $this->get('All');
foreach ($attributes as $attribute) {
if ($attribute->id > 3) {
$attribute->link = JRoute::_('index.php?option=' . $option . '&cid[]=' . $attribute->id . '&task=editAttribute');
} else {
$attribute->link = JRoute::_('index.php?option=' . $option . '&task=listAttributes');
}
}
// Titulo
$document =& JFactory::getDocument();
$document->setTitle(JText::_('Attributes administration'));
// Asigna variables en la vista y la muestra
$this->assignRef('attributes', $attributes);
parent::display($tpl);
}
示例9: configure
/**
* Tareas comunes a pantalla de listas
*
*/
function configure()
{
$option = JRequest::getCMD('option');
$mainframe = JFactory::getApplication();
// orden
$filter_order = $mainframe->getUserStateFromRequest($this->_context . 'filter_order', 'filter_order', $this->_orderfield, 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($this->_context . 'filter_order_Dir', 'filter_order_Dir', 'asc', 'word');
// cadena de búsqueda
$search = $mainframe->getUserStateFromRequest($this->_context . 'search', 'search', '', 'string');
$search = JString::strtolower($search);
// Configuramos el modelo
$model =& $this->getModel();
$model->_orderby_filter_order = $filter_order;
$model->_orderby_filter_order_dir = $filter_order_Dir;
// seteamos búsqueda en el modelo
$db = JFactory::getDBO();
if ($search) {
$model->setWhere('LOWER(' . $this->_searchfield . ') LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false));
}
// table ordering
$this->_lists['order_Dir'] = $filter_order_Dir;
$this->_lists['order'] = $filter_order;
$this->_lists['search'] = $search;
$this->assignRef('lists', $this->_lists);
}
示例10: site
function site()
{
$mainframe = JFactory::getApplication();
$acl = JFactory::getACL();
$user = JFactory::getUser();
$option = JRequest::getCMD('option');
if ($acl->acl_check($option, 'site.block', 'users', $user->get('usertype'))) {
$mainframe->redirect('index.php', JText::_('You dont have permission to access'));
}
}
示例11: __construct
/**
* Constructor
*
* @access protected
* @param array $options options
*/
function __construct($options)
{
$this->_options = array('language' => 'en-GB', 'cachebase' => JPATH_ROOT . DS . 'cache', 'defaultgroup' => 'default', 'caching' => true, 'storage' => 'file');
// Overwrite default options with given options
$this->_options = array_merge($this->_options, $options);
//@todo:or with the ampersand here? Like "...& $options);" for speed if array_merge or this construct would make a deep copy otherwise
// Fix to detect if template positions are enabled...
if (JRequest::getCMD('tpl', 0)) {
$this->_options['caching'] = false;
}
}
示例12: showApplications
function showApplications()
{
$mainframe =& JFactory::getApplication();
global $option;
$option = JRequest::getCMD('option');
$db =& JFactory::getDBO();
$filter_order = $mainframe->getUserStateFromRequest("{$option}.filter_order", 'filter_order', 'm.id');
$filter_order_Dir = $mainframe->getUserStateFromRequest("{$option}.filter_order_Dir", 'filter_order_Dir', '');
$filter_state = $mainframe->getUserStateFromRequest("{$option}.filter_state", 'filter_state', '*');
$search = $mainframe->getUserStateFromRequest("{$option}.search", 'search', '');
$search = $db->getEscaped(trim(JString::strtolower($search)));
$limit = JRequest::getVar('global.list.limit', $mainframe->getCfg('list_limit'), '', 'int');
$limitstart = $mainframe->getUserStateFromRequest($option . 'limitstart', 'limitstart', 0);
$where = array();
if ($filter_state) {
if ($filter_state == 'P') {
$where[] = 'm.published = 1';
} elseif ($filter_state == 'U') {
$where[] = 'm.published = 0';
}
}
if ($search) {
$where[] = 'LOWER(m.title) LIKE "%' . $search . '%"';
}
$where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
$orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
//$query = 'SELECT COUNT(m.id) FROM #__jumi as m left join #__groups as g on (m.access = g.id) '.$where;
$query = 'SELECT COUNT(m.id) FROM #__jumi as m ' . $where;
$db->setQuery($query);
$total = $db->loadResult();
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
//$query = 'SELECT m.*, g.name as groupname FROM #__jumi as m left join #__groups as g on (m.access = g.id) '.$where.' '.$orderby;
$query = 'SELECT m.*, \'depracated\' as groupname FROM #__jumi as m ' . $where . ' ' . $orderby;
$db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$rows = $db->loadObjectList();
if ($db->getErrorNum()) {
echo $db->stderr();
return false;
}
// state filter
$lists['state'] = JHTML::_('grid.state', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
JumiView::showApplications($rows, $pageNav, $option, $lists);
}
示例13: publish
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$option = JRequest::getCMD('option');
$cid = JRequest::getVar('cid', array());
$row =& JTable::getInstance('documents', 'Table');
$publish = $this->getTask() == 'publish' ? 1 : 0;
if (!$row->publish($cid, $publish)) {
JError::raiseError(500, $row->getError());
}
$msg = 'Document';
$msg .= count($cid) > 1 ? 's ' : ' ';
$msg .= $this->getTask() . 'ed';
$this->setRedirect('index.php?option=' . $option . '&view=documents', $msg);
}
示例14: __construct
function __construct()
{
parent::__construct();
$option = JRequest::getCMD('option');
$mainframe = JFactory::getApplication();
// obtenemos las variables para paginacion
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
// si se cambio el limite
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->_limit = $limit;
$this->_limitstart = $limitstart;
$array = JRequest::getVar('cid', 0, '', 'array');
$this->setId((int) $array[0]);
$path = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_aapu' . DS . 'tables';
$this->addTablePath($path);
$table =& $this->getTable();
$this->_table_name = $table->getTableName();
$this->_cache =& JFactory::getCache('com_aapu');
}
示例15: onAfterDispatch
public function onAfterDispatch()
{
$contentpluginFile = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_noixacl" . DS . "adapters" . DS . "content" . DS . "plugin.php";
if (file_exists($contentpluginFile)) {
include_once $contentpluginFile;
//instance application
$app =& JFactory::getApplication();
//get component
$option = JRequest::getCMD('option');
//get name of application
$applicationName = $app->getName();
//get task
$task = JRequest::getCMD('task');
if ($option == 'com_content') {
$instancePlugin = new PluginContent();
$applicationName = "after" . $applicationName;
if (method_exists($instancePlugin, $applicationName)) {
$instancePlugin->{$applicationName}();
}
}
}
}