You are here

private function AlterSinglePageSiteOutput::setSinglePageItems in Single Page Site 8

Same name and namespace in other branches
  1. 2.x modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php \Drupal\single_page_site_next_page\EventSubscriber\AlterSinglePageSiteOutput::setSinglePageItems()
  2. 2.0.x modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php \Drupal\single_page_site_next_page\EventSubscriber\AlterSinglePageSiteOutput::setSinglePageItems()

Sets single page items (from menu tree).

Return value

array Return array with items.

1 call to AlterSinglePageSiteOutput::setSinglePageItems()
AlterSinglePageSiteOutput::__construct in modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php
AlterSinglePageSiteOutput constructor.

File

modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php, line 65

Class

AlterSinglePageSiteOutput
Class AlterSinglePageSiteOutput.

Namespace

Drupal\single_page_site_next_page\EventSubscriber

Code

private function setSinglePageItems() {
  $items =& drupal_static(__FUNCTION__);
  if (!isset($items)) {
    $items = array();
    $tree = $this->manager
      ->getMenuChildren();
    foreach ($tree as $menu_item) {
      if ($menu_item_details = $this->manager
        ->isMenuItemRenderable($menu_item)) {
        array_push($items, $menu_item_details);
      }
    }
  }
  return $items;
}