function og_menu_edit_item_form in Organic Groups Menu (OG Menu) 7.2
Same name and namespace in other branches
- 6.2 og_menu.module \og_menu_edit_item_form()
- 6 og_menu.module \og_menu_edit_item_form()
- 7.3 og_menu.pages.inc \og_menu_edit_item_form()
Form callback; Build the menu link editing form.
1 string reference to 'og_menu_edit_item_form'
- og_menu_menu in ./
og_menu.module - Implementation of hook_menu().
File
- ./
og_menu.pages.inc, line 160 - Contains page callbacks for og_menu
Code
function og_menu_edit_item_form($form, &$form_state, $type, $item, $menu, $node) {
$b = drupal_get_breadcrumb();
$b[] = l($menu['title'], 'node/' . $node->nid . '/og_menu/' . $menu['menu_name']);
drupal_set_breadcrumb($b);
module_load_include('inc', 'menu', 'menu.admin');
$form = drupal_retrieve_form('menu_edit_item', $form_state, $form, $type, $item, $menu);
$list = array();
$menus = og_menu_get_group_menus(array(
og_get_group('node', $node->nid)->gid,
));
foreach ($menus as $option) {
$list[$option->mname] = $option->mtitle;
}
// Set the title of the page.
drupal_set_title(t('Add item into menu !mtitle', array(
'!mtitle' => $menu['title'],
)), PASS_THROUGH);
// Build the form.
$form['parent']['#options'] = menu_parent_options($list, array(
'mlid' => 0,
));
$form['#submit'][] = 'menu_edit_item_submit';
$form['#submit'][] = 'og_menu_redirect';
$form['#validate'][] = 'menu_edit_item_validate';
$form['delete']['#submit'][] = 'og_menu_delete_item_form';
return $form;
}