Permalink
Browse files

Fixed bug in current menu selection

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@3877 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
  • Loading branch information...
1 parent 8fae599 commit e17ee3e6492cf4dd75d28aec87f19cc50aad8f27 @eddieajau eddieajau committed Jun 5, 2006
Showing with 7 additions and 1 deletion.
  1. +1 −0 index.php
  2. +6 −1 libraries/joomla/application/menu.php
View
@@ -54,6 +54,7 @@
$Itemid = JRequest::getVar( 'Itemid', 0, '', 'int' );
if ($option == '' || $option == 'login' || $option == 'logout')
{
+ // TODO: See JMenu::__construct - I think this can be ditched!
$query = "SELECT id, link"
. "\n FROM #__menu"
// . "\n WHERE menutype = 'mainmenu'" ?? huh?
@@ -54,13 +54,18 @@ function __construct($name = 'all')
{
$this->_menuitems = $this->_load();
+ $home = 0;
foreach ($this->_menuitems as $item) {
if ($item->menutype == $name || $name == 'all') {
$this->_thismenu[] = $item;
+ if ($item->home)
+ {
+ $home = $item->id;
+ }
}
}
- $this->_current_id = JRequest::getVar( $this->_current_uri_var, 0, '', 'int' );
+ $this->_current_id = JRequest::getVar( $this->_current_uri_var, $home, '', 'int' );
}
/**

0 comments on commit e17ee3e

Please sign in to comment.