Project

General

Profile

« Previous | Next » 

Revision 1183

Added by Dietmar almost 15 years ago

fixed php 5.3 depricated function in show_menu2

View differences:

branches/2.8.x/wb/modules/show_menu2/include.php
22 22
    02110-1301, USA.
23 23

  
24 24
    ***********************************************
25
    ** Version 4.9: see README for documentation **
25
    ** Version 4.8: 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_SHOWHIDDEN', 0x0800); // bit 11
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
47 46

  
48 47
define('_SM2_GROUP_1',  0x000F); // exactly one flag from group 1 is required
49 48

  
......
486 485
    // the database. If this variable exists, then we have already retrieved all
487 486
    // of the information and processed it, so we don't need to do it again.
488 487
    if (($flags & SM2_NOCACHE) != 0
489
        || !array_key_exists('show_menu2_data', $GLOBALS) 
488
        || !array_key_exists('show_menu2_data', $GLOBALS)
490 489
        || !array_key_exists($aMenu, $GLOBALS['show_menu2_data'])) 
491 490
    {
492 491
        global $database;
493 492

  
494 493
        // create an array of all parents of the current page. As the page_trail
495 494
        // doesn't include the theoretical root element 0, we add it ourselves.
496
        $rgCurrParents = split(',', '0,'.$wb->page['page_trail']);
495
        $rgCurrParents = preg_split ('[,]', '0,'.$wb->page['page_trail']);
497 496
        array_pop($rgCurrParents); // remove the current page
498 497
        $rgParent = array();
499 498

  
......
575 574
                if ($page['page_id'] == $CURR_PAGE_ID) {
576 575
                    $page['sm2_is_curr'] = true;
577 576
                    $page['sm2_on_curr_path'] = true;
578
                    if ($flags & SM2_SHOWHIDDEN) { 
579
                        // show hidden pages if active and SHOWHIDDEN flag supplied
580
                        unset($page['sm2_hide']); 
581
                    }
577
                    unset($page['sm2_hide']); // don't hide the current page
582 578
                }
583 579

  
584 580
                // mark parents of the current page as such
585 581
                if (in_array($page['page_id'], $rgCurrParents)) {
586 582
                    $page['sm2_is_parent'] = true;
587 583
                    $page['sm2_on_curr_path'] = true;
588
                    if ($flags & SM2_SHOWHIDDEN) {
589
                        // show hidden pages if active and SHOWHIDDEN flag supplied
590
                        unset($page['sm2_hide']); 
591
                    }
584
                    unset($page['sm2_hide']); // don't hide a parent page                
592 585
                }
593 586
                
594 587
                // add the entry to the array                

Also available in: Unified diff