本文整理汇总了PHP中JRequest::getURI方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::getURI方法的具体用法?PHP JRequest::getURI怎么用?PHP JRequest::getURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::getURI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$mainframe =& JFactory::getApplication();
$params = clone $mainframe->getParams('com_rsmembership');
$this->assignRef('params', $params);
$this->assignRef('memberships', $this->get('memberships'));
$this->assignRef('pagination', $this->get('pagination'));
$this->assignRef('total', $this->get('total'));
$this->assignRef('action', JRequest::getURI());
$this->assignRef('date_format', RSMembershipHelper::getConfig('date_format'));
$this->assignRef('transactions', $this->get('transactions'));
$this->assignRef('limitstart', JRequest::getInt('limitstart', 0));
$Itemid = JRequest::getInt('Itemid', 0);
if ($Itemid > 0) {
$this->assign('Itemid', '&Itemid=' . $Itemid);
} else {
$this->assign('Itemid', '');
}
if (RSMembershipHelper::isJ16()) {
// Description
if ($params->get('menu-meta_description')) {
$this->document->setDescription($params->get('menu-meta_description'));
}
// Keywords
if ($params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
}
// Robots
if ($params->get('robots')) {
$this->document->setMetadata('robots', $params->get('robots'));
}
}
parent::display();
}
示例2: __construct
function __construct()
{
parent::__construct();
$mainframe =& JFactory::getApplication();
$option = 'com_rsticketspro';
$user = JFactory::getUser();
if ($user->get('guest')) {
$link = JRequest::getURI();
$link = base64_encode($link);
$user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
}
$ticket_viewing_history = RSTicketsProHelper::getConfig('ticket_viewing_history');
if (!$ticket_viewing_history) {
JError::raiseWarning(500, JText::_('RST_CANNOT_VIEW_HISTORY'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
if ($ticket_viewing_history == 1 && !RSTicketsProHelper::isStaff()) {
JError::raiseWarning(500, JText::_('RST_CANNOT_VIEW_HISTORY'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
$this->_db = JFactory::getDBO();
// Get pagination request variables
$limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
// In case limit has been changed, adjust it
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState($option . '.history.limit', $limit);
$this->setState($option . '.history.limitstart', $limitstart);
$this->_query = $this->_buildQuery();
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::root(true) . '/templates/system/css/system.css');
$document->addStyleSheet(JURI::root(true) . '/templates/system/css/general.css');
}
示例3: display
/**
* Display the view
*/
function display()
{
$document = JFactory::getDocument();
$viewName = str_replace('FabrikControllerVisualization', '', get_class($this));
if ($viewName == '') {
// if we are using a url like http://localhost/fabrik3.0.x/index.php?option=com_fabrik&view=visualization&id=6
// then we need to ascertain which viz to use
$viewName = $this->getViewName();
}
$viewType = $document->getType();
// Set the default view name from the Request
$view = $this->getView($viewName, $viewType);
// Push a model into the view
$model = $this->getModel($viewName);
if (!JError::isError($model)) {
$view->setModel($model, true);
}
// Display the view
$view->assign('error', $this->getError());
// f3 cache with raw view gives error
if (in_array(JRequest::getCmd('format'), array('raw', 'csv'))) {
$view->display();
} else {
$post = JRequest::get('post');
//build unique cache id on url, post and user id
$user = JFactory::getUser();
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache = JFactory::getCache('com_fabrik', 'view');
$cache->get($view, 'display', $cacheid);
}
}
示例4: __construct
function __construct()
{
parent::__construct();
$mainframe =& JFactory::getApplication();
$option = 'com_rsticketspro';
$user = JFactory::getUser();
if ($user->get('guest')) {
$link = JRequest::getURI();
$link = base64_encode($link);
$user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
}
if (!RSTicketsProHelper::isStaff()) {
JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_VIEW_USERS'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
$this->_permissions = RSTicketsProHelper::getCurrentPermissions();
if (!$this->_permissions->add_ticket_customers && !$this->_permissions->add_ticket_staff) {
JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_VIEW_USERS'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
$this->_db = JFactory::getDBO();
// Get pagination request variables
$limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
// In case limit has been changed, adjust it
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState($option . '.users.limit', $limit);
$this->setState($option . '.users.limitstart', $limitstart);
$this->_query = $this->_buildQuery();
}
示例5: display
/**
* Display the view
*/
function display()
{
$document =& JFactory::getDocument();
$viewName = str_replace('FabrikControllerVisualization', '', get_class($this));
$viewType = $document->getType();
// Set the default view name from the Request
$view =& $this->getView($viewName, $viewType);
//create a form view as well to render the add event form.
$view->_formView =& $this->getView('Form', $viewType);
$formModel =& $this->getModel('Form');
$view->_formView->setModel($formModel, true);
// Push a model into the view
$model =& $this->getModel($viewName);
if (!JError::isError($model)) {
//$model->setAdmin( false);
$view->setModel($model, true);
}
// Display the view
$view->assign('error', $this->getError());
$post = JRequest::get('post');
//build unique cache id on url, post and user id
$user =& JFactory::getUser();
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache =& JFactory::getCache('com_fabrik', 'view');
echo $cache->get($view, 'display', $cacheid);
}
示例6: display
/**
* Display the view
*/
function display($model = null)
{
//menu links use fabriklayout parameters rather than layout
$flayout = JRequest::getVar('fabriklayout');
if ($flayout != '') {
JRequest::setVar('layout', $flayout);
}
$document =& JFactory::getDocument();
$viewName = JRequest::getVar('view', 'table', 'default', 'cmd');
$modelName = $viewName;
$layout = JRequest::getWord('layout', 'default');
$viewType = $document->getType();
// Set the default view name from the Request
$view =& $this->getView($viewName, $viewType);
$view->setLayout($layout);
// Push a model into the view
if (is_null($model)) {
$model =& $this->getModel($modelName);
}
if (!JError::isError($model) && is_object($model)) {
$view->setModel($model, true);
}
// Display the view
$view->assign('error', $this->getError());
$post = JRequest::get('post');
if ($model->getParams()->get('list_disable_caching', '0') !== '1') {
//build unique cache id on url, post and user id
$user =& JFactory::getUser();
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache =& JFactory::getCache('com_fabrik', 'view');
$cache->get($view, 'display', $cacheid);
} else {
$view->display();
}
}
示例7: view
/**
* Show the form in the admin
*
* @return null
*/
public function view()
{
$document = JFactory::getDocument();
$model = JModel::getInstance('Form', 'FabrikFEModel');
$viewType = $document->getType();
$this->setPath('view', COM_FABRIK_FRONTEND . '/views');
$viewLayout = JRequest::getCmd('layout', 'default');
$view = $this->getView('form', $viewType, '');
$view->setModel($model, true);
$view->isMambot = $this->isMambot;
// Set the layout
$view->setLayout($viewLayout);
// @TODO check for cached version
JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_FORMS'), 'forms.png');
if (in_array(JRequest::getCmd('format'), array('raw', 'csv', 'pdf'))) {
$view->display();
} else {
$user = JFactory::getUser();
$post = JRequest::get('post');
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache = JFactory::getCache('com_fabrik', 'view');
ob_start();
$cache->get($view, 'display', $cacheid);
$contents = ob_get_contents();
ob_end_clean();
$token = JUtility::getToken();
$search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
$replacement = '<input type="hidden" name="' . $token . '" value="1" />';
echo preg_replace($search, $replacement, $contents);
}
FabrikAdminHelper::addSubmenu(JRequest::getWord('view', 'lists'));
}
示例8: __construct
function __construct()
{
parent::__construct();
$mainframe =& JFactory::getApplication();
$option = 'com_rsticketspro';
$user = JFactory::getUser();
if ($user->get('guest')) {
$link = JRequest::getURI();
$link = base64_encode($link);
$user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
}
if (!RSTicketsProHelper::isStaff()) {
JError::raiseWarning(500, JText::_('RST_CUSTOMER_CANNOT_VIEW_SEARCHES'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
$task = JRequest::getVar('task');
if ($task == 'edit' || $task == 'save' || $task == 'search') {
$this->_getSearch();
}
$filter_order = $mainframe->getUserStateFromRequest($option . '.searches.filter_order', 'filter_order', 'ordering');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option . '.searches.filter_order_Dir', 'filter_order_Dir', 'ASC');
$this->setState($option . '.searches.filter_order', $filter_order);
$this->setState($option . '.searches.filter_order_Dir', $filter_order_Dir);
$this->_query = $this->_buildQuery();
}
示例9: display
/**
* Display the view
*/
function display($model = null)
{
$document = JFactory::getDocument();
$viewName = JRequest::getVar('view', 'list', 'default', 'cmd');
$modelName = $viewName;
$layout = JRequest::getWord('layout', 'default');
$viewType = $document->getType();
// Set the default view name from the Request
$view = $this->getView($viewName, $viewType);
$view->setLayout($layout);
// Push a model into the view
if (is_null($model)) {
$model = $this->getModel($modelName, 'FabrikFEModel');
}
if (!JError::isError($model) && is_object($model)) {
$view->setModel($model, true);
}
// Display the view
$view->assign('error', $this->getError());
$post = JRequest::get('post');
//build unique cache id on url, post and user id
$user = JFactory::getUser();
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache = JFactory::getCache('com_fabrik', 'view');
// f3 cache with raw view gives error
if (in_array(JRequest::getCmd('format'), array('raw', 'csv', 'pdf', 'json', 'fabrikfeed'))) {
$view->display();
} else {
$cache->get($view, 'display', $cacheid);
}
}
示例10: display
/**
* Display the view
*
* @return null
*/
public function display()
{
$document = JFactory::getDocument();
$viewName = $this->getViewName();
$viewType = $document->getType();
// Set the default view name from the Request
$view = $this->getView($viewName, $viewType);
// Push a model into the view
$model = $this->getModel($viewName);
if (!JError::isError($model)) {
$view->setModel($model, true);
}
// Display the view
$view->assign('error', $this->getError());
// F3 cache with raw view gives error
if (in_array(JRequest::getCmd('format'), array('raw', 'csv'))) {
$view->display();
} else {
$post = JRequest::get('post');
// Build unique cache id on url, post and user id
$user = JFactory::getUser();
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache = JFactory::getCache('com_fabrik', 'view');
$cache->get($view, 'display', $cacheid);
}
}
示例11: __construct
function __construct()
{
parent::__construct();
$mainframe =& JFactory::getApplication();
$option = 'com_rsticketspro';
$user = JFactory::getUser();
if ($user->get('guest')) {
$link = JRequest::getURI();
$link = base64_encode($link);
$user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
}
if (!RSTicketsProHelper::isStaff()) {
JError::raiseWarning(500, JText::_('RST_CANNOT_CHANGE_SIGNATURE'));
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
}
$this->_db = JFactory::getDBO();
$this->_db->setQuery("SELECT id FROM #__rsticketspro_staff WHERE user_id='" . (int) $user->get('id') . "' LIMIT 1");
if (!$this->_db->loadResult()) {
JError::raiseWarning(500, JText::_('RST_CANNOT_CHANGE_SIGNATURE_MUST_BE_STAFF'));
$referer = @$_SERVER['HTTP_REFERER'];
if (empty($referer)) {
$mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
} else {
$mainframe->redirect($referer);
}
}
}
示例12: getDisplayTab
function getDisplayTab($tab, $user, $ui)
{
// $$$ hugh - added privacy option, so you can restrict who sees the tab, requested on forums:
// http://fabrikar.com/forums/showthread.php?p=128127#post128127
// privacy setting:
// 0 = public
// 1 = profile owner only
// 2 = profile owner and admins
$private = (int) $this->params->get('fabrik_private', '0');
if ($private > 0) {
$viewer = JFactory::getuser();
if ($private === 1) {
if ($user->get('user_id') != $viewer->get('id')) {
return false;
}
} else {
if ($private === 2) {
if ($user->get('id') !== $viewer->get('id') && ($viewer->get('gid') != 24 && $viewer->get('gid') != 25)) {
return false;
}
}
}
}
$dispatcher = new JDispatcher();
JPluginHelper::importPlugin('content', 'fabrik', true, $dispatcher);
$dispatcher->register('content', 'plgContentFabrik');
$args = array();
$article = new stdClass();
$txt = $this->params->get('plugintext');
// $$$ hugh - set profile user in session so Fabrik user element can get at it
// TODO - should really make this table/form specific!
$session =& JFactory::getSession();
// $$$ hugh - testing using a unique session hash, which we will stuff in the
// plugin args, and will get added where necessary in Fabrik lists and forms so
// we can actually track the right form submissions with their coresponding CB
// profiles.
$social_hash = md5(serialize(array(JRequest::getURI(), $tab, $user)));
$session->set('fabrik.plugin.' . $social_hash . '.profile_id', $user->get('id'));
// do the old style one without the hash for backward compat
$session->set('fabrik.plugin.profile_id', $user->get('id'));
$txt = rtrim($txt, '}') . " fabrik_social_profile_hash=" . $social_hash . '}';
//do some dynamic replacesments with the owner's data
foreach ($user as $k => $v) {
if (strstr($txt, "{\$my->{$k}}")) {
$txt = str_replace("{\$my->{$k}}", $v, $txt);
}
// $$$ hugh - might as well stuff the entire CB user object in the session
$session->set('fabrik.plugin.' . $social_hash . '.' . $k, $v);
}
$params = new stdClass();
$args[] = 0;
$article->text = $txt;
$args[] =& $article;
$args[] =& $params;
$res = $dispatcher->trigger('onContentPrepare', $args);
// $$$ peamak http://fabrikar.com/forums/showthread.php?t=10446&page=2
$dispatcher->register('content', 'plgContentFabrik');
return $article->text;
}
示例13: __construct
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.0
*/
function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
//Set the language in the class
$config = JFactory::getConfig();
$options = array('defaultgroup' => 'page', 'browsercache' => $this->params->get('browsercache', false), 'caching' => false);
$this->_cache = JCache::getInstance('page', $options);
$this->_cache_key = JRequest::getURI();
}
示例14: display
/**
* Display the view
*/
function display()
{
$session = JFactory::getSession();
//menu links use fabriklayout parameters rather than layout
$flayout = JRequest::getVar('fabriklayout');
if ($flayout != '') {
JRequest::setVar('layout', $flayout);
}
$document = JFactory::getDocument();
$viewName = JRequest::getVar('view', 'form', 'default', 'cmd');
$modelName = $viewName;
if ($viewName == 'emailform') {
$modelName = 'form';
}
$viewType = $document->getType();
// Set the default view name from the Request
$view = &$this->getView($viewName, $viewType);
// Push a model into the view (may have been set in content plugin already
$model = !isset($this->_model) ? $this->getModel($modelName, 'FabrikFEModel') : $this->_model;
//if errors made when submitting from a J plugin they are stored in the session
//lets get them back and insert them into the form model
if (empty($model->_arErrors)) {
$context = 'com_fabrik.form.'.JRequest::getInt('formid');
$model->_arErrors = $session->get($context.'.errors', array());
$session->clear($context.'.errors');
}
if (!JError::isError($model) && is_object($model)) {
$view->setModel($model, true);
}
$view->isMambot = $this->isMambot;
// Display the view
$view->assign('error', $this->getError());
// Workaround for token caching
if (in_array(JRequest::getCmd('format'), array('raw', 'csv'))) {
$view->display();
} else {
$user = JFactory::getUser();
$post = JRequest::get('post');
$cacheid = serialize(array(JRequest::getURI(), $post, $user->get('id'), get_class($view), 'display', $this->cacheId));
$cache = JFactory::getCache('com_fabrik', 'view');
ob_start();
$cache->get($view, 'display', $cacheid);
$contents = ob_get_contents();
ob_end_clean();
$token = JUtility::getToken();
$search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
$replacement = '<input type="hidden" name="'.$token.'" value="1" />';
echo preg_replace($search, $replacement, $contents);
}
}
示例15: getCurrentURL
function getCurrentURL()
{
$cururl = JRequest::getURI();
if (($pos = strpos($cururl, "index.php")) !== false) {
$cururl = substr($cururl, $pos);
}
$cururl = JRoute::_($cururl, true, 0);
return $cururl;
}