You are here

function og_menu_node_insert in Organic Groups Menu (OG Menu) 7.3

Same name and namespace in other branches
  1. 7.2 og_menu.module \og_menu_node_insert()

Implements hook_node_insert().

File

./og_menu.module, line 796
Integrates Menu with Organic Groups. Lots of menu forms duplication in OG context.

Code

function og_menu_node_insert($node) {
  if (og_is_group('node', $node)) {
    if (isset($node->og_menu) && $node->og_menu) {
      menu_save(array(
        'menu_name' => 'menu-og-' . $node->nid,
        'title' => $node->title,
        'description' => t('OG Menu for') . ' ' . check_plain($node->title),
      ));
      og_menu_update_menu('menu-og-' . $node->nid, $node->nid, 'node');
    }
  }
}