本文整理汇总了PHP中JUri::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP JUri::getVar方法的具体用法?PHP JUri::getVar怎么用?PHP JUri::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUri
的用法示例。
在下文中一共展示了JUri::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['include_entries'] = JArrayHelper::getValue($params, 'include_entries', 1);
$params['include_entries'] = $params['include_entries'] == 1 || $params['include_entries'] == 2 && $xmap->view == 'xml' || $params['include_entries'] == 3 && $xmap->view == 'html';
$params['include_expired_entries'] = JArrayHelper::getValue($params, 'include_expired_entries', 0);
$params['include_expired_entries'] = $params['include_expired_entries'] == 1 || $params['include_expired_entries'] == 2 && $xmap->view == 'xml' || $params['include_expired_entries'] == 3 && $xmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
if ($params['category_priority'] == -1) {
$params['category_priority'] = $parent->priority;
}
if ($params['category_changefreq'] == -1) {
$params['category_changefreq'] = $parent->changefreq;
}
$params['entry_priority'] = JArrayHelper::getValue($params, 'entry_priority', $parent->priority);
$params['entry_changefreq'] = JArrayHelper::getValue($params, 'entry_changefreq', $parent->changefreq);
if ($params['entry_priority'] == -1) {
$params['entry_priority'] = $parent->priority;
}
if ($params['entry_changefreq'] == -1) {
$params['entry_changefreq'] = $parent->changefreq;
}
switch ($uri->getVar('view')) {
case 'front':
self::getCategoryTree($xmap, $parent, $params, 0);
break;
case 'list':
self::getEntries($xmap, $parent, $params, $uri->getVar('catid'));
break;
}
}
示例2: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*
* @throws Exception
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['language_filter'] = JFactory::getApplication()->getLanguageFilter();
$params['enable_imagemap'] = JArrayHelper::getValue($params, 'enable_imagemap', 0);
$params['image_type'] = JArrayHelper::getValue($params, 'image_type', 'original');
$params['include_images'] = JArrayHelper::getValue($params, 'include_images', 1);
$params['include_images'] = $params['include_images'] == 1 || $params['include_images'] == 2 && $xmap->view == 'xml' || $params['include_images'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
if ($params['category_priority'] == -1) {
$params['category_priority'] = $parent->priority;
}
if ($params['category_changefreq'] == -1) {
$params['category_changefreq'] = $parent->changefreq;
}
$params['image_priority'] = JArrayHelper::getValue($params, 'image_priority', $parent->priority);
$params['image_changefreq'] = JArrayHelper::getValue($params, 'image_changefreq', $parent->changefreq);
if ($params['image_priority'] == -1) {
$params['image_priority'] = $parent->priority;
}
if ($params['image_changefreq'] == -1) {
$params['image_changefreq'] = $parent->changefreq;
}
self::getCategoryTree($xmap, $parent, $params, $uri->getVar('id', 0));
}
示例3: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['include_events'] = JArrayHelper::getValue($params, 'include_events', 1);
$params['include_events'] = $params['include_events'] == 1 || $params['include_events'] == 2 && $xmap->view == 'xml' || $params['include_events'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
if ($params['category_priority'] == -1) {
$params['category_priority'] = $parent->priority;
}
if ($params['category_changefreq'] == -1) {
$params['category_changefreq'] = $parent->changefreq;
}
$params['event_priority'] = JArrayHelper::getValue($params, 'event_priority', $parent->priority);
$params['event_changefreq'] = JArrayHelper::getValue($params, 'event_changefreq', $parent->changefreq);
if ($params['event_priority'] == -1) {
$params['event_priority'] = $parent->priority;
}
if ($params['event_changefreq'] == -1) {
$params['event_changefreq'] = $parent->changefreq;
}
self::getEvents($xmap, $parent, $params, $uri->getVar('catid'));
}
示例4: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if ($xmap->isNews || !self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['include_topics'] = JArrayHelper::getValue($params, 'include_topics', 1);
$params['include_topics'] = $params['include_topics'] == 1 || $params['include_topics'] == 2 && $xmap->view == 'xml' || $params['include_topics'] == 3 && $xmap->view == 'html';
$params['include_pagination'] = JArrayHelper::getValue($params, 'include_pagination', 0);
$params['include_pagination'] = $params['include_pagination'] == 1 || $params['include_pagination'] == 2 && $xmap->view == 'xml' || $params['include_pagination'] == 3 && $xmap->view == 'html';
$params['cat_priority'] = JArrayHelper::getValue($params, 'cat_priority', $parent->priority);
$params['cat_priority'] = $params['cat_priority'] == -1 ? $parent->priority : $params['cat_priority'];
$params['cat_changefreq'] = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
$params['cat_changefreq'] = $params['cat_changefreq'] == -1 ? $parent->changefreq : $params['cat_changefreq'];
$params['topic_priority'] = JArrayHelper::getValue($params, 'topic_priority', $parent->changefreq);
$params['topic_priority'] = $params['topic_priority'] == -1 ? $parent->priority : $params['topic_priority'];
$params['topic_changefreq'] = JArrayHelper::getValue($params, 'topic_changefreq', $parent->changefreq);
$params['topic_changefreq'] = $params['topic_changefreq'] == -1 ? $parent->changefreq : $params['topic_changefreq'];
if ($params['include_topics']) {
if ((int) ($limit = JArrayHelper::getValue($params, 'max_topics', 0))) {
$params['limit'] = $limit;
} else {
$params['limit'] = 0;
}
if ((int) ($days = JArrayHelper::getValue($params, 'max_age', 0))) {
$params['days'] = JFactory::getDate()->toUnix() - intval($days) * 86400;
} else {
$params['days'] = '';
}
}
self::getCategoryTree($xmap, $parent, $params, $uri->getVar('catid', 0));
}
示例5: testDelVar
/**
* Test the delVar method.
*
* @return void
*
* @since 11.1
* @covers JUri::delVar
*/
public function testDelVar()
{
$this->object->parse('http://someuser:somepass@www.example.com:80/path/file.html?var=value#fragment');
$this->assertThat($this->object->getVar('var'), $this->equalTo('value'));
$this->object->delVar('var');
$this->assertThat($this->object->getVar('var'), $this->equalTo(''));
}
示例6: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['language_filter'] = $uri->getVar('tag_list_language_filter');
$params['include_tags'] = JArrayHelper::getValue($params, 'include_tags', 1);
$params['include_tags'] = $params['include_tags'] == 1 || $params['include_tags'] == 2 && $xmap->view == 'xml' || $params['include_tags'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['tag_priority'] = JArrayHelper::getValue($params, 'tag_priority', $parent->priority);
$params['tag_changefreq'] = JArrayHelper::getValue($params, 'tag_changefreq', $parent->changefreq);
if ($params['tag_priority'] == -1) {
$params['tag_priority'] = $parent->priority;
}
if ($params['tag_changefreq'] == -1) {
$params['tag_changefreq'] = $parent->changefreq;
}
switch ($uri->getVar('view')) {
case 'tags':
self::getTagsTree($xmap, $parent, $params, $uri->getVar('parent_id', 0));
break;
case 'tag':
self::getTagTree($xmap, $parent, $params, (array) $uri->getVar('id'), (array) $uri->getVar('types'));
break;
}
}
示例7: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*
* @return bool
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('layout'), self::$layouts)) {
return false;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['language_filter'] = JFactory::getApplication()->getLanguageFilter();
$params['include_items'] = JArrayHelper::getValue($params, 'include_items', 1);
$params['include_items'] = $params['include_items'] == 1 || $params['include_items'] == 2 && $xmap->view == 'xml' || $params['include_items'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_priority'] = $params['category_priority'] == -1 ? $parent->priority : $params['category_priority'];
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
$params['category_changefreq'] = $params['category_changefreq'] == -1 ? $parent->changefreq : $params['category_changefreq'];
$params['item_priority'] = JArrayHelper::getValue($params, 'item_priority', $parent->priority);
$params['item_priority'] = $params['item_priority'] == -1 ? $parent->priority : $params['item_priority'];
$params['item_changefreq'] = JArrayHelper::getValue($params, 'item_changefreq', $parent->changefreq);
$params['item_changefreq'] = $params['item_changefreq'] == -1 ? $parent->changefreq : $params['item_changefreq'];
switch ($uri->getVar('layout')) {
case 'category':
$categories = JFactory::getApplication()->getMenu()->getItem($parent->id)->params->get('categories');
if (count($categories) == 1) {
return self::getItems($xmap, $parent, $params, 'category', $categories[0]);
} elseif (count($categories) > 1) {
return self::getCategoryTree($xmap, $parent, $params, 0, $categories);
} else {
return self::getCategoryTree($xmap, $parent, $params, 0);
}
break;
case 'tag':
return self::getItems($xmap, $parent, $params, 'tag', $uri->getVar('tag'));
break;
case 'user':
return self::getItems($xmap, $parent, $params, 'user', $uri->getVar('id'));
break;
}
}
示例8: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*
* @throws Exception
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['language_filter'] = JFactory::getApplication()->getLanguageFilter();
$params['itemid_workaround'] = JArrayHelper::getValue($params, 'itemid_workaround', 0);
$params['include_downloads'] = JArrayHelper::getValue($params, 'include_downloads', 1);
$params['include_downloads'] = $params['include_downloads'] == 1 || $params['include_downloads'] == 2 && $xmap->view == 'xml' || $params['include_downloads'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
if ($params['category_priority'] == -1) {
$params['category_priority'] = $parent->priority;
}
if ($params['category_changefreq'] == -1) {
$params['category_changefreq'] = $parent->changefreq;
}
$params['download_priority'] = JArrayHelper::getValue($params, 'download_priority', $parent->priority);
$params['download_changefreq'] = JArrayHelper::getValue($params, 'download_changefreq', $parent->changefreq);
if ($params['download_priority'] == -1) {
$params['download_priority'] = $parent->priority;
}
if ($params['download_changefreq'] == -1) {
$params['download_changefreq'] = $parent->changefreq;
}
switch ($uri->getVar('view')) {
case 'categories':
self::getCategoryTree($xmap, $parent, $params, 0);
break;
case 'category':
self::getDownloads($xmap, $parent, $params, $uri->getVar('id'));
break;
}
}
示例9: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*
* @throws Exception
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['include_newsletter'] = JArrayHelper::getValue($params, 'include_newsletter', 1);
$params['include_newsletter'] = $params['include_newsletter'] == 1 || $params['include_newsletter'] == 2 && $xmap->view == 'xml' || $params['include_newsletter'] == 3 && $xmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $xmap->view == 'xml' || $params['show_unauth'] == 3 && $xmap->view == 'html';
$params['list_priority'] = JArrayHelper::getValue($params, 'list_priority', $parent->priority);
$params['list_changefreq'] = JArrayHelper::getValue($params, 'list_changefreq', $parent->changefreq);
if ($params['list_priority'] == -1) {
$params['list_priority'] = $parent->priority;
}
if ($params['list_changefreq'] == -1) {
$params['list_changefreq'] = $parent->changefreq;
}
$params['newsletter_priority'] = JArrayHelper::getValue($params, 'newsletter_priority', $parent->priority);
$params['newsletter_changefreq'] = JArrayHelper::getValue($params, 'newsletter_changefreq', $parent->changefreq);
if ($params['newsletter_priority'] == -1) {
$params['newsletter_priority'] = $parent->priority;
}
if ($params['newsletter_changefreq'] == -1) {
$params['newsletter_changefreq'] = $parent->changefreq;
}
switch ($uri->getVar('view')) {
case 'lists':
self::getListsTree($xmap, $parent, $params);
break;
case 'archive':
$item = JFactory::getApplication()->getMenu()->getItem($parent->id);
self::getNewsletter($xmap, $parent, $params, $item->params->get('listid'));
break;
}
}
示例10: getTree
public function getTree($osmap, $parent, &$params)
{
$uri = new JUri($parent->link);
if (!static::isEnabled() || !in_array($uri->getVar('view'), static::$views)) {
return;
}
$params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$params['language_filter'] = JFactory::getApplication()->getLanguageFilter();
$params['include_links'] = JArrayHelper::getValue($params, 'include_links', 1);
$params['include_links'] = $params['include_links'] == 1 || $params['include_links'] == 2 && $osmap->view == 'xml' || $params['include_links'] == 3 && $osmap->view == 'html';
$params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0);
$params['show_unauth'] = $params['show_unauth'] == 1 || $params['show_unauth'] == 2 && $osmap->view == 'xml' || $params['show_unauth'] == 3 && $osmap->view == 'html';
$params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority);
$params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq);
if ($params['category_priority'] == -1) {
$params['category_priority'] = $parent->priority;
}
if ($params['category_changefreq'] == -1) {
$params['category_changefreq'] = $parent->changefreq;
}
$params['link_priority'] = JArrayHelper::getValue($params, 'link_priority', $parent->priority);
$params['link_changefreq'] = JArrayHelper::getValue($params, 'link_changefreq', $parent->changefreq);
if ($params['link_priority'] == -1) {
$params['link_priority'] = $parent->priority;
}
if ($params['link_changefreq'] == -1) {
$params['link_changefreq'] = $parent->changefreq;
}
switch ($uri->getVar('view')) {
case 'categories':
static::getCategoryTree($osmap, $parent, $params, $uri->getVar('id'));
break;
case 'category':
static::getlinks($osmap, $parent, $params, $uri->getVar('id'));
break;
}
}
示例11: getTree
/**
* @param XmapDisplayerInterface $xmap
* @param stdClass $parent
* @param array $params
*/
public static function getTree($xmap, stdClass $parent, array &$params)
{
$uri = new JUri($parent->link);
if (!self::$enabled || !in_array($uri->getVar('view'), self::$views)) {
return;
}
$params['level_priority'] = JArrayHelper::getValue($params, 'level_priority', $parent->priority);
$params['level_changefreq'] = JArrayHelper::getValue($params, 'level_changefreq', $parent->changefreq);
if ($params['level_priority'] == -1) {
$params['level_priority'] = $parent->priority;
}
if ($params['level_changefreq'] == -1) {
$params['level_changefreq'] = $parent->changefreq;
}
self::getLevels($xmap, $parent, $params);
}
示例12: smartUrlConvertor
/**
* smartUrlConvertor
*
* @param JUri $uri
* @param array $button
*
* @return mixed
*/
public function smartUrlConvertor($uri, $button)
{
// fix task redirect
if ($uri->getVar('layout') == 'edit') {
$uri->setVar('task', "{$uri->getVar('view')}.{$uri->getVar('layout')}");
$uri->delVar('view');
$uri->delVar('layout');
}
return $uri;
}
示例13: appendHtml
/**
* @param array $matches
* @return string
*/
private function appendHtml(array $matches)
{
$html = $matches[0];
if (strpos($matches[2], 'task=style.edit')) {
$uri = new JUri($matches[2]);
$id = (int) $uri->getVar('id');
if ($id && in_array($uri->getVar('option'), ['com_templates', 'com_advancedtemplates']) && isset($this->styles[$id])) {
$html = $matches[1] . $uri . $matches[3] . $matches[4] . $matches[5];
$html .= ' <span class="label" style="background:#439a86;color:#fff;">Gantry 5</span>';
}
}
return $html;
}
示例14: _appendHtml
/**
* Appends HTML to menu items
*
* @param array $matches Don't remember
* @param string $content Don't remember
*
* @return string Html with MenuAry badges inserted
*/
private function _appendHtml(array $matches, $content = 'MenuAry')
{
$html = $matches[0];
if (strpos($matches[2], 'task=item.edit')) {
$uri = new JUri($matches[2]);
$id = (int) $uri->getVar('id');
if ($id && in_array($uri->getVar('option'), array('com_menus')) && in_array($id, $this->menuitems)) {
$html = $matches[1] . $uri . $matches[3] . $matches[4] . $matches[5];
$html .= '
<span
onMouseOver="this.style.color=\'#00F\'"
onMouseOut="this.style.color=\'#000\'"
class="hasTip icon-power-cord" style="
cursor: help;"
title="' . JText::_('PLG_MENUARY_MENUITEM_TOOLTIP') . '"></span>';
}
}
return $html;
}
示例15: check
protected static function check($item, JUri $uri)
{
$hits = 0;
foreach ($item->query as $var => $value)
{
if ($value != $uri->getVar($var)) {
return 0;
}
$hits++;
}
return $hits;
}