[TYPO3-core] RFC: bug #1796

Wolfgang Klinger wolfgang at stufenlos.net
Sun Feb 26 17:08:46 CET 2006


 *hiya!*

 Type: bugfix

 HMENU with includeNotInMenu does not work with the nav_hide page
 property, the attached patch fixes that
 BT reference: http://bugs.typo3.org/view.php?id=1796


 bye
 Wolfgang

-------------- next part --------------
--- TYPO3core/typo3/sysext/cms/tslib/class.tslib_menu.php	2006-02-26 11:23:45.000000000 +0100
+++ TYPO3core_testing/typo3/sysext/cms/tslib/class.tslib_menu.php	2006-02-26 16:59:38.000000000 +0100
@@ -506,7 +506,7 @@
 							break;
 						}
 							// Get
-						$extraWhere = ' AND pages.nav_hide=0'.$this->getDoktypeExcludeWhere();
+						$extraWhere = (!$this->conf['includeNotInMenu'] ? ' AND pages.nav_hide=0' : '').$this->getDoktypeExcludeWhere();
 
 						if ($this->conf['special.']['excludeNoSearchPages']) {
 							$extraWhere.= ' AND pages.no_search=0';
@@ -564,7 +564,7 @@
 							$depth=20;
 						}
 						$limit = t3lib_div::intInRange($this->conf['special.']['limit'],0,100);	// max number of items
-						$extraWhere = ' AND pages.uid!='.$value.' AND pages.nav_hide=0'.$this->getDoktypeExcludeWhere();
+						$extraWhere = ' AND pages.uid!='.$value.(!$this->conf['includeNotInMenu'] ? ' AND pages.nav_hide=0' : '').$this->getDoktypeExcludeWhere();
 						if ($this->conf['special.']['excludeNoSearchPages']) {
 							$extraWhere.= ' AND pages.no_search=0';
 						}
@@ -879,7 +879,7 @@
 		$uid = $data['uid'];
 		if ($this->mconf['SPC'] || !$spacer)	{	// If the spacer-function is not enabled, spacers will not enter the $menuArr
 			if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']))	{		// Page may not be 'not_in_menu' or 'Backend User Section'
-				if (!$data['nav_hide'])	{	// Not hidden in navigation
+				if (!$data['nav_hide'] || $this->conf['includeNotInMenu'])	{	// Not hidden in navigation
 					if (!t3lib_div::inArray($banUidArray,$uid))	{	// not in banned uid's
 
 							// Checks if the default language version can be shown:
@@ -1336,7 +1336,7 @@
 
 		$recs = $this->sys_page->getMenu($uid,'uid,pid,doktype,mount_pid,mount_pid_ol,nav_hide');
 		foreach($recs as $theRec)	{
-			if (!t3lib_div::inList($this->doktypeExcludeList,$theRec['doktype']) && !$theRec['nav_hide'])	{	// If a menu item seems to be another type than 'Not in menu', then return true (there were items!)
+			if (!t3lib_div::inList($this->doktypeExcludeList,$theRec['doktype']) && (!$theRec['nav_hide'] || $this->conf['includeNotInMenu']))	{	// If a menu item seems to be another type than 'Not in menu', then return true (there were items!)
 				return TRUE;
 			}
 		}
@@ -2728,7 +2728,7 @@
 		foreach($menuItems as $uid => $data)	{
 			$spacer = (t3lib_div::inList($this->spacerIDList,$data['doktype'])?1:0);		// if item is a spacer, $spacer is set
 			if ($this->mconf['SPC'] || !$spacer)	{	// If the spacer-function is not enabled, spacers will not enter the $menuArr
-				if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']) && !$data['nav_hide'] && !t3lib_div::inArray($banUidArray,$uid))	{		// Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
+				if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']) && (!$data['nav_hide'] || $this->conf['includeNotInMenu']) && !t3lib_div::inArray($banUidArray,$uid))	{		// Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
 					if ($count<$levels)	{
 						$addLines = $this->generate_level($levels,$count+1,$data['uid'],'',$MP_array);
 					} else {


More information about the TYPO3-team-core mailing list