You are here

function menu_patterns_export_all_menu in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_components/components/menu.inc \menu_patterns_export_all_menu()
1 string reference to 'menu_patterns_export_all_menu'
menu_patterns in patterns_components/components/menu.inc

File

patterns_components/components/menu.inc, line 38

Code

function menu_patterns_export_all_menu($args = NULL, &$result = NULL) {

  // $info = menu_patterns($data=NULL);
  // $form_id = current($info['menu'][PATTERNS_MODIFY]);

  //$menus = db_query("SELECT * FROM {menu_custom} ORDER BY title", array(), array('fetch' => PDO::FETCH_ASSOC));
  $menus = menu_load_all();
  $result = array();
  foreach ($menus as $menu) {
    $menu = (array) $menu;
    $data = array(
      'tag' => 'menu',
    );
    $data = array_merge($data, $menu);
    $action = array(
      PATTERNS_CREATE => $data,
    );
    array_push($result, $action);

    // It is important to user array merge. Pushing is not enough

    //$result = array_merge($result, patterns_export_actions_from_form($form_id, $menu, 'menu', PATTERNS_MODIFY));
  }
  return $result;
}