Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 1118)
+++ trunk/CHANGELOG	(revision 1119)
@@ -11,6 +11,8 @@
 ! = Update/Change
 
 ------------------------------------- 2.8.0 -------------------------------------
+11-Aug-2009 Matthias Gallas
+!	Updated show_menu2 to version 4.9
 9-Aug-2009 Matthias Gallas
 #	Replaced function mime_content_type as the old one causes shell_exec warnings
 	on some servers (Thanks to Aldus)
Index: trunk/wb/modules/show_menu2/info.php
===================================================================
--- trunk/wb/modules/show_menu2/info.php	(revision 1118)
+++ trunk/wb/modules/show_menu2/info.php	(revision 1119)
@@ -39,7 +39,7 @@
 $module_directory = 'show_menu2';
 $module_name = 'show_menu2';
 $module_function = 'snippet';
-$module_version = '4.8';
+$module_version = '4.9';
 $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 1118)
+++ trunk/wb/modules/show_menu2/README.de.txt	(revision 1119)
@@ -1,4 +1,4 @@
-﻿show_menu2, version 4.8
+﻿show_menu2, version 4.9
 =======================
 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 
@@ -398,8 +398,12 @@
                     Dies kann bei älteren Websitebaker Installationen erforderlich
                     sein um eine valide HTML Ausgabe zu erzeugen.
                         
-    SM2_NOESCAPE    Dies ist das Standarverhalten und existiert nur aus Gründen der 
-                    Abwärtskompatibilität.                   
+    SM2_SHOWHIDDEN  Hidden pages are usually hidden all of the time, including 
+                    when they are active (i.e. current page or a parent page).
+                    Use private pages for time when you want pages to be
+                    hidden except when active. However for compatibility with
+                    release 4.8, supply this flag to enable hidden pages to
+                    become visible when they are active.
 
     Für diesen Parameter gibt es auch einen erweiterten Modus, bei dem die Optionen
     als assoziatives Array übergeben werden. Näheres dazu im Abschnitt ERWEITERTE
Index: trunk/wb/modules/show_menu2/include.php
===================================================================
--- trunk/wb/modules/show_menu2/include.php	(revision 1118)
+++ trunk/wb/modules/show_menu2/include.php	(revision 1119)
@@ -22,28 +22,28 @@
     02110-1301, USA.
 
     ***********************************************
-    ** Version 4.8: see README for documentation **
+    ** Version 4.9: see README for documentation **
     ***********************************************
 */
 
-define('SM2_ROOT',       -1000);
-define('SM2_CURR',       -2000);
-define('SM2_ALLMENU',       -1);
-define('SM2_START',       1000);
-define('SM2_MAX',         2000);
-define('SM2_ALL',       0x0001); // bit 0 (group 1) (Note: also used for max level!)
-define('SM2_TRIM',      0x0002); // bit 1 (group 1)
-define('SM2_CRUMB',     0x0004); // bit 2 (group 1)
-define('SM2_SIBLING',   0x0008); // bit 3 (group 1)
-define('SM2_NUMCLASS',  0x0010); // bit 4
-define('SM2_ALLINFO',   0x0020); // bit 5
-define('SM2_NOCACHE',   0x0040); // bit 6
-define('SM2_PRETTY',    0x0080); // bit 7
-define('SM2_ESCAPE',    0x0100); // bit 8
-define('SM2_NOESCAPE',       0); // NOOP, unnecessary with WB 2.6.7+
-define('SM2_BUFFER',    0x0200); // bit 9
-define('SM2_CURRTREE',  0x0400); // bit 10
-define('SM2_HIDEPAGES', 0x0800); // bit 11 (reactivate old behavior and doesn't show hidden pages)
+define('SM2_ROOT',        -1000);
+define('SM2_CURR',        -2000);
+define('SM2_ALLMENU',        -1);
+define('SM2_START',        1000);
+define('SM2_MAX',          2000);
+define('SM2_ALL',        0x0001); // bit 0 (group 1) (Note: also used for max level!)
+define('SM2_TRIM',       0x0002); // bit 1 (group 1)
+define('SM2_CRUMB',      0x0004); // bit 2 (group 1)
+define('SM2_SIBLING',    0x0008); // bit 3 (group 1)
+define('SM2_NUMCLASS',   0x0010); // bit 4
+define('SM2_ALLINFO',    0x0020); // bit 5
+define('SM2_NOCACHE',    0x0040); // bit 6
+define('SM2_PRETTY',     0x0080); // bit 7
+define('SM2_ESCAPE',     0x0100); // bit 8
+define('SM2_NOESCAPE',        0); // NOOP, unnecessary with WB 2.6.7+
+define('SM2_BUFFER',     0x0200); // bit 9
+define('SM2_CURRTREE',   0x0400); // bit 10
+define('SM2_SHOWHIDDEN', 0x0800); // bit 11
 
 define('_SM2_GROUP_1',  0x000F); // exactly one flag from group 1 is required
 
@@ -575,8 +575,9 @@
                 if ($page['page_id'] == $CURR_PAGE_ID) {
                     $page['sm2_is_curr'] = true;
                     $page['sm2_on_curr_path'] = true;
-                    if (($flags & SM2_HIDEPAGES) == 0){
-                        unset($page['sm2_hide']); // don't hide the current page
+                    if ($flags & SM2_SHOWHIDDEN) { 
+                        // show hidden pages if active and SHOWHIDDEN flag supplied
+                        unset($page['sm2_hide']); 
                     }
                 }
 
@@ -584,7 +585,10 @@
                 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                
+                    if ($flags & SM2_SHOWHIDDEN) {
+                        // show hidden pages if active and SHOWHIDDEN flag supplied
+                        unset($page['sm2_hide']); 
+                    }
                 }
                 
                 // add the entry to the array                
Index: trunk/wb/modules/show_menu2/README.en.txt
===================================================================
--- trunk/wb/modules/show_menu2/README.en.txt	(revision 1118)
+++ trunk/wb/modules/show_menu2/README.en.txt	(revision 1119)
@@ -1,4 +1,4 @@
-show_menu2, version 4.8
+show_menu2, version 4.9
 =======================
 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 
@@ -329,6 +329,7 @@
     SM2_NUMCLASS    Add the numbered menu classes to the menu. If this 
                     flag is supplied, the "menu-N" and "menu-child-N" 
                     classes will be added.
+                    
     SM2_ALLINFO     Load all fields from the page table of the database.
                     This will result in quite a lot of memory being used
                     and is not recommended, however it will make keywords,
@@ -337,22 +338,33 @@
                     NOTE: This flag must be used on the *FIRST* call to
                     show_menu2 *for this menu ID*, or in combination with
                     SM2_NOCACHE otherwise it will have no effect.
+                    
     SM2_NOCACHE     Do not reuse or store the data read from the database
                     between calls to show_menu2. 
+                    
     SM2_PRETTY      Pretty print the menu HTML with spacing and newlines
                     for debugging purposes.
+                    
     SM2_BUFFER      Do not output the menu HTML but instead buffer it 
                     internally and return it as a string from show_menu2.
+                    
     SM2_CURRTREE    Exclude all other top level menus from being considered. 
                     Only items in the current menu tree will be output.
                     This can be combined with any of the Group 1 flags as
                     necessary.
+                    
     SM2_ESCAPE      Call htmlspecialchars on the menu strings. This may be
                     required with older installations of WB. By escaping the
                     raw database strings, it permits menus to have HTML 
                     formatting in them that would cause otherwise cause
                     pages to fail validation. 
-    SM2_NOESCAPE    Default behaviour. Exists only for backwards compatibility.                    
+    
+    SM2_SHOWHIDDEN  Hidden pages are usually hidden all of the time, including 
+                    when they are active (i.e. current page or a parent page).
+                    Use private pages for time when you want pages to be
+                    hidden except when active. However for compatibility with
+                    release 4.8, supply this flag to enable hidden pages to
+                    become visible when they are active.
 
     This parameter also has an extended mode where an associative array of 
     options is supplied. See the EXTENDED OPTIONS section for details. 
