At a minimum to create a Drupal module you need to have two files
In the session we create these two files
modmenu.info
name = modmenu
description "Modifies the menu location for nodes"
modmenu.module
function modmenu_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ($node->type == "page") {
if ($op == "insert" || $op == "update") {
drupal_set_message("Modifying the menu");
$menu = array (
'title' => "My Menu",
'description' => "My description",
'pid' => 1,
'path' => 'node/'.$node->nid,
'weight' => 0,
'mid' => 0,
'type' => 86,
);
$node->menu = $menu;
}
}
}