本文整理汇总了PHP中SEFTools::getNonSefVars方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::getNonSefVars方法的具体用法?PHP SEFTools::getNonSefVars怎么用?PHP SEFTools::getNonSefVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SEFTools
的用法示例。
在下文中一共展示了SEFTools::getNonSefVars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
//.........这里部分代码省略.........
$config->set('sef_suffix', 0);
return;
} else {
// Disable global "Add suffix to URLs"
$config->set('sef_suffix', 0);
if ($handling == '3') {
// Basic rewriting
$class = 'SefExt_Basic';
} else {
if (file_exists($ownExt)) {
$class = 'SefExt_' . $option;
} else {
$class = 'SefExt';
}
}
// Extensions cache
if (!class_exists($class)) {
require $ownExt;
}
$sef_ext = new $class();
$extsCache[$class] = $sef_ext;
// Set currently handled URI
$sef_ext->setCurrentUri($uri);
// 17.2.2012, dajo: isHomePage should be tested before the beforeCreate() is called
// Grr Joomla SEF router adds home Itemid to Items without menu Item assigned
$homes = array_keys(SEFTools::getHomeQueries());
if (in_array($uri->getVar('Itemid'), $homes) && !JoomSEF::_isHomePage($uri)) {
$uri->setVar('Itemid', JRequest::getInt('Itemid'));
}
// Let the extension change the url and options
$sef_ext->beforeCreate($uri);
list($sid, $mosmsg) = self::_prepareUriForCreate($params, $uri);
// Get nonsef and ignore vars from extension
list($nonSefVars, $ignoreVars) = $sef_ext->getNonSefVars($uri);
// Create array of all the non sef vars
$nonSefVars = SEFTools::getNonSefVars($uri, $nonSefVars, $ignoreVars);
// Create a copy of JURI object
$uri2 = clone $uri;
// Remove nonsef variables from our JURI copy
$nonSefUrl = SEFTools::RemoveVariables($uri2, array_keys($nonSefVars));
// Check homepage
if (JoomSEF::_isHomePage($uri2, true)) {
$title = array();
$lng = $uri2->getVar('lang');
if ($sefConfig->langEnable && $sefConfig->langPlacementJoomla != _COM_SEF_LANG_DOMAIN && ($sefConfig->alwaysUseLangHomeJoomla || $lng != $sefConfig->mainLanguageJoomla)) {
$title[] = $lng;
}
$pagination = false;
if (method_exists($sef_ext, "_processPagination")) {
$title = array_merge($title, $sef_ext->_processPagination($uri2));
$pagination = true;
}
if ($uri2->getVar('format') == 'feed') {
$title[] = $uri2->getVar('type');
}
$data = JoomSEF::_sefGetLocation($uri2, $title, null, null, null, $uri->getVar('lang'), null, null, null, null, $pagination);
unset($data["lang"]);
// We need to copy data, otherwise we would return $uri2 object - not working in Joomla 3
JoomSefUri::copyUri(JoomSEF::_storeLocation($data), $uri);
// remove path as Joomla will add it back
$uri->setPath(preg_replace("@^" . $uri->base(true) . "@", "", $uri->getPath()));
// Set non-SEF variables
$uri->setQuery($nonSefUrl);
// Set domain
if ($sefConfig->langEnable && $sefConfig->langPlacementJoomla == _COM_SEF_LANG_DOMAIN) {
if (!empty($lng) && isset($sefConfig->subDomainsJoomla[$lng])) {
示例2: build
//.........这里部分代码省略.........
}
} else {
$class = 'SefExt';
}
}
$sef_ext = new $class();
// Set currently handled URI
$sef_ext->setCurrentUri($uri);
// Let the extension change the url and options
$origUri = clone $uri;
$sef_ext->beforeCreate($uri);
// Ensure that the session IDs are removed
// If set to
$sid = $uri->getVar('sid');
if (!$sefConfig->dontRemoveSid) {
$uri->delVar('sid');
}
// Ensure that the mosmsg are removed.
$mosmsg = $uri->getVar('mosmsg');
$uri->delVar('mosmsg');
// override Itemid if set to
$override = $params->get('itemid', '0');
$overrideId = $params->get('overrideId', '');
if ($override != '0' && $overrideId != '') {
$uri->setVar('Itemid', $overrideId);
}
// clean Itemid if desired
// David: only if overriding is disabled
if (isset($sefConfig->excludeSource) && $sefConfig->excludeSource && $override == '0') {
$Itemid = $uri->getVar('Itemid');
$uri->delVar('Itemid');
}
// Get nonsef and ignore vars from extension
list($nonSefVars, $ignoreVars) = $sef_ext->getNonSefVars($uri);
// Create array of all the non sef vars
$nonSefVars = SEFTools::getNonSefVars($uri, $nonSefVars, $ignoreVars);
// Create a copy of JURI object
$uri2 = clone $uri;
// Remove nonsef variables from our JURI copy
$nonSefUrl = SEFTools::RemoveVariables($uri2, array_keys($nonSefVars));
// Check homepage
if (JoomSEF::_isHomePage($uri2, true)) {
// Create homepage SEF URL without non-SEF variables
$title = array();
$data = JoomSEF::_sefGetLocation($uri2, $title, null, null, null, $uri->getVar('lang'));
$uri = JoomSEF::_storeLocation($data);
// Add non-SEF variables
$uri->setQuery($nonSefUrl);
JoomSEF::_endSef($prevLang);
return;
}
if (!SEFTools::JoomFishInstalled()) {
$titlepage = false;
$subdomain = SEFTools::getSubdomain($origUri, $titlepage);
if (strlen($subdomain)) {
$uri->setHost($subdomain . "." . JFactory::getURI()->getHost());
}
}
$url = JoomSEF::_uriToUrl($uri2);
// try to get url from cache
$sefUrl = false;
if ($sefConfig->useCache) {
$sefUrl = $cache->GetSefUrl($url);
}
if (!$sefConfig->useCache || !$sefUrl) {
// check if the url is already saved in the database