Subversion Repositories phpLibraryV2

Rev

Rev 30 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30 Rev 31
Line 87... Line 87...
87
      }
87
      }
88
      //print "<pre>\n" . print_r( $this, true) . "</pre>"; die;
88
      //print "<pre>\n" . print_r( $this, true) . "</pre>"; die;
89
      return $this->htmlMenu( $this->inputRecords, 0, $rootDir, $permissions );
89
      return $this->htmlMenu( $this->inputRecords, 0, $rootDir, $permissions );
90
   }
90
   }
91
   
91
   
-
 
92
   
-
 
93
   /**
92
   // function takes a menu level and creates an HTML Menu items from it. If a node has children, will
94
    *  function takes a menu level and creates an HTML Menu items from it.
-
 
95
    * 
93
   // recursively call itself for each child node.
96
    * If a node has children, will recursively call itself for each child node.
-
 
97
    * If $permissions is set, any permission (based on shortname) that is set
-
 
98
    * to false is not shown. If an item is not in the list, or is set to true,
-
 
99
    * the menu item is displayed.
-
 
100
    */
94
   private function htmlMenu ($menu, $level=0, $rootDir = '', $permissions = array() ) {
101
   private function htmlMenu ($menu, $level=0, $rootDir = '', $permissions = array() ) {
95
      $result = '';
102
      $result = '';
96
      foreach ($menu as $key => $value) { // process each array entry
103
      foreach ($menu as $key => $value) { // process each array entry
97
         // ignore if there is a permission and it is false
104
         // ignore if there is a permission and it is false
98
         if ( isset( $permissions[$value['shortname']] ) && ! $permissions[$value['shortname']] ) {
105
         if ( isset( $permissions[$value['shortname']] ) && ! $permissions[$value['shortname']] ) {