split footer module into static and dynamic blocks
[ryf-theme.git] / modules / footer / src / Plugin / Block / FooterBlock.php
index 426cd82d42b26624165039900ef4391ee24f179b..413dca6243d26a37055642cc1518de480fd681ae 100644 (file)
@@ -26,33 +26,8 @@ class FooterBlock extends BlockBase implements BlockPluginInterface {
    */ 
     public function build() {
 
-      $menu_tree_parameters = new MenuTreeParameters();
-      $tree = \Drupal::menuTree()->load('footer', $menu_tree_parameters); 
-
-      $cc = 0;
-      foreach($tree as $menu){ 
-        $title     = $menu->link->getTitle();
-        $urlObject = $menu->link->getUrlObject();
-        $url       = $urlObject->toString();
-        $weight    = $menu->link->getWeight();
-        $enabled   = $menu->link->isEnabled();
-
-        if($enabled) {
-          $menu_array[$cc]['title']    = $title;
-          $menu_array[$cc]['url']      = $url;
-          $menu_array[$cc]['weight']   = $weight;
-          $cc++;
-        }
-
-      }
-
-      usort($menu_array, function($a, $b) {
-        return $a['weight'] - $b['weight'];
-      });
-
       return array(
         '#theme' => 'footer',
-        '#menu_array' => $menu_array,
         '#attached' => array(
           'library' => array(
             'footer/footer',