当前位置: 首页>>代码示例>>PHP>>正文


PHP JUri::reset方法代码示例

本文整理汇总了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';
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:15,代码来源:JRouterSiteTest.php

示例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));
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:16,代码来源:JRouterSiteTest.php

示例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();
 }
开发者ID:nirpan,项目名称:joomla-cms,代码行数:17,代码来源:JRouterAdministratorTest.php

示例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();
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:18,代码来源:JURITest.php

示例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);
 }
开发者ID:nirpan,项目名称:joomla-cms,代码行数:22,代码来源:JRouterSiteTest.php

示例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();
 }
开发者ID:n9iels,项目名称:joomla-cms,代码行数:15,代码来源:JViewLegacyTest.php

示例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) {
开发者ID:kidaa30,项目名称:lojinha,代码行数:31,代码来源:default.php

示例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;
 }
开发者ID:naka211,项目名称:compac,代码行数:101,代码来源:helper.php

示例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();
 }
开发者ID:nirpan,项目名称:joomla-cms,代码行数:14,代码来源:JRouterTest.php


注:本文中的JUri::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。