array( 'type' => 'node', 'description' => t('Add to book outline'), 'configurable' => FALSE, 'behavior' => array('changes_node_property'), )); } function views_bulk_operations_book_addtobook_action($node) { $bid = 797; // set this to the nid of the book parent. $plid = 348; //set this to the mlid of the book parent. you can find this by looking in the "add child to book" link rendered on the parent page. $menu_name = 'book-toc-797'; // the number here should also be set to the nid as above. $link_path = 'node/'.$node->nid; $router_path = 'node/%'; $link_title = $node->title; $options = 'a:0:{}'; $module = 'book'; $depth = 2; $mlid = db_result(db_query("SELECT MAX(mlid) as mlid FROM {menu_links}")); $mlid = $mlid +1; db_query("INSERT INTO {menu_links} (menu_name, plid, link_path, router_path, link_title, options, module, depth, p1, p2) VALUES ('%s', %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $menu_name, $plid, $link_path, $router_path, $link_title, $options, $module, $depth, $plid, $mlid); $mlid = db_result(db_query("SELECT MAX(mlid) as mlid FROM {menu_links}")); // or db_last_insert_id('menu_links', 'mlid'); db_query("INSERT INTO {book} (nid, mlid, bid) VALUES (%d, %d, %d)", $node->nid, $mlid, $bid); node_save($node); } ?>