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


PHP SEFTools::getExtParams方法代码示例

本文整理汇总了PHP中SEFTools::getExtParams方法的典型用法代码示例。如果您正苦于以下问题:PHP SEFTools::getExtParams方法的具体用法?PHP SEFTools::getExtParams怎么用?PHP SEFTools::getExtParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SEFTools的用法示例。


在下文中一共展示了SEFTools::getExtParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 function create(&$uri)
 {
     $vars = $uri->getQuery(true);
     extract($vars);
     $this->params =& SEFTools::getExtParams('com_search');
     $newUri = $uri;
     if (!(isset($task) ? @$task : null)) {
         $title[] = JoomSEF::_getMenuTitle($option, isset($task) ? $task : null);
         if (isset($searchword) && $this->params->get('nonsefphrase', '1') != '1') {
             $title[] = $searchword;
         }
         if (count($title) > 0) {
             $this->_createNonSefVars($uri);
             if (!isset($searchword) || $this->params->get('nonsefphrase', '1') != '1') {
                 // Generate meta tags
                 $desc = array();
                 if (isset($searchword)) {
                     $desc[] = $searchword;
                 }
                 if (isset($searchphrase)) {
                     $desc[] = $searchphrase;
                 }
                 $this->metadesc = implode(', ', $desc);
                 unset($desc);
             }
             $metatags = $this->getMetaTags();
             $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$vars['lang'], $this->nonSefVars, null, $metatags);
         }
     }
     return $newUri;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:31,代码来源:com_search.php

示例2: getSefUrlFromDatabase

 function getSefUrlFromDatabase(&$uri)
 {
     $db =& JFactory::getDBO();
     $sefConfig =& SEFConfig::getConfig();
     // David (284): ignore Itemid if set to
     $where = '';
     // Get the extension's ignoreSource parameter
     $option = $uri->getVar('option');
     if (!is_null($option)) {
         $params = SEFTools::getExtParams($option);
         $extIgnore = $params->get('ignoreSource', 2);
     } else {
         $extIgnore = 2;
     }
     $ignoreSource = $extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore;
     $Itemid = $uri->getVar('Itemid');
     // If Itemid is set as ignored for the component, set ignoreSource to 1
     if (!is_null($Itemid) && !is_null($option)) {
         if (SEFTools::isItemidIgnored($option, $Itemid)) {
             $ignoreSource = 1;
         }
     }
     if (!$ignoreSource && !is_null($Itemid)) {
         $where = " AND (`Itemid` = '" . $Itemid . "' OR `Itemid` IS NULL)";
     }
     $origurl = $db->Quote(html_entity_decode(urldecode(JoomSEF::_uriToUrl($uri, 'Itemid'))));
     $query = "SELECT * FROM `#__sefurls` WHERE `origurl` = {$origurl}" . $where . " AND (`trashed` = '0') LIMIT 2";
     $db->setQuery($query);
     $sefurls = $db->loadObjectList('Itemid');
     if (!$ignoreSource && !is_null($Itemid)) {
         if (isset($sefurls[$Itemid])) {
             $result = $sefurls[$Itemid];
         } else {
             if (isset($sefurls[''])) {
                 // We've found one of the ignored Itemids, update it with the current and return
                 $result = $sefurls[''];
                 $result->Itemid = $Itemid;
                 $query = "UPDATE `#__sefurls` SET `Itemid` = '{$Itemid}' WHERE `id` = '{$result->id}' LIMIT 1";
                 $db->setQuery($query);
                 $db->query();
             } else {
                 $result = reset($sefurls);
             }
         }
     } else {
         $result = reset($sefurls);
     }
     return is_object($result) ? $result : false;
     /*
     // removed - was causing problems
     $sefurls = $db->loadObjectList('Itemid');
     // test if current Itemid record exists, if YES, use it, if NO, use first found
     if (isset($sefurls[$Itemid])) $active = $sefurls[$Itemid]; 
     elseif ($ignoreSource) $active = reset($sefurls);
     //if (isset($active)) $result = $active->sefurl;
     
     return isset($active) ? $active : false;
     */
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:59,代码来源:sef.ext.php

示例3: getSefUrlFromDatabase

 function getSefUrlFromDatabase(&$uri)
 {
     $db =& JFactory::getDBO();
     $sefConfig =& SEFConfig::getConfig();
     // David (284): ignore Itemid if set to
     $where = '';
     // Get the extension's ignoreSource parameter
     $option = $uri->getVar('option');
     if (!is_null($option)) {
         $params = SEFTools::getExtParams($option);
         $extIgnore = $params->get('ignoreSource', 2);
     } else {
         $extIgnore = 2;
     }
     $ignoreSource = $extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore;
     $Itemid = $uri->getVar('Itemid');
     // If Itemid is set as ignored for the component, set ignoreSource to 1
     if (!is_null($Itemid) && !is_null($option)) {
         if (SEFTools::isItemidIgnored($option, $Itemid)) {
             $ignoreSource = 1;
         }
     }
     if (!$ignoreSource && !is_null($Itemid)) {
         $where = " AND (`Itemid` = '" . $Itemid . "' OR `Itemid` IS NULL)";
     }
     $origurl = addslashes(html_entity_decode(urldecode(JoomSEF::_uriToUrl($uri, 'Itemid'))));
     $query = "SELECT * FROM `#__sefurls` WHERE `origurl` = '" . $origurl . "'" . $where . ' LIMIT 2';
     $this->_db->setQuery($query);
     //echo "<b>".str_replace('#__','jos_',$query)."</b><br><br>";
     $sefurls = $this->_db->loadObjectList('Itemid');
     if (!is_array($sefurls)) {
         return false;
     }
     if (!$ignoreSource && !is_null($Itemid)) {
         if (isset($sefurls[$Itemid])) {
             $result = $sefurls[$Itemid];
         } else {
             if (isset($sefurls[''])) {
                 // We've found one of the ignored Itemids, update it with the current and return
                 $result = $sefurls[''];
                 $result->Itemid = $Itemid;
                 $query = "UPDATE `#__sefurls` SET `Itemid` = '{$Itemid}' WHERE `id` = '{$result->id}' LIMIT 1";
                 $this->_db->setQuery($query);
                 $this->_db->query();
             } else {
                 $result = reset($sefurls);
             }
         }
     } else {
         $result = reset($sefurls);
     }
     return is_object($result) ? $result : false;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:53,代码来源:sef.ext.php

示例4: create

 function create(&$uri)
 {
     $sefConfig =& SEFConfig::getConfig();
     $database =& JFactory::getDBO();
     $this->params =& SEFTools::getExtParams('com_weblinks');
     // JF translate extension.
     $jfTranslate = $sefConfig->translateNames ? ', `id`' : '';
     $vars = $uri->getQuery(true);
     extract($vars);
     $title = array();
     $title[] = JoomSEF::_getMenuTitle($option, @$this_task);
     if (@$view == 'category') {
         $title[] = $this->getCategoryTitle($id, SEFTools::UseAlias($this->params, 'category_alias'));
     } elseif (empty($this_task) && @$view == 'weblink') {
         if (isset($catid)) {
             if ($this->params->get('show_category', '1')) {
                 $title[] = $this->getCategoryTitle($catid, SEFTools::UseAlias($this->params, 'category_alias'));
             }
         }
         if (!empty($id)) {
             $field = 'title';
             if (SEFTools::UseAlias($this->params, 'weblink_alias')) {
                 $field = 'alias';
             }
             $id = intval($id);
             $database->setQuery("SELECT `{$field}` AS `title` {$jfTranslate} FROM `#__weblinks` WHERE `id` = '{$id}'");
             $row = $database->loadObject();
             if (is_null($row)) {
                 JoomSefLogger::Log("Weblink with ID {$id} could not be found.", $this, 'com_weblinks');
             } elseif (!empty($row->title)) {
                 $name = $row->title;
                 if ($this->params->get('weblink_id', '0')) {
                     $name = $id . '-' . $name;
                 }
                 $title[] = $name;
             }
         } else {
             $title[] = JText::_('Submit');
         }
     }
     if (isset($task) && $task == 'new') {
         $title[] = 'new' . $sefConfig->suffix;
     }
     $newUri = $uri;
     if (count($title) > 0) {
         // Generate meta tags
         $metatags = $this->getMetaTags();
         $priority = $this->getPriority($uri);
         $sitemap = $this->getSitemapParams($uri);
         $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$vars['lang'], null, null, $metatags, $priority, false, null, $sitemap);
     }
     return $newUri;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:53,代码来源:com_weblinks.php

示例5: create

 function create(&$uri)
 {
     $vars = $uri->getQuery(true);
     extract($vars);
     // Don't SEF opensearch links
     if (isset($format) && $format == 'opensearch') {
         return $uri;
     }
     $this->params =& SEFTools::getExtParams('com_search');
     $newUri = $uri;
     if (!(isset($task) ? @$task : null)) {
         $title[] = JoomSEF::_getMenuTitleLang($option, $lang, @$Itemid);
         if (isset($searchword) && $this->params->get('nonsefphrase', '1') != '1') {
             $title[] = $searchword;
         }
         if (isset($view) && ($view != 'search' || $this->params->get('add_search', '0') == '1')) {
             $title[] = $view;
         }
         if (isset($format)) {
             $title[] = $format;
         }
         $this->_createNonSefVars($uri);
         if (!isset($searchword) || $this->params->get('nonsefphrase', '1') != '1') {
             // Generate meta tags
             $desc = array();
             if (isset($searchword)) {
                 $desc[] = $searchword;
             }
             if (isset($searchphrase)) {
                 $desc[] = $searchphrase;
             }
             $this->metadesc = implode(', ', $desc);
             unset($desc);
         }
         $metatags = $this->getMetaTags();
         $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, $this->nonSefVars, null, $metatags, null, true);
     }
     return $newUri;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:39,代码来源:com_search.php

示例6: create

 function create(&$uri)
 {
     $sefConfig =& SEFConfig::getConfig();
     $this->params =& SEFTools::getExtParams('com_banners');
     $vars = $uri->getQuery(true);
     extract($vars);
     $title[] = JoomSEF::_getMenuTitleLang(@$option, @$task, @$Itemid);
     switch (@$task) {
         case 'click':
             $title[] = $this->GetBannerName($id);
             unset($task);
             break;
     }
     $newUri = $uri;
     if (isset($this->lang)) {
         $lang = $this->lang;
     }
     if (count($title) > 0) {
         $newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, null, null, @$lang);
     }
     return $newUri;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:22,代码来源:com_banners.php

示例7: create

 function create(&$uri)
 {
     // Extract variables
     $vars = $uri->getQuery(true);
     extract($vars);
     $title = array();
     $this->params = SEFTools::getExtParams('com_contact');
     $title[] = JoomSEF::_getMenuTitle(@$option, @$task, @$Itemid);
     if (isset($view)) {
         switch ($view) {
             case 'contact':
                 $title = array_merge($title, $this->getContactName($id));
                 unset($view);
                 break;
             case 'category':
                 if (isset($catid)) {
                     $title[] = $this->getCategoryTitle($catid);
                 }
                 unset($view);
                 break;
         }
     }
     if (!empty($format) && $format == 'feed') {
         if (!empty($type)) {
             $title[] = $type;
         }
     }
     $newUri = $uri;
     if (count($title) > 0) {
         // Generate meta tags
         $metatags = $this->getMetaTags();
         $priority = $this->getPriority($uri);
         $sitemap = $this->getSitemapParams($uri);
         $newUri = JoomSEF::_sefGetLocation($uri, $title, @$view, null, null, @$lang, null, null, $metatags, $priority, false, null, $sitemap);
     }
     return $newUri;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:37,代码来源:com_contact.php

示例8: _checkRow

 /**
  * Checks the found row
  *
  */
 function _checkRow(&$row, $ignoreSource, $Itemid, $url, &$metadata, $temploc, $priority, $option, $host, $sitemapParams)
 {
     $realloc = null;
     $db =& JFactory::getDBO();
     $sefConfig =& SEFConfig::getConfig();
     $numberDuplicates = $sefConfig->numberDuplicates;
     if (!empty($option)) {
         $params =& SEFTools::getExtParams($option);
         $extDuplicates = $params->get('numberDuplicates', '2');
         if ($extDuplicates != '2') {
             $numberDuplicates = $extDuplicates;
         }
     }
     if ($row != false && !is_null($row)) {
         if ($ignoreSource || !$ignoreSource && (empty($Itemid) || $row->Itemid == $Itemid)) {
             // ... check that it matches original URL
             if ($row->origurl == $url) {
                 // found the matching object
                 // it probably should have been found sooner
                 // but is checked again here just for CYA purposes
                 // and to end the loop
                 $realloc = $row->sefurl;
             } else {
                 if ($sefConfig->langPlacement == _COM_SEF_LANG_DOMAIN) {
                     // check if the urls differ only by lang variable
                     if (SEFTools::removeVariable($row->origurl, 'lang') == SEFTools::removeVariable($url, 'lang')) {
                         $db->setQuery("UPDATE `#__sefurls` SET `origurl` = " . $db->Quote(SEFTools::removeVariable($row->origurl, 'lang')) . " WHERE `id` = '{$row->id}' LIMIT 1");
                         // if error occured.
                         if (!$db->query()) {
                             $msg = JText::_('Could not update SEF URL in database');
                             if (JDEBUG) {
                                 $msg .= ': ' . $db->getErrorMsg();
                             }
                             JError::raiseError('JoomSEF Error', $msg);
                         }
                         $realloc = $row->sefurl;
                     }
                 }
             }
         }
         // The found URL is not the same
         if (!$numberDuplicates) {
             // But duplicates management is turned on
             // so we can save the same SEF URL for different non-SEF URL
             JoomSEF::_saveNewURL($Itemid, $metadata, $priority, $temploc, $url, false, $host, $sitemapParams);
             $realloc = $temploc;
         }
     } else {
         // Save URL in the database
         JoomSEF::_saveNewURL($Itemid, $metadata, $priority, $temploc, $url, true, $host, $sitemapParams);
         $realloc = $temploc;
     }
     return $realloc;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:58,代码来源:joomsef.php

示例9: _getPackageFromServer

 function _getPackageFromServer($extension)
 {
     // Make sure that zlib is loaded so that the package can be unpacked
     if (!extension_loaded('zlib')) {
         JError::raiseWarning(100, JText::_('WARNINSTALLZLIB'));
         return false;
     }
     // build the appropriate paths
     $sefConfig =& SEFConfig::getConfig();
     $config =& JFactory::getConfig();
     if (empty($extension)) {
         $tmp_dest = $config->getValue('config.tmp_path') . DS . 'joomsef.zip';
     } else {
         $tmp_dest = $config->getValue('config.tmp_path') . DS . $extension . '.zip';
     }
     // Validate the upgrade on server
     $data = array();
     $data['username'] = $sefConfig->artioUserName;
     $data['password'] = $sefConfig->artioPassword;
     if (empty($extension)) {
         $data['download_id'] = $sefConfig->artioDownloadId;
         $data['file'] = 'com_joomsef';
     } else {
         $params =& SEFTools::getExtParams($extension);
         $data['download_id'] = $params->get('downloadId', '');
         $data['file'] = 'ext_joomsef3_' . substr($extension, 4);
     }
     $uri = parse_url(JURI::root());
     $url = $uri['host'] . $uri['path'];
     $url = trim($url, '/');
     $data['site'] = $url;
     $data['ip'] = $_SERVER['SERVER_ADDR'];
     $lang =& JFactory::getLanguage();
     $data['lang'] = $lang->getTag();
     $data['cat'] = 'joomsef3';
     // Get the server response
     $response = SEFTools::PostRequest($sefConfig->serverAutoUpgrade, JURI::root(), $data);
     // Check the response
     if ($response === false || $response->code != 200) {
         JError::raiseWarning(100, JText::_('Connection to server could not be established.'));
         return false;
     }
     // Response OK, check what we got
     if (strpos($response->header, 'Content-Type: application/zip') === false) {
         JError::raiseWarning(100, $response->content);
         return false;
     }
     // Seems we got the ZIP installation package, let's save it to disk
     if (!JFile::write($tmp_dest, $response->content)) {
         JError::raiseWarning(100, JText::_('Unable to save installation file in temp directory.'));
         return false;
     }
     // Unpack the downloaded package file
     $package = JInstallerHelper::unpack($tmp_dest);
     // Delete the package file
     JFile::delete($tmp_dest);
     return $package;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:58,代码来源:upgrade.php

示例10: isItemidIgnored

 /**
  * Checks, whether the given Itemid is ignored for the given component
  *
  * @param string $option
  * @param string $Itemid
  * @return bool
  */
 function isItemidIgnored($option, $Itemid)
 {
     $params =& SEFTools::getExtParams($option);
     $ignoredIds = trim($params->get('ignoreItemids', ''));
     if (empty($ignoredIds)) {
         return false;
     }
     $ids = array_map('trim', explode(',', $ignoredIds));
     if (in_array($Itemid, $ids)) {
         return true;
     }
     return false;
 }
开发者ID:01J,项目名称:bealtine,代码行数:20,代码来源:seftools.php

示例11: _getActiveHandler

 function _getActiveHandler($option)
 {
     $params =& SEFTools::getExtParams($option);
     $handler = $params->get('handling', '0');
     $ret = new stdClass();
     switch ($handler) {
         case '0':
             $compExt = JFile::exists(JPATH_ROOT . '/components/' . $option . '/router.php');
             $ownExt = JFile::exists(JPATH_ROOT . '/components/com_sef/sef_ext/' . $option . '.php');
             if ($compExt && !$ownExt) {
                 $ret->text = JText::_('COM_SEF_COMPONENTS_ROUTER');
                 $ret->code = _COM_SEF_HANDLER_ROUTER;
                 $ret->color = 'black';
             } else {
                 if ($ownExt) {
                     $ret->text = JText::_('COM_SEF_JOOMSEF_EXTENSION');
                     $ret->code = _COM_SEF_HANDLER_EXTENSION;
                     $ret->color = 'green';
                 } else {
                     $ret->text = JText::_('COM_SEF_JOOMSEF_DEFAULT_HANDLER');
                     $ret->code = _COM_SEF_HANDLER_DEFAULT;
                     $ret->color = 'green';
                 }
             }
             break;
         case '1':
             $ret->text = JText::_('COM_SEF_DEFAULT_JOOMLA_ROUTER');
             $ret->code = _COM_SEF_HANDLER_JOOMLA;
             $ret->color = 'orange';
             break;
         case '2':
             $ret->text = JText::_('COM_SEF_NOT_USING_SEF');
             $ret->code = _COM_SEF_HANDLER_NONE;
             $ret->color = 'red';
             break;
         case '3':
             $ret->text = JText::_('COM_SEF_JOOMSEF_BASIC_REWRITING');
             $ret->code = _COM_SEF_HANDLER_BASIC;
             $ret->color = 'green';
             break;
     }
     return $ret;
 }
开发者ID:01J,项目名称:bealtine,代码行数:43,代码来源:extensions.php

示例12: create

 function create(&$uri)
 {
     $this->metadesc = null;
     // Extract variables
     $vars = $uri->getQuery(true);
     extract($vars);
     $this->params = SEFTools::getExtParams('com_contact');
     $title[] = JoomSEF::_getMenuTitleLang(@$option, $this->lang, @$Itemid);
     if (isset($view)) {
         switch ($view) {
             case 'categories':
             case 'featured':
                 break;
             case 'category':
                 $catInfo = $this->getCategoryInfo($id);
                 if ($catInfo === false) {
                     JoomSefLogger::Log("Category with ID {$id} could not be found.", $this, 'com_contact');
                 }
                 if (is_array($catInfo->path)) {
                     $title = array_merge($title, $catInfo->path);
                 }
                 break;
             case 'contact':
                 $title = array_merge($title, $this->getContactName($id));
                 break;
         }
     }
     if (!empty($format)) {
         if ($format == 'feed' && !empty($type)) {
             $title[] = $type;
         } elseif ($format == 'vcf') {
             $title[] = 'vCard';
         }
     }
     $newUri = $uri;
     if (count($title) > 0) {
         // Generate meta tags
         $this->metatags = $this->getMetaTags();
         $priority = $this->getPriority($uri);
         $sitemap = $this->getSitemapParams($uri);
         if (isset($this->lang)) {
             $lang = $this->lang;
         }
         $newUri = JoomSEF::_sefGetLocation($uri, $title, null, null, null, @$lang, null, null, $this->metatags, $priority, false, null, $sitemap);
     }
     return $newUri;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:47,代码来源:com_contact.php

示例13: _getPackageFromServer

 function _getPackageFromServer()
 {
     $extension = trim(JRequest::getString('extension'));
     // Make sure we have an extension selected
     if (empty($extension)) {
         JError::raiseWarning(100, JText::_('COM_SEF_NO_EXTENSION_SELECTED'));
         return false;
     }
     // Make sure that zlib is loaded so that the package can be unpacked
     if (!extension_loaded('zlib')) {
         JError::raiseWarning(100, JText::_('COM_SEF_WARNINSTALLZLIB'));
         return false;
     }
     // build the appropriate paths
     $sefConfig =& SEFConfig::getConfig();
     $config =& JFactory::getConfig();
     $tmp_dest = $config->get('tmp_path') . '/' . $extension . '.zip';
     // Validate the upgrade on server
     $data = array();
     $data['username'] = $sefConfig->artioUserName;
     $data['password'] = $sefConfig->artioPassword;
     $params =& SEFTools::getExtParams($extension);
     $data['download_id'] = $params->get('downloadId', '');
     $data['file'] = 'ext_joomsef4_' . substr($extension, 4);
     $uri = parse_url(JURI::root());
     $url = $uri['host'] . $uri['path'];
     $url = trim($url, '/');
     $data['site'] = $url;
     $data['ip'] = $_SERVER['SERVER_ADDR'];
     $lang =& JFactory::getLanguage();
     $data['lang'] = $lang->getTag();
     $data['cat'] = 'joomsef4';
     // Get the server response
     $response = SEFTools::PostRequest($sefConfig->serverAutoUpgrade, JURI::root(), $data);
     // Check the response
     if ($response === false || $response->code != 200) {
         JError::raiseWarning(100, JText::_('COM_SEF_ERROR_SERVER_CONNECTION'));
         return false;
     }
     // Response OK, check what we got
     if (strpos($response->header, 'Content-Type: application/zip') === false) {
         JError::raiseWarning(100, $response->content);
         return false;
     }
     // Seems we got the ZIP installation package, let's save it to disk
     if (!JFile::write($tmp_dest, $response->content)) {
         JError::raiseWarning(100, JText::_('COM_SEF_ERROR_TEMP_DIRECTORY'));
         return false;
     }
     // Unpack the downloaded package file
     $package = JInstallerHelper::unpack($tmp_dest);
     // Delete the package file
     JFile::delete($tmp_dest);
     return $package;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:55,代码来源:extension.php

示例14: _getActiveHandler

 function _getActiveHandler($option)
 {
     $params =& SEFTools::getExtParams($option);
     $handler = $params->get('handling', '0');
     $ret = new stdClass();
     switch ($handler) {
         case '0':
             $compExt = JFile::exists(JPATH_ROOT . DS . 'components' . DS . $option . DS . 'router.php');
             $ownExt = JFile::exists(JPATH_ROOT . DS . 'components' . DS . 'com_sef' . DS . 'sef_ext' . DS . $option . '.php');
             if ($compExt && !$ownExt) {
                 $ret->text = JText::_('Component\'s router');
                 $ret->code = _COM_SEF_HANDLER_ROUTER;
                 $ret->color = 'black';
             } else {
                 if ($ownExt) {
                     $ret->text = JText::_('JoomSEF extension');
                     $ret->code = _COM_SEF_HANDLER_EXTENSION;
                     $ret->color = 'green';
                 } else {
                     $ret->text = JText::_('JoomSEF default handler');
                     $ret->code = _COM_SEF_HANDLER_DEFAULT;
                     $ret->color = 'green';
                 }
             }
             break;
         case '1':
             $ret->text = JText::_('Default Joomla! router');
             $ret->code = _COM_SEF_HANDLER_JOOMLA;
             $ret->color = 'orange';
             break;
         case '2':
             $ret->text = JText::_('Not using SEF');
             $ret->code = _COM_SEF_HANDLER_NONE;
             $ret->color = 'red';
             break;
         case '3':
             $ret->text = JText::_('JoomSEF basic rewriting');
             $ret->code = _COM_SEF_HANDLER_BASIC;
             $ret->color = 'green';
             break;
     }
     return $ret;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:43,代码来源:extensions.php

示例15: getSefUrl

 /**
  * Tries to find a SEF URL corresponding with given nonSEF URL
  *
  * @param string $nonsef
  * @param string $Itemid
  * @return string
  */
 function getSefUrl($nonsef, $Itemid = null)
 {
     $sefConfig =& SEFConfig::getConfig();
     // Load the cache if needed
     if (!$this->cacheLoaded) {
         $this->LoadCache();
     }
     // Check if the cache was loaded successfully
     if (!$this->cacheLoaded) {
         return false;
     }
     // Check if non-sef url doesn't contain Itemid
     $vars = array();
     parse_str(str_replace('index.php?', '', $nonsef), $vars);
     if (is_null($Itemid) && strpos($nonsef, 'Itemid=')) {
         if (isset($vars['Itemid'])) {
             $Itemid = $vars['Itemid'];
         }
         $nonsef = SEFTools::removeVariable($nonsef, 'Itemid');
     }
     // Get the ignoreSource parameter
     if (isset($vars['option'])) {
         $params = SEFTools::getExtParams($vars['option']);
         $extIgnore = $params->get('ignoreSource', 2);
     } else {
         $extIgnore = 2;
     }
     $ignoreSource = $extIgnore == 2 ? $sefConfig->ignoreSource : $extIgnore;
     // If Itemid is set as ignored for the component, set ignoreSource to 1
     if (!is_null($Itemid) && isset($vars['option'])) {
         if (SEFTools::isItemidIgnored($vars['option'], $Itemid)) {
             $ignoreSource = 1;
         }
     }
     // Get all sef urls matching non-sef url
     if (isset($this->cache[$nonsef]) && is_array($this->cache[$nonsef]) && count($this->cache[$nonsef]) > 0) {
         // Search with Itemid if set to and Itemid set
         if (!$ignoreSource && !is_null($Itemid)) {
             $nullId = null;
             for ($i = 0, $n = count($this->cache[$nonsef]); $i < $n; $i++) {
                 $row = $this->cache[$nonsef][$i];
                 if (isset($row->Itemid) && $row->Itemid == $Itemid) {
                     return $row;
                 }
                 if (empty($row->Itemid)) {
                     $nullId = $i;
                 }
             }
             // Not found with correct itemid, try to find without itemid
             if (!is_null($nullId)) {
                 // Update Itemid in cache
                 $this->cache[$nonsef][$i]->Itemid = $Itemid;
                 $row = $this->cache[$nonsef][$i];
                 // Save the cache
                 $this->saveCache();
                 // Return found row
                 return $row;
             }
         } else {
             return $this->cache[$nonsef][0];
         }
     }
     // URL does not exist in the cache
     return false;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:72,代码来源:sef.cache.php


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