You are here

public static function WeMegaMenuBuilder::updateMegamenuFromDrupalMenu in Drupal Mega Menu 8

Same name and namespace in other branches
  1. 8.x src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::updateMegamenuFromDrupalMenu()
3 calls to WeMegaMenuBuilder::updateMegamenuFromDrupalMenu()
template_preprocess_we_megamenu_backend in ./we_megamenu.module
template_preprocess_we_megamenu_frontend in ./we_megamenu.module
Prepare variables for we_megamenu_frontend.
WeMegaMenuBuilder::initMegamenu in src/WeMegaMenuBuilder.php

File

src/WeMegaMenuBuilder.php, line 955

Class

WeMegaMenuBuilder

Namespace

Drupal\we_megamenu

Code

public static function updateMegamenuFromDrupalMenu(&$megamenu_config, $menu_items, $level) {
  $menu_config = json_decode(json_encode($megamenu_config->menu_config), TRUE);
  foreach ($menu_items as $item) {
    self::compareItem($item, $level, $menu_config, $megamenu_config);
    if (count($item['subtree'])) {
      self::updateMegamenuFromDrupalMenu($megamenu_config, $item['subtree'], $level + 1);
    }
  }
}