You are here

public function RenderCheeseburgerMenuBlock::searchInSubtItems in Cheeseburger Menu 8.3

Same name and namespace in other branches
  1. 8.2 src/Controller/RenderCheeseburgerMenuBlock.php \Drupal\cheeseburger_menu\Controller\RenderCheeseburgerMenuBlock::searchInSubtItems()

Search subitems.

1 call to RenderCheeseburgerMenuBlock::searchInSubtItems()
RenderCheeseburgerMenuBlock::findActiveChild in src/Controller/RenderCheeseburgerMenuBlock.php
Find active link.

File

src/Controller/RenderCheeseburgerMenuBlock.php, line 566
Controller used for rendering block.

Class

RenderCheeseburgerMenuBlock
Class RenderCheeseburgerMenuBlock.

Namespace

Drupal\cheeseburger_menu\Controller

Code

public function searchInSubtItems($menus, $route_id, $current_url, $page_type, &$statusArray) {
  foreach ($menus as $menu) {
    if ($menu['id'] == $route_id && $page_type == $menu['type']) {
      $statusArray['id'][] = $menu;
    }
    if ($current_url == $menu['url']) {
      $statusArray['url'][] = $menu;
    }
    if ((strpos($menu['id'], $route_id) !== FALSE || strpos($route_id, $menu['id']) !== FALSE) && $page_type == $menu['type']) {
      $statusArray['in'][] = $menu;
    }
    if (isset($menu['subitem']) && count($menu['subitem']) > 0) {
      $this
        ->searchInSubtItems($menu['subitem'], $route_id, $current_url, $page_type, $statusArray);
    }
  }
}