本文整理汇总了PHP中SEFTools::getExtAcceptVars方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::getExtAcceptVars方法的具体用法?PHP SEFTools::getExtAcceptVars怎么用?PHP SEFTools::getExtAcceptVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SEFTools
的用法示例。
在下文中一共展示了SEFTools::getExtAcceptVars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// Get data from the model
$extension =& $this->get('extension');
$this->assignRef('extension', $extension);
$this->langs = $this->get('languages');
$this->strings = $this->get('strings');
$this->translation = $this->get('translation');
$this->subdomains = $this->get('subdomains');
$this->menus = $this->get('menus');
$filters =& SEFTools::getExtFilters($extension->option, false);
$this->assignRef('filters', $filters);
$acceptVars =& SEFTools::getExtAcceptVars($extension->option, false);
sort($acceptVars, SORT_STRING);
$this->assignRef('acceptVars', $acceptVars);
// Root domain for subdomains configuration
$rootDomain = JFactory::getURI()->getHost();
if (substr($rootDomain, 0, 4) == 'www.') {
$rootDomain = substr($rootDomain, 4);
}
$this->assign('rootDomain', $rootDomain);
JToolBarHelper::title(JText::_('SEF Extension') . ' <small>' . JText::_('Edit') . ' [ ' . (strlen($extension->name) ? $extension->name : $extension->component->name) . ' ]</small>', 'plugin.png');
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::spacer();
JToolBarHelper::cancel();
JHTML::_('behavior.tooltip');
$redir = JRequest::getVar('redirto', '');
$this->assignRef('redirto', $redir);
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
// Get data from the model
$extension =& $this->get('extension');
$this->assignRef('extension', $extension);
$filters =& SEFTools::getExtFilters($extension->option, false);
$this->assignRef('filters', $filters);
$acceptVars =& SEFTools::getExtAcceptVars($extension->option, false);
sort($acceptVars, SORT_STRING);
$this->assignRef('acceptVars', $acceptVars);
JToolBarHelper::title(JText::_('SEF Extension') . ' <small>' . JText::_('Edit') . ' [ ' . $extension->name . ' ]</small>', 'plugin.png');
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::spacer();
JToolBarHelper::cancel();
JHTML::_('behavior.tooltip');
$redir = JRequest::getVar('redirto', '');
$this->assignRef('redirto', $redir);
// Sliding pane
$pane =& JPane::getInstance('tabs');
$this->assignRef('pane', $pane);
parent::display($tpl);
}
示例3: _storeLocation
//.........这里部分代码省略.........
$gNonSef = JoomSEF::get('sef.global.nonsefvars');
if (!empty($gNonSef)) {
foreach (array_keys($gNonSef) as $key) {
if (in_array($key, array_keys($nonSefVars))) {
unset($gNonSef[$key]);
}
}
JoomSEF::set('sef.global.nonsefvars', $gNonSef);
}
}
// if there are global variables to exclude, add them to ignoreSefVars array
$gNonSef = JoomSEF::get('sef.global.nonsefvars');
if (!empty($gNonSef)) {
if (!empty($ignoreSefVars)) {
$ignoreSefVars = array_merge($gNonSef, $ignoreSefVars);
} else {
$ignoreSefVars = $gNonSef;
}
}
// ignoreSefVars - variables to exclude allways
if (isset($ignoreSefVars)) {
$vars = array_keys($ignoreSefVars);
$q = SEFTools::RemoveVariables($uri, $vars);
if ($q != '') {
if ($nonSefUrl == '') {
$nonSefUrl = '?' . $q;
} else {
$nonSefUrl .= '&' . $q;
}
}
}
// If the component requests strict accept variables filtering, remove the ones that don't match
if (isset($params) && $params->get('acceptStrict', '0') == '1') {
$acceptVars =& SEFTools::getExtAcceptVars($uri->getVar('option'));
$uriVars = $uri->getQuery(true);
if (count($acceptVars) > 0 && count($uriVars) > 0) {
foreach ($uriVars as $name => $value) {
// Standard Joomla variables
if (in_array($name, $sefConfig->globalAcceptVars)) {
continue;
}
// Accepted variables
if (in_array($name, $acceptVars)) {
continue;
}
// Variable not accepted, add it to non-SEF part of the URL
$value = urlencode($value);
if (strlen($nonSefUrl) > 0) {
$nonSefUrl .= '&' . $name . '=' . $value;
} else {
$nonSefUrl = '?' . $name . '=' . $value;
}
$uri->delVar($name);
}
}
}
// always remove Itemid and store it in a separate column
if (!is_null($uri->getVar('Itemid'))) {
$Itemid = $uri->getVar('Itemid');
$uri->delVar('Itemid');
}
// check for non-sef url first and avoid repeative lookups
// we only want to look for title variations when adding new
// this should also help eliminate duplicates.
// David (284): ignore Itemid if set to
if (isset($params)) {
示例4: getNonSefVars
function getNonSefVars(&$uri, $nonSefVars, $ignoreVars)
{
$mainframe = JFactory::getApplication();
$sefConfig = SEFConfig::getConfig();
// Get the parameters for this component
if (!is_null($uri->getVar('option'))) {
$params =& SEFTools::getExtParams($uri->getVar('option'));
}
// Build array of nonSef vars if set to
$nonSef = array();
if ($sefConfig->appendNonSef) {
// Save the given nonsef vars
$nonSef = $nonSefVars;
// load the nonSEF vars from option parameters
$paramNonSef = array();
if (isset($params)) {
$nsef = $params->get('customNonSef', '');
if (!empty($nsef)) {
// Some variables are set, let's explode them
$paramNonSef = explode(';', $nsef);
}
}
// get globally configured nonSEF vars
$configNonSef = array();
if (!empty($sefConfig->customNonSef)) {
$configNonSef = explode(';', $sefConfig->customNonSef);
}
// Get nonSEF vars from variable filter test if set to
$failedVars = array();
// combine all the nonSEF vars arrays
$nsefvars = array_merge($paramNonSef, $configNonSef, $failedVars);
if (!empty($nsefvars)) {
foreach ($nsefvars as $nsefvar) {
// add each variable, that isn't already set, and that is present in our URL
if (!isset($nonSef[$nsefvar]) && !is_null($uri->getVar($nsefvar))) {
$nonSef[$nsefvar] = $uri->getVar($nsefvar);
}
}
}
// if $nonSefVars mixes with $GLOBALS['JOOMSEF_NONSEFVARS'], exclude the mixed vars
// this is important to prevent duplicating params by adding JOOMSEF_NONSEFVARS to
// $ignoreSefVars
$gNonSef = JoomSEF::get('sef.global.nonsefvars');
if (!empty($gNonSef)) {
foreach (array_keys($gNonSef) as $key) {
if (isset($nonSef[$key])) {
unset($gNonSef[$key]);
}
}
JoomSEF::set('sef.global.nonsefvars', $gNonSef);
}
}
// Combine nonSef and ignore vars
if (!empty($ignoreVars)) {
$nonSef = array_merge($nonSef, $ignoreVars);
}
// Globally add the Smart Search's highlight variable
if (!is_null($uri->getVar('highlight'))) {
$nonSef['highlight'] = $uri->getVar('highlight');
}
// If the component requests strict accept variables filtering, add the ones that don't match
if (isset($params) && $params->get('acceptStrict', '0') == '1') {
$acceptVars =& SEFTools::getExtAcceptVars($uri->getVar('option'));
$uriVars = $uri->getQuery(true);
if (count($acceptVars) > 0 && count($uriVars) > 0) {
foreach ($uriVars as $name => $value) {
// Standard Joomla variables
if (in_array($name, array('option', 'Itemid', 'limit', 'limitstart', 'format', 'tmpl', 'lang'))) {
continue;
}
// Accepted variables
if (in_array($name, $acceptVars)) {
continue;
}
// Variable not accepted, add it to non-SEF
$nonSef[$name] = $value;
}
}
}
return $nonSef;
}