Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
46 rodolico 1
               <div class="menu">
2
                  <div class="boxtitle">
42 rodolico 3
                     Menu 
4
                  </div>
5
                  <?php 
45 rodolico 6
                     if ( isset( $_SESSION['user'] ) && $_SESSION['user']->name() ) {
7
                        include_once("DBMenu.class.php");
8
                        $menu = new DBMenu( $dbConnection, '_menu', '_menu_id' );
46 rodolico 9
                        $additionalMenus = array( 
10
                              array( 
11
                                 'caption' => 'User: ' . $_SESSION['user']->name(), 
12
                                 'url' => "/index.php?doAdmin=1",
13
                                 'shortname' => 'user'
14
                              ), 
15
                              array( 
16
                                 'caption' => 'Log Out',
17
                                 'url' => "/index.php?logout=1",
18
                                 'shortname' => 'logout'
19
                              ) 
20
                           );
21
                        if ( $_SESSION['user']->isAdmin() ) {
22
                           $additionalMenus[] = array( 
23
                                 'caption' => 'Administration', 
24
                                 'url' => "/index.php?action=admin",
25
                                 'shortname' => 'admin'
26
                              );
27
                        }
28
 
29
                        print $menu->DBMenu2String( $baseURL, $additionalMenus );
30
                        //print "<pre>\n" . print_r( $menu, true ) . "</pre>"; die;
45 rodolico 31
                     }
42 rodolico 32
                  ?>
33
               </div>