本文整理汇总了PHP中JUri::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP JUri::reset方法的具体用法?PHP JUri::reset怎么用?PHP JUri::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUri
的用法示例。
在下文中一共展示了JUri::reset方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.4
*/
protected function setUp()
{
parent::setUp();
JUri::reset();
$this->server = $_SERVER;
$_SERVER['HTTP_HOST'] = 'mydomain.com';
}
示例2: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.4
*/
protected function setUp()
{
parent::setUp();
JUri::reset();
$this->server = $_SERVER;
$_SERVER['HTTP_HOST'] = 'mydomain.com';
$this->object = new JRouterSite($this->getMockCmsApp(), TestMockMenu::create($this));
}
示例3: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.0
*/
protected function setUp()
{
parent::setUp();
$this->server = $_SERVER;
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['SCRIPT_NAME'] = '';
JUri::reset();
$this->object = new JRouterAdministrator();
}
示例4: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 11.1
*/
protected function setUp()
{
parent::setUp();
JUri::reset();
$_SERVER['HTTP_HOST'] = 'www.example.com:80';
$_SERVER['SCRIPT_NAME'] = '/joomla/index.php';
$_SERVER['PHP_SELF'] = '/joomla/index.php';
$_SERVER['REQUEST_URI'] = '/joomla/index.php?var=value 10';
$this->object = new JUri();
}
示例5: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.4
*/
protected function setUp()
{
parent::setUp();
$this->server = $_SERVER;
$_SERVER['HTTP_HOST'] = 'mydomain.com';
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0';
$_SERVER['REQUEST_URI'] = '/index.php';
$_SERVER['SCRIPT_NAME'] = '/index.php';
JUri::reset();
$options = array();
$app = $this->getMockCmsApp();
$menu = TestMockMenu::create($this);
$this->object = new JRouterSiteInspector($options, $app, $menu);
}
示例6: tearDown
/**
* Overrides the parent tearDown method.
*
* @since 12.1
*
* @return void
*/
protected function tearDown()
{
$this->restoreFactoryState();
$_SERVER = $this->server;
JUri::reset();
unset($this->class);
parent::tearDown();
}
示例7: unset
<?php
}
?>
<?php
JUri::reset();
$uri = JUri::getInstance();
$query = $uri->getQuery(true);
$query['djreviews_action'] = 'add';
if (isset($query['djreviews_review'])) {
unset($query['djreviews_review']);
}
$uri->setQuery($query);
$uri->setFragment('your-review');
$add_link = $uri->toString();
JUri::reset();
?>
<?php
if ($user->authorise('core.create', 'com_djreviews') || $user->authorise('review.create', 'com_djreviews')) {
?>
<a data-action="add" class="btn button djrv_add_button" href="<?php
echo JRoute::_($add_link);
?>
"><?php
echo JText::_('COM_DJREVIEWS_ADD_REVIEW_BUTTON');
?>
</a>
<?php
} else {
if ($user->guest) {
示例8: getList
//.........这里部分代码省略.........
if (empty($vars['id'])) {
$tmpid = $tmpuri->getVar('id');
if (!empty($tmpid)) {
$vars['id'] = $tmpuri->getVar('id');
} else {
continue;
}
}
$item = $model->getItem($vars['id']);
//get alias of content item without the id , so i don't have the translation
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('alias')->from('#__content')->where('id = ' . (int) $item->id);
$db->setQuery($query);
$alias = $db->loadResult();
$vars['id'] = $item->id . ':' . $alias;
$vars['catid'] = $item->catid . ':' . $item->category_alias;
}
//new version 1.5
//case for k2 item alias write twice
//since k2 v 1.6.9 $vars['task'] don't exist.
if (isset($vars['option']) && $vars['option'] == 'com_k2') {
if (isset($vars['task']) && $vars['task'] == $vars['id']) {
unset($vars['id']);
}
}
$url = 'index.php?' . JURI::buildQuery($vars);
$language->link = JRoute::_($url);
//TODO check performance 3 queries by languages -1
/**
* Replace the slug from the language switch with correctly translated slug.
* $language->lang_code language de la boucle (icone lien)
* $lang->getTag() => language en cours sur le site
* $default_lang langue par default du site
*/
if ($lang->getTag() != $language->lang_code && !empty($vars['Itemid'])) {
$fManager = FalangManager::getInstance();
$id_lang = $fManager->getLanguageID($language->lang_code);
$db = JFactory::getDbo();
// get translated path if exist
$query = $db->getQuery(true);
$query->select('fc.value')->from('#__falang_content fc')->where('fc.reference_id = ' . (int) $vars['Itemid'])->where('fc.language_id = ' . (int) $id_lang)->where('fc.reference_field = \'path\'')->where('fc.reference_table = \'menu\'');
$db->setQuery($query);
$translatedPath = $db->loadResult();
// $translatedPath not exist if not translated or site default language
// don't pass id to the query , so no translation given by falang
$query = $db->getQuery(true);
$query->select('m.path')->from('#__menu m')->where('m.id = ' . (int) $vars['Itemid']);
$db->setQuery($query);
$originalPath = $db->loadResult();
$pathInUse = null;
//si on est sur une page traduite on doit récupérer la traduction du path en cours
if ($default_lang != $lang->getTag()) {
$id_lang = $fManager->getLanguageID($lang->getTag());
// get translated path if exist
$query = $db->getQuery(true);
$query->select('fc.value')->from('#__falang_content fc')->where('fc.reference_id = ' . (int) $vars['Itemid'])->where('fc.language_id = ' . (int) $id_lang)->where('fc.reference_field = \'path\'')->where('fc.reference_table = \'menu\'');
$db->setQuery($query);
$pathInUse = $db->loadResult();
}
if (!isset($translatedPath)) {
$translatedPath = $originalPath;
}
// not exist if not translated or site default language
if (!isset($pathInUse)) {
$pathInUse = $originalPath;
}
//make replacement in the url
//si language de boucle et language site
if ($language->lang_code == $default_lang) {
if (isset($pathInUse) && isset($originalPath)) {
$language->link = str_replace($pathInUse, $originalPath, $language->link);
}
} else {
if (isset($pathInUse) && isset($translatedPath)) {
$language->link = str_replace($pathInUse, $translatedPath, $language->link);
}
}
}
} else {
if (version_compare(JVERSION, '3.4.3', 'ge')) {
JUri::reset();
$uri = JUri::getInstance();
$uri->setVar('lang', $language->sef);
$language->link = JUri::getInstance()->toString(array('scheme', 'host', 'port', 'path', 'query'));
//fix problem on mod_login (same position before falang module
JUri::reset();
} else {
//we can't remove default language in the link
$uri->setVar('lang', $language->sef);
$language->link = 'index.php?' . $uri->getQuery();
}
}
}
} else {
$language->link = 'index.php';
}
}
return $languages;
}
示例9: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.1
*/
protected function setUp()
{
parent::setUp();
JUri::reset();
$this->object = new JRouter();
}