本文整理汇总了PHP中JInput::getCmd方法的典型用法代码示例。如果您正苦于以下问题:PHP JInput::getCmd方法的具体用法?PHP JInput::getCmd怎么用?PHP JInput::getCmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JInput
的用法示例。
在下文中一共展示了JInput::getCmd方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterInitialise
public function onAfterInitialise()
{
// Make sure this is the back-end
$app = JFactory::getApplication();
if (!in_array($app->getName(), array('administrator', 'admin'))) {
return;
}
if (version_compare(JVERSION, '2.5.0', 'lt')) {
$this->autoDisable();
return;
}
// Get the input variables
$ji = new JInput();
$component = $ji->getCmd('option', '');
$task = $ji->getCmd('task', '');
$view = $ji->getCmd('view', '');
$backedup = $ji->getInt('is_backed_up', 0);
// Perform a redirection on Joomla! Update download or install task, unless we have already backed up the site
if ($component == 'com_joomlaupdate' && $task == 'update.install' && !$backedup) {
// Get the backup profile ID
$profileId = (int) $this->params->get('profileid', 1);
if ($profileId <= 0) {
$profileId = 1;
}
// Get the return URL
$return_url = JUri::base() . 'index.php?option=com_joomlaupdate&task=update.install&is_backed_up=1';
// Get the redirect URL
$token = JFactory::getSession()->getToken();
$redirect_url = JUri::base() . 'index.php?option=com_akeeba&view=backup&autostart=1&returnurl=' . urlencode($return_url) . '&profileid=' . $profileId . "&{$token}=1";
// Perform the redirection
$app = JFactory::getApplication();
$app->redirect($redirect_url);
}
}
示例2: onAfterInitialise
public function onAfterInitialise()
{
// Make sure this is the back-end
$app = JFactory::getApplication();
if (!in_array($app->getName(), array('administrator', 'admin'))) {
return;
}
// Get the input variables
$ji = new JInput();
$component = $ji->getCmd('option', '');
$task = $ji->getCmd('task', '');
$view = $ji->getCmd('view', '');
$backedup = $ji->getInt('is_backed_up', 0);
// Perform a redirection on Joomla! Update download or install task, unless we have already backed up the site
if ($component == 'com_joomlaupdate' && $task == 'update.install' && !$backedup) {
$return_url = JURI::base() . 'index.php?option=com_joomlaupdate&task=update.install&is_backed_up=1';
$redirect_url = JURI::base() . 'index.php?option=com_akeeba&view=backup&autostart=1&returnurl=' . urlencode($return_url);
$app = JFactory::getApplication();
$app->redirect($redirect_url);
}
}
示例3: render
/**
* Render action template
*
* @param string $tmpl Template file name to render
* @return void
*/
public function render($tmpl, $data = array())
{
$widgetName = $this->request->getCmd('widget');
$tmplFile = JSN_PATH_TPLFRAMEWORK_LIBRARIES . '/widget/tmpl/' . $widgetName . '/' . $tmpl . '.php';
if (!is_file($tmplFile) || !is_readable($tmplFile)) {
throw new Exception('Template file not found: ' . $tmplFile);
}
// Extract data to seperated variables
extract($data);
// Start output buffer
ob_start();
// Load template file
include $tmplFile;
// Send rendered content to client
$this->responseContent = ob_get_clean();
}
示例4: array
echo JHTML::_('sliders.start', 'sliders', array('allowAllClose' => true, 'startOffset' => $this->active, 'startTransition' => true, true));
foreach ($tabs as $tab) {
$title = $tab->title;
echo JHTML::_('sliders.panel', $title, 'jfcpanel-panel-' . $tab->name);
?>
<div style="float: left;">
<table><?php
for ($i = 0; $i < count($link[$n]); $i++) {
$href =& $link[$n][$i];
$title =& $label[$n][$i];
$image =& $limage[$n][$i];
$text =& $label[$n][$i];
$allowed = true;
$data = JUri::getInstance($href)->getQuery(true);
$jinput = new JInput($data);
$task = $jinput->getCmd('task');
//$option = JRequest::getCmd('option');
if ($task != '' && $option == 'com_joomleague') {
if (!JFactory::getUser()->authorise($task, 'com_joomleague')) {
//display the task which is not handled by the access.xml
//return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR').' Task: ' .$task);
$allowed = false;
}
}
if ($allowed) {
echo '<tr><td><b><a href="' . $href . '" title="' . JText::_('JGLOBAL_AUTH_ACCESS_GRANTED') . '">' . $image . ' ' . $text . '</a></b></td></tr>';
} else {
echo '<tr><td><span title="' . JText::_('JGLOBAL_AUTH_ACCESS_DENIED') . '">' . $image . ' ' . $text . '</span></td></tr>';
}
}
?>
示例5: generateBodyClass
public function generateBodyClass()
{
$url = new JInput();
$itemid = $url->getVar('Itemid');
$menu = @$this->app->getMenu();
$active = @$menu->getActive();
$params = @$menu->getParams($active->id);
$class = NULL;
$class .= $this->get('style') == '-1' ? 'style-none' : $this->get('style');
$class .= ' align-' . $this->direction;
$class .= ' page-id-' . (isset($active) ? $active->id : $menu->getDefault()->id);
//Add class of homepage if it's home
if ($menu->getActive() == $menu->getDefault()) {
$class .= ' homepage ';
} else {
$view = $url->getWord('view');
$component = str_replace('_', '-', $url->getCmd('option'));
$class .= ' ' . $component . '-' . $view;
}
$class .= ' ' . strtolower($this->browser->getBrowser());
$class .= $this->displayComponent() ? '' : ' com-disabled';
$class .= ' ' . $params->get('pageclass_sfx');
return 'class="' . $class . '"';
}