original_string: protected function loadItems()
      {
          /*
           * Load module items
           */
          foreach ($this->callbacks as $callback) {
              $callback($this);
          }
  
          /*
           * Load plugin items
           */
          $plugins = $this->pluginManager->getPlugins();
  
          foreach ($plugins as $id => $plugin) {
              $items = $plugin->registerNavigation();
              if (!is_array($items)) {
                  continue;
              }
  
              $this->registerMenuItems($id, $items);
          }
  
          /*
           * Extensibility
           */
          Event::fire('backend.menu.extendItems', [$this]);
  
          /*
           * Sort menu items
           */
          uasort($this->items, function ($a, $b) {
              return $a->order - $b->order;
          });
  
          /*
           * Filter items user lacks permission for
           */
          $user = BackendAuth::getUser();
          $this->items = $this->filterItemPermissions($user, $this->items);
  
          foreach ($this->items as $item) {
              if (!$item->sideMenu || !count($item->sideMenu)) {
                  continue;
              }
  
              /*
               * Apply incremental default orders
               */
              $orderCount = 0;
              foreach ($item->sideMenu as $sideMenuItem) {
                  if ($sideMenuItem->order !== -1) continue;
                  $sideMenuItem->order = ($orderCount += 100);
              }
  
              /*
               * Sort side menu items
               */
              uasort($item->sideMenu, function ($a, $b) {
                  return $a->order - $b->order;
              });
  
              /*
               * Filter items user lacks permission for
               */
              $item->sideMenu = $this->filterItemPermissions($user, $item->sideMenu);
          }
      }
code: protected function loadItems()
      {
          /*
           * Load module items
           */
          foreach ($this->callbacks as $callback) {
              $callback($this);
          }
  
          /*
           * Load plugin items
           */
          $plugins = $this->pluginManager->getPlugins();
  
          foreach ($plugins as $id => $plugin) {
              $items = $plugin->registerNavigation();
              if (!is_array($items)) {
                  continue;
              }
  
              $this->registerMenuItems($id, $items);
          }
  
          /*
           * Extensibility
           */
          Event::fire('backend.menu.extendItems', [$this]);
  
          /*
           * Sort menu items
           */
          uasort($this->items, function ($a, $b) {
              return $a->order - $b->order;
          });
  
          /*
           * Filter items user lacks permission for
           */
          $user = BackendAuth::getUser();
          $this->items = $this->filterItemPermissions($user, $this->items);
  
          foreach ($this->items as $item) {
              if (!$item->sideMenu || !count($item->sideMenu)) {
                  continue;
              }
  
              /*
               * Apply incremental default orders
               */
              $orderCount = 0;
              foreach ($item->sideMenu as $sideMenuItem) {
                  if ($sideMenuItem->order !== -1) continue;
                  $sideMenuItem->order = ($orderCount += 100);
              }
  
              /*
               * Sort side menu items
               */
              uasort($item->sideMenu, function ($a, $b) {
                  return $a->order - $b->order;
              });
  
              /*
               * Filter items user lacks permission for
               */
              $item->sideMenu = $this->filterItemPermissions($user, $item->sideMenu);
          }
      }
code_tokens: protected function loadItems ( ) { /*
           * Load module items
           */ foreach ( $ this -> callbacks as $ callback ) { $ callback ( $ this ) ; } /*
           * Load plugin items
           */ $ plugins = $ this -> pluginManager -> getPlugins ( ) ; foreach ( $ plugins as $ id => $ plugin ) { $ items = $ plugin -> registerNavigation ( ) ; if ( ! is_array ( $ items ) ) { continue ; } $ this -> registerMenuItems ( $ id , $ items ) ; } /*
           * Extensibility
           */ Event :: fire ( 'backend.menu.extendItems' , [ $ this ] ) ; /*
           * Sort menu items
           */ uasort ( $ this -> items , function ( $ a , $ b ) { return $ a -> order - $ b -> order ; } ) ; /*
           * Filter items user lacks permission for
           */ $ user = BackendAuth :: getUser ( ) ; $ this -> items = $ this -> filterItemPermissions ( $ user , $ this -> items ) ; foreach ( $ this -> items as $ item ) { if ( ! $ item -> sideMenu || ! count ( $ item -> sideMenu ) ) { continue ; } /*
               * Apply incremental default orders
               */ $ orderCount = 0 ; foreach ( $ item -> sideMenu as $ sideMenuItem ) { if ( $ sideMenuItem -> order !== - 1 ) continue ; $ sideMenuItem -> order = ( $ orderCount += 100 ) ; } /*
               * Sort side menu items
               */ uasort ( $ item -> sideMenu , function ( $ a , $ b ) { return $ a -> order - $ b -> order ; } ) ; /*
               * Filter items user lacks permission for
               */ $ item -> sideMenu = $ this -> filterItemPermissions ( $ user , $ item -> sideMenu ) ; } }
docstring: Loads the menu items from modules and plugins
  @return void
docstring_tokens: Loads the menu items from modules and plugins