Revision 1119
Added by Matthias about 16 years ago
| trunk/CHANGELOG | ||
|---|---|---|
| 11 | 11 |
! = Update/Change |
| 12 | 12 |
|
| 13 | 13 |
------------------------------------- 2.8.0 ------------------------------------- |
| 14 |
11-Aug-2009 Matthias Gallas |
|
| 15 |
! Updated show_menu2 to version 4.9 |
|
| 14 | 16 |
9-Aug-2009 Matthias Gallas |
| 15 | 17 |
# Replaced function mime_content_type as the old one causes shell_exec warnings |
| 16 | 18 |
on some servers (Thanks to Aldus) |
| trunk/wb/modules/show_menu2/info.php | ||
|---|---|---|
| 39 | 39 |
$module_directory = 'show_menu2'; |
| 40 | 40 |
$module_name = 'show_menu2'; |
| 41 | 41 |
$module_function = 'snippet'; |
| 42 |
$module_version = '4.8';
|
|
| 42 |
$module_version = '4.9';
|
|
| 43 | 43 |
$module_platform = '2.6.x | 2.7.x'; |
| 44 | 44 |
$module_author = 'Brodie Thiesfield'; |
| 45 | 45 |
$module_license = 'GNU General Public License'; |
| trunk/wb/modules/show_menu2/README.de.txt | ||
|---|---|---|
| 1 |
show_menu2, version 4.8
|
|
| 1 |
show_menu2, version 4.9
|
|
| 2 | 2 |
======================= |
| 3 | 3 |
Ist ein Code-Snippet für das CMS Website Baker. Es stellt einen kompletten |
| 4 | 4 |
Ersatz für die eingebaute Menüfuntionalität zur Verfügung. Alle, für die |
| ... | ... | |
| 398 | 398 |
Dies kann bei älteren Websitebaker Installationen erforderlich |
| 399 | 399 |
sein um eine valide HTML Ausgabe zu erzeugen. |
| 400 | 400 |
|
| 401 |
SM2_NOESCAPE Dies ist das Standarverhalten und existiert nur aus Gründen der |
|
| 402 |
Abwärtskompatibilität. |
|
| 401 |
SM2_SHOWHIDDEN Hidden pages are usually hidden all of the time, including |
|
| 402 |
when they are active (i.e. current page or a parent page). |
|
| 403 |
Use private pages for time when you want pages to be |
|
| 404 |
hidden except when active. However for compatibility with |
|
| 405 |
release 4.8, supply this flag to enable hidden pages to |
|
| 406 |
become visible when they are active. |
|
| 403 | 407 |
|
| 404 | 408 |
Für diesen Parameter gibt es auch einen erweiterten Modus, bei dem die Optionen |
| 405 | 409 |
als assoziatives Array übergeben werden. Näheres dazu im Abschnitt ERWEITERTE |
| trunk/wb/modules/show_menu2/include.php | ||
|---|---|---|
| 22 | 22 |
02110-1301, USA. |
| 23 | 23 |
|
| 24 | 24 |
*********************************************** |
| 25 |
** Version 4.8: see README for documentation **
|
|
| 25 |
** Version 4.9: see README for documentation **
|
|
| 26 | 26 |
*********************************************** |
| 27 | 27 |
*/ |
| 28 | 28 |
|
| 29 |
define('SM2_ROOT', -1000);
|
|
| 30 |
define('SM2_CURR', -2000);
|
|
| 31 |
define('SM2_ALLMENU', -1);
|
|
| 32 |
define('SM2_START', 1000);
|
|
| 33 |
define('SM2_MAX', 2000);
|
|
| 34 |
define('SM2_ALL', 0x0001); // bit 0 (group 1) (Note: also used for max level!)
|
|
| 35 |
define('SM2_TRIM', 0x0002); // bit 1 (group 1)
|
|
| 36 |
define('SM2_CRUMB', 0x0004); // bit 2 (group 1)
|
|
| 37 |
define('SM2_SIBLING', 0x0008); // bit 3 (group 1)
|
|
| 38 |
define('SM2_NUMCLASS', 0x0010); // bit 4
|
|
| 39 |
define('SM2_ALLINFO', 0x0020); // bit 5
|
|
| 40 |
define('SM2_NOCACHE', 0x0040); // bit 6
|
|
| 41 |
define('SM2_PRETTY', 0x0080); // bit 7
|
|
| 42 |
define('SM2_ESCAPE', 0x0100); // bit 8
|
|
| 43 |
define('SM2_NOESCAPE', 0); // NOOP, unnecessary with WB 2.6.7+
|
|
| 44 |
define('SM2_BUFFER', 0x0200); // bit 9
|
|
| 45 |
define('SM2_CURRTREE', 0x0400); // bit 10
|
|
| 46 |
define('SM2_HIDEPAGES', 0x0800); // bit 11 (reactivate old behavior and doesn't show hidden pages)
|
|
| 29 |
define('SM2_ROOT', -1000);
|
|
| 30 |
define('SM2_CURR', -2000);
|
|
| 31 |
define('SM2_ALLMENU', -1);
|
|
| 32 |
define('SM2_START', 1000);
|
|
| 33 |
define('SM2_MAX', 2000);
|
|
| 34 |
define('SM2_ALL', 0x0001); // bit 0 (group 1) (Note: also used for max level!)
|
|
| 35 |
define('SM2_TRIM', 0x0002); // bit 1 (group 1)
|
|
| 36 |
define('SM2_CRUMB', 0x0004); // bit 2 (group 1)
|
|
| 37 |
define('SM2_SIBLING', 0x0008); // bit 3 (group 1)
|
|
| 38 |
define('SM2_NUMCLASS', 0x0010); // bit 4
|
|
| 39 |
define('SM2_ALLINFO', 0x0020); // bit 5
|
|
| 40 |
define('SM2_NOCACHE', 0x0040); // bit 6
|
|
| 41 |
define('SM2_PRETTY', 0x0080); // bit 7
|
|
| 42 |
define('SM2_ESCAPE', 0x0100); // bit 8
|
|
| 43 |
define('SM2_NOESCAPE', 0); // NOOP, unnecessary with WB 2.6.7+
|
|
| 44 |
define('SM2_BUFFER', 0x0200); // bit 9
|
|
| 45 |
define('SM2_CURRTREE', 0x0400); // bit 10
|
|
| 46 |
define('SM2_SHOWHIDDEN', 0x0800); // bit 11
|
|
| 47 | 47 |
|
| 48 | 48 |
define('_SM2_GROUP_1', 0x000F); // exactly one flag from group 1 is required
|
| 49 | 49 |
|
| ... | ... | |
| 575 | 575 |
if ($page['page_id'] == $CURR_PAGE_ID) {
|
| 576 | 576 |
$page['sm2_is_curr'] = true; |
| 577 | 577 |
$page['sm2_on_curr_path'] = true; |
| 578 |
if (($flags & SM2_HIDEPAGES) == 0){
|
|
| 579 |
unset($page['sm2_hide']); // don't hide the current page |
|
| 578 |
if ($flags & SM2_SHOWHIDDEN) {
|
|
| 579 |
// show hidden pages if active and SHOWHIDDEN flag supplied |
|
| 580 |
unset($page['sm2_hide']); |
|
| 580 | 581 |
} |
| 581 | 582 |
} |
| 582 | 583 |
|
| ... | ... | |
| 584 | 585 |
if (in_array($page['page_id'], $rgCurrParents)) {
|
| 585 | 586 |
$page['sm2_is_parent'] = true; |
| 586 | 587 |
$page['sm2_on_curr_path'] = true; |
| 587 |
unset($page['sm2_hide']); // don't hide a parent page |
|
| 588 |
if ($flags & SM2_SHOWHIDDEN) {
|
|
| 589 |
// show hidden pages if active and SHOWHIDDEN flag supplied |
|
| 590 |
unset($page['sm2_hide']); |
|
| 591 |
} |
|
| 588 | 592 |
} |
| 589 | 593 |
|
| 590 | 594 |
// add the entry to the array |
| trunk/wb/modules/show_menu2/README.en.txt | ||
|---|---|---|
| 1 |
show_menu2, version 4.8
|
|
| 1 |
show_menu2, version 4.9
|
|
| 2 | 2 |
======================= |
| 3 | 3 |
A code snippet for the Website Baker CMS software. It provides a complete |
| 4 | 4 |
replacement for the builtin menu functions. All menu data is retrieved using |
| ... | ... | |
| 329 | 329 |
SM2_NUMCLASS Add the numbered menu classes to the menu. If this |
| 330 | 330 |
flag is supplied, the "menu-N" and "menu-child-N" |
| 331 | 331 |
classes will be added. |
| 332 |
|
|
| 332 | 333 |
SM2_ALLINFO Load all fields from the page table of the database. |
| 333 | 334 |
This will result in quite a lot of memory being used |
| 334 | 335 |
and is not recommended, however it will make keywords, |
| ... | ... | |
| 337 | 338 |
NOTE: This flag must be used on the *FIRST* call to |
| 338 | 339 |
show_menu2 *for this menu ID*, or in combination with |
| 339 | 340 |
SM2_NOCACHE otherwise it will have no effect. |
| 341 |
|
|
| 340 | 342 |
SM2_NOCACHE Do not reuse or store the data read from the database |
| 341 | 343 |
between calls to show_menu2. |
| 344 |
|
|
| 342 | 345 |
SM2_PRETTY Pretty print the menu HTML with spacing and newlines |
| 343 | 346 |
for debugging purposes. |
| 347 |
|
|
| 344 | 348 |
SM2_BUFFER Do not output the menu HTML but instead buffer it |
| 345 | 349 |
internally and return it as a string from show_menu2. |
| 350 |
|
|
| 346 | 351 |
SM2_CURRTREE Exclude all other top level menus from being considered. |
| 347 | 352 |
Only items in the current menu tree will be output. |
| 348 | 353 |
This can be combined with any of the Group 1 flags as |
| 349 | 354 |
necessary. |
| 355 |
|
|
| 350 | 356 |
SM2_ESCAPE Call htmlspecialchars on the menu strings. This may be |
| 351 | 357 |
required with older installations of WB. By escaping the |
| 352 | 358 |
raw database strings, it permits menus to have HTML |
| 353 | 359 |
formatting in them that would cause otherwise cause |
| 354 | 360 |
pages to fail validation. |
| 355 |
SM2_NOESCAPE Default behaviour. Exists only for backwards compatibility. |
|
| 361 |
|
|
| 362 |
SM2_SHOWHIDDEN Hidden pages are usually hidden all of the time, including |
|
| 363 |
when they are active (i.e. current page or a parent page). |
|
| 364 |
Use private pages for time when you want pages to be |
|
| 365 |
hidden except when active. However for compatibility with |
|
| 366 |
release 4.8, supply this flag to enable hidden pages to |
|
| 367 |
become visible when they are active. |
|
| 356 | 368 |
|
| 357 | 369 |
This parameter also has an extended mode where an associative array of |
| 358 | 370 |
options is supplied. See the EXTENDED OPTIONS section for details. |
Also available in: Unified diff
Updated show_menu2 to version 4.9