本文整理汇总了PHP中SEFTools::GetSEFGlobalMeta方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::GetSEFGlobalMeta方法的具体用法?PHP SEFTools::GetSEFGlobalMeta怎么用?PHP SEFTools::GetSEFGlobalMeta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SEFTools
的用法示例。
在下文中一共展示了SEFTools::GetSEFGlobalMeta方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
function parse(&$siteRouter, &$uri)
{
// Call this function only once in the stack, so
// we can use Joomla default router to parse
if ($this->parsing) {
return array();
}
$this->parsing = true;
$mainframe =& JFactory::getApplication();
JoomSEF::set('sef.global.meta', SEFTools::GetSEFGlobalMeta());
// Restore global "Add suffix to URLs"
$sefSuffix = JoomSEF::get('sef.global.orig_sef_suffix');
$config = JFactory::getConfig();
$config->set('sef_suffix', $sefSuffix);
$vars = array();
$vars = JoomSEF::parse($uri);
$menu = $mainframe->getMenu('site');
// Parsing done
$this->parsing = false;
// Fix the start variable
$start = $uri->getVar('start');
if (!is_null($start) && is_null($uri->getVar('limitstart'))) {
$uri->delVar('start');
$vars['limitstart'] = $start;
}
//Handle an empty URL (special case)
if (empty($vars['Itemid']) && empty($vars['option'])) {
//$item = $menu->getDefault();
// Workaround until Joomla menu bug will be fixed
$items = $menu->getItems(array('home', 'language'), array('1', '*'));
$item = $items[0];
if (!is_object($item)) {
return $vars;
}
// No default item set
// set the information in the request
$vars = $item->query;
// get the itemid
$vars['Itemid'] = $item->id;
// set the active menu item
$menu->setActive($vars['Itemid']);
// set vars
$this->setRequestVars($vars);
$this->fixDocument($vars);
return $vars;
}
// Get the item id, if it hasn't been set force it to null
if (empty($vars['Itemid'])) {
$vars['Itemid'] = JRequest::getInt('Itemid', null);
}
// Set vars
$this->setVars($vars);
$siteRouter->setVars($vars);
// Make sure the Joomla router doesn't process URL any further
$siteRouter->setMode(JROUTER_MODE_DONT_PARSE);
// No option? Get the full information from the itemid
if (empty($vars['option'])) {
$item = $menu->getItem($this->getVar('Itemid'));
if (!is_object($item)) {
return $vars;
}
// No default item set
$vars = $vars + $item->query;
}
// Set the active menu item
$menu->setActive($this->getVar('Itemid'));
// Set base href
//$this->setBaseHref($vars);
// Set vars
$this->setRequestVars($vars);
$this->fixDocument($vars);
return $vars;
}
示例2: getIsPaidVersion
function getIsPaidVersion()
{
if (!isset($this->_isPaidVersion)) {
$check = SEFTools::GetSEFGlobalMeta();
$ctrl = md5(implode(file(JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_sef' . DS . 'sef.xml')));
$this->_isPaidVersion = $check == $ctrl;
}
return $this->_isPaidVersion;
}
示例3: parse
function parse(&$uri)
{
$mainframe =& JFactory::getApplication();
$sefConfig =& SEFConfig::getConfig();
JoomSEF::set('sef.global.meta', SEFTools::GetSEFGlobalMeta());
// Try to fix the missing question mark if set to
if ($sefConfig->fixQuestionMark && count($_POST) == 0) {
$url = $uri->toString();
$newUrl = preg_replace('/^([^?&]*)&([^?]+=[^?]*)$/', '$1?$2', $url);
if ($newUrl != $url) {
// Redirect
$mainframe->redirect($newUrl, '', 'message', true);
}
}
$vars = array();
$vars = JoomSEF::parse($uri);
$menu =& JSite::getMenu(true);
//Handle an empty URL (special case)
if (empty($vars['Itemid']) && empty($vars['option'])) {
$item = $menu->getDefault();
if (!is_object($item)) {
return $vars;
}
// No default item set
// set the information in the request
$vars = $item->query;
// get the itemid
$vars['Itemid'] = $item->id;
// set the active menu item
$menu->setActive($vars['Itemid']);
// set vars
$this->setRequestVars($vars);
$this->fixDocument($vars);
return $vars;
}
// Get the item id, if it hasn't been set force it to null
if (empty($vars['Itemid'])) {
$vars['Itemid'] = JRequest::getInt('Itemid', null);
}
// Get the variables from the uri
$this->setVars($vars);
// No option? Get the full information from the itemid
if (empty($vars['option'])) {
$item = $menu->getItem($this->getVar('Itemid'));
if (!is_object($item)) {
return $vars;
}
// No default item set
$vars = $vars + $item->query;
}
// Set the active menu item
$menu->setActive($this->getVar('Itemid'));
// Set base href
//$this->setBaseHref($vars);
// Set vars
$this->setRequestVars($vars);
$this->fixDocument($vars);
return $vars;
}