29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

Fixed issue [#20907] Making Joomla more compliant to PHP strict standard

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@17853 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Andrew Eddie 2010-06-23 17:41:14 +00:00
parent 83e10691c3
commit 7b4b736eb5
4 changed files with 44 additions and 30 deletions

View File

@ -265,7 +265,7 @@ final class JSite extends JApplication
*/
public function authorize($itemid)
{
$menus = JSite::getMenu();
$menus = $this->getMenu();
$user = JFactory::getUser();
if (!$menus->authorise($itemid))
@ -314,7 +314,7 @@ final class JSite extends JApplication
$params[$hash] = clone JComponentHelper::getParams($option);
// Get menu parameters
$menus = JSite::getMenu();
$menus = $this->getMenu();
$menu = $menus->getActive();
// Get language
@ -451,10 +451,13 @@ final class JSite extends JApplication
/**
* Return a reference to the JPathway object.
*
* @return object JPathway.
* @since 1.5
* @param string $name The name of the application/client.
* @param array $options An optional associative array of configuration settings.
*
* @return object JMenu.
* @since 1.5
*/
public function getMenu()
public function getMenu($name = null, $options = array())
{
$options = array();
$menu = parent::getMenu('site', $options);
@ -464,10 +467,13 @@ final class JSite extends JApplication
/**
* Return a reference to the JPathway object.
*
* @return object JPathway.
* @since 1.5
* @param string $name The name of the application.
* @param array $options An optional associative array of configuration settings.
*
* @return object JPathway.
* @since 1.5
*/
public function getPathWay()
public function getPathway($name = null, $options = array())
{
$options = array();
$pathway = parent::getPathway('site', $options);
@ -477,10 +483,13 @@ final class JSite extends JApplication
/**
* Return a reference to the JRouter object.
*
* @return JRouter.
* @param string $name The name of the application.
* @param array $options An optional associative array of configuration settings.
*
* @return JRouter
* @since 1.5
*/
static public function getRouter()
static public function getRouter($name = null, array $options = array())
{
$config = JFactory::getConfig();
$options['mode'] = $config->get('sef');

View File

@ -24,7 +24,7 @@ class JMenuSite extends JMenu
*/
public function load()
{
$cache = &JFactory::getCache('mod_menu', ''); // has to be mod_menu or this cache won't get cleaned
$cache = JFactory::getCache('mod_menu', ''); // has to be mod_menu or this cache won't get cleaned
if (!$data = $cache->get('menu_items'.JFactory::getLanguage()->getTag())) {
// Initialise variables.
$db = JFactory::getDbo();
@ -41,7 +41,7 @@ class JMenuSite extends JMenu
$query->where('m.parent_id > 0');
$query->order('m.lft');
$user =& JFactory::getUser();
$user = JFactory::getUser();
$groups = implode(',', $user->authorisedLevels());
$query->where('m.access IN (' . $groups . ')');

View File

@ -27,7 +27,8 @@ class JPathwaySite extends JPathway
//Initialise the array.
$this->_pathway = array();
$menu = &JSite::getMenu();
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($item = $menu->getActive())
{

View File

@ -31,7 +31,7 @@ class JRouterSite extends JRouter
$vars = array();
// Get the application
$app = &JFactory::getApplication();
$app = JFactory::getApplication();
if ($app->getCfg('force_ssl') == 2 && strtolower($uri->getScheme()) != 'https') {
//forward to https
@ -69,14 +69,14 @@ class JRouterSite extends JRouter
public function &build($url)
{
$uri = &parent::build($url);
$uri = parent::build($url);
// Get the path data
$route = $uri->getPath();
//Add the suffix to the uri
if ($this->_mode == JROUTER_MODE_SEF && $route) {
$app = &JFactory::getApplication();
$app = JFactory::getApplication();
if ($app->getCfg('sef_suffix') && !(substr($route, -9) == 'index.php' || substr($route, -1) == '/')) {
if ($format = $uri->getVar('format', 'html')) {
@ -99,8 +99,9 @@ class JRouterSite extends JRouter
protected function _parseRawRoute(&$uri)
{
$vars = array();
$menu = &JSite::getMenu(true);
$vars = array();
$app = JFactory::getApplication();
$menu = $app->getMenu(true);
//Handle an empty URL (special case)
if (!$uri->getVar('Itemid') && !$uri->getVar('option')) {
@ -144,10 +145,10 @@ class JRouterSite extends JRouter
protected function _parseSefRoute(&$uri)
{
$vars = array();
$menu = &JSite::getMenu(true);
$route = $uri->getPath();
$vars = array();
$app = JFactory::getApplication();
$menu = $app->getMenu(true);
$route = $uri->getPath();
// Get the variables from the uri
$vars = $uri->getQuery(true);
@ -241,7 +242,7 @@ class JRouterSite extends JRouter
}
} else {
//Set active menu item
if ($item = &$menu->getActive()) {
if ($item = $menu->getActive()) {
$vars = $item->query;
}
}
@ -265,7 +266,8 @@ class JRouterSite extends JRouter
return;
}
$menu = &JSite::getMenu();
$app = JFactory::getApplication();
$menu = $app->getMenu();
/*
* Build the component route
@ -338,7 +340,7 @@ class JRouterSite extends JRouter
// Process the pagination support
if ($this->_mode == JROUTER_MODE_SEF) {
$app = &JFactory::getApplication();
$app = JFactory::getApplication();
if ($start = $uri->getVar('start')) {
$uri->delVar('start');
@ -353,7 +355,8 @@ class JRouterSite extends JRouter
{
// Make sure any menu vars are used if no others are specified
if (($this->_mode != JROUTER_MODE_SEF) && $uri->getVar('Itemid') && count($uri->getQuery(true)) == 2) {
$menu = &JSite::getMenu();
$app = JFactory::getApplication();
$menu = $app->getMenu();
// Get the active menu item
$itemid = $uri->getVar('Itemid');
@ -372,7 +375,7 @@ class JRouterSite extends JRouter
$route = $uri->getPath();
if ($this->_mode == JROUTER_MODE_SEF && $route) {
$app = &JFactory::getApplication();
$app = JFactory::getApplication();
if ($limitstart = $uri->getVar('limitstart')) {
$uri->setVar('start', (int) $limitstart);
@ -383,13 +386,14 @@ class JRouterSite extends JRouter
$uri->setPath($route);
}
protected function &_createURI($url)
protected function _createURI($url)
{
//Create the URI
$uri = &parent::_createURI($url);
$uri = parent::_createURI($url);
// Set URI defaults
$menu = &JSite::getMenu();
$app = JFactory::getApplication();
$menu = $app->getMenu();
// Get the itemid form the URI
$itemid = $uri->getVar('Itemid');