Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 970)
+++ trunk/CHANGELOG	(revision 971)
@@ -12,6 +12,7 @@
 
 ------------------------------------- 2.8.0 -------------------------------------
 20-Apr-2009 Matthias Gallas
+!	Update show_menu2 to version 4.8 (ticket #712)
 #	Fixed small error in Spain language file (ticket #711)
 18-Apr-2009 Matthias Gallas
 !	Updated Dutch language file (Thanks to Luckyluke)
Index: trunk/wb/modules/show_menu2/info.php
===================================================================
--- trunk/wb/modules/show_menu2/info.php	(revision 970)
+++ trunk/wb/modules/show_menu2/info.php	(revision 971)
@@ -39,7 +39,7 @@
 $module_directory = 'show_menu2';
 $module_name = 'show_menu2';
 $module_function = 'snippet';
-$module_version = '4.7';
+$module_version = '4.8';
 $module_platform = '2.6.x | 2.7.x';
 $module_author = 'Brodie Thiesfield';
 $module_license = 'GNU General Public License';
Index: trunk/wb/modules/show_menu2/README.de.txt
===================================================================
--- trunk/wb/modules/show_menu2/README.de.txt	(revision 970)
+++ trunk/wb/modules/show_menu2/README.de.txt	(revision 971)
@@ -1,4 +1,4 @@
-﻿show_menu2, version 4.7
+﻿show_menu2, version 4.8
 =======================
 Ist ein Code-Snippet für das CMS Website Baker. Es stellt einen kompletten 
 Ersatz für die eingebaute Menüfuntionalität zur Verfügung. Alle, für die 
@@ -118,7 +118,39 @@
     $aOptions Parameter zu übergeben sind.    
 
 
+Q:  How do I use a different class/picture/color/widget for each entry in a menu?
+A:  Use the [page_id] format string in the $aItemOpen string. Create a unique 
+    class or id for each menu item, then reference that item in your CSS or Javascript
+    to do whatever you want.
     
+    To add a unique class for each menu item (or similar):
+    
+        "<li><a href="[url]" target="[target]" class="[class] p[page_id]">[menu_title]</a>"
+
+        ... creating menu items like ...
+    
+        <li><a href="/pages/foo/bar.php" target="_top" class="menu-top p45">Top Menu</a>
+
+        Reference this in your CSS like:
+        
+        a.p45 { color: red; }
+    
+    To add a unique ID for each menu item (or similar):
+    
+        "<li><a id="p[page_id]" href="[url]" target="[target]" class="[class]">[menu_title]</a>"
+    
+        ... creating menu items like ...
+    
+        <li><a id="p45" href="/pages/foo/bar.php" target="_top" class="menu-top">Top Menu</a>
+
+        Reference this in your CSS like:
+        
+        a#p45 { color: red; }
+        
+        Note that the ID can only be used if that menu is generated and displayed one time
+        only on the page (because HTML ID's must be unique within a page). 
+    
+    
 FUNKTION
 ========
 
Index: trunk/wb/modules/show_menu2/include.php
===================================================================
--- trunk/wb/modules/show_menu2/include.php	(revision 970)
+++ trunk/wb/modules/show_menu2/include.php	(revision 971)
@@ -22,7 +22,7 @@
     02110-1301, USA.
 
     ***********************************************
-    ** Version 4.7: see README for documentation **
+    ** Version 4.8: see README for documentation **
     ***********************************************
 */
 
@@ -529,6 +529,7 @@
         $sql = "SELECT $fields FROM ".TABLE_PREFIX.
                "pages WHERE $wb->extra_where_sql $menuLimitSql ".
                'ORDER BY level ASC, position ASC';
+        $sql = str_replace('hidden', 'IGNOREME', $sql); // we want the hidden pages
         $oRowset = $database->query($sql);
         if (is_object($oRowset) && $oRowset->numRows() > 0) {
             // create an in memory array of the database data based on the item's parent. 
@@ -536,14 +537,20 @@
             while ($page = $oRowset->fetchRow()) {
                 // ignore all pages that the current user is not permitted to view
                 if(version_compare(WB_VERSION, '2.7', '>=')) { // WB >= 2.7
-                    // 1. all pages with no active sections (unless it is the top page) are ignored
-                    if (!$wb->page_is_active($page) && $page['link'] != $wb->default_link && !INTRO_PAGE) {
-                      continue; 
+                    // 1. hidden pages aren't shown unless they are on the current page
+                    if ($page['visibility'] == 'hidden') {
+                        $page['sm2_hide'] = true;
                     }
-                    // 2. all pages not visible to this user (unless always visible to registered users) are ignored
-                    if (!$wb->page_is_visible($page) && $page['visibility'] != 'registered') {
+                    
+                    // 2. all pages with no active sections (unless it is the top page) are ignored
+                    else if (!$wb->page_is_active($page) && $page['link'] != $wb->default_link && !INTRO_PAGE) {
                         continue;
                     }
+
+                    // 3. all pages not visible to this user (unless always visible to registered users) are ignored
+                    else if (!$wb->page_is_visible($page) && $page['visibility'] != 'registered') {
+                        continue;
+                    }
                 }
                 else {  // WB < 2.7
                     // We can't do this in SQL as the viewing_groups column contains multiple 
@@ -567,6 +574,7 @@
                 if ($page['page_id'] == $CURR_PAGE_ID) {
                     $page['sm2_is_curr'] = true;
                     $page['sm2_on_curr_path'] = true;
+                    unset($page['sm2_hide']); // don't hide the current page
                 }
 
                 // mark parents of the current page as such
@@ -573,6 +581,7 @@
                 if (in_array($page['page_id'], $rgCurrParents)) {
                     $page['sm2_is_parent'] = true;
                     $page['sm2_on_curr_path'] = true;
+                    unset($page['sm2_hide']); // don't hide a parent page                
                 }
                 
                 // add the entry to the array                
Index: trunk/wb/modules/show_menu2/README.en.txt
===================================================================
--- trunk/wb/modules/show_menu2/README.en.txt	(revision 970)
+++ trunk/wb/modules/show_menu2/README.en.txt	(revision 971)
@@ -1,4 +1,4 @@
-show_menu2, version 4.7
+show_menu2, version 4.8
 =======================
 A code snippet for the Website Baker CMS software. It provides a complete 
 replacement for the builtin menu functions. All menu data is retrieved using 
@@ -101,7 +101,40 @@
     correct flag values to pass for the $aOptions parameter.
 
 
+Q:  How do I use a different class/picture/color/widget for each entry in a menu?
+A:  Use the [page_id] format string in the $aItemOpen string. Create a unique 
+    class or id for each menu item, then reference that item in your CSS or Javascript
+    to do whatever you want.
+    
+    To add a unique class for each menu item (or similar):
+    
+        "<li><a href="[url]" target="[target]" class="[class] p[page_id]">[menu_title]</a>"
 
+        ... creating menu items like ...
+    
+        <li><a href="/pages/foo/bar.php" target="_top" class="menu-top p45">Top Menu</a>
+
+        Reference this in your CSS like:
+        
+        a.p45 { color: red; }
+    
+    To add a unique ID for each menu item (or similar):
+    
+        "<li><a id="p[page_id]" href="[url]" target="[target]" class="[class]">[menu_title]</a>"
+    
+        ... creating menu items like ...
+    
+        <li><a id="p45" href="/pages/foo/bar.php" target="_top" class="menu-top">Top Menu</a>
+
+        Reference this in your CSS like:
+        
+        a#p45 { color: red; }
+        
+        Note that the ID can only be used if that menu is generated and displayed one time
+        only on the page (because HTML ID's must be unique within a page). 
+    
+
+
 FUNCTION
 ========
 
@@ -140,8 +173,8 @@
 
 
 
-OUTPUT
-======
+HTML OUTPUT
+===========
 The menu is output differently depending on what parameters have been 
 supplied to the function, however in general the following classes are used 
 for each menu. Note that items will have multiple classes when relevant.
