--- clone.pages.inc	2008-05-03 23:50:58.000000000 +0200
+++ clone.pages.inc.patched	2008-06-02 16:25:29.000000000 +0200
@@ -31,6 +31,18 @@
       '#default_value' => variable_get('clone_reset_'. $type, FALSE),
     );
   }
+
+  $form['menu'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Should the menu entry (title, menu parent, weight) be cloned?'),
+  );
+  $form['menu']['clone_menu'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Clone menu entry'),
+      '#default_value' => variable_get('clone_menu', FALSE),
+    );
+  
+
   // Need the variable default key to be something that's never a valid node type.
   $form['omit'] = array(
     '#type' => 'fieldset',
@@ -96,6 +108,32 @@
 
 
 /**
+ * Create a new menu entry with title, parent and weight cloned from
+ * another nodes menu. Returns NULL if the node has no menu title
+ */
+function clone_node_clone_menu($node) {
+
+  // if the node has a menu, it will be in $node->menu after this call
+  // so we can get the menu title and menu parent later. Otherwise
+  // the menu will be prepopulated with the default values
+  if (variable_get('clone_menu', FALSE)){
+    node_invoke_nodeapi($node, 'prepare');
+
+    if (!empty($node->menu['link_title'])) {
+      $new_menu=array();
+      $new_menu['link_title']=t('Clone of !menu_title', array('!menu_title' => $node->menu['link_title']));
+      $new_menu['plid']=$node->menu['plid'];
+      $new_menu['menu_name']=$node->menu['menu_name'];
+      $new_menu['weight']=$node->menu['weight'];
+      
+      return $new_menu;
+      }
+  }
+  return NULL;
+}
+
+
+/**
  *  Clones a node - prepopulate a node editing form
  */
 function clone_node_prepopulate($original_node) {
@@ -110,7 +148,7 @@
       $node->name = $user->name;
       $node->uid = $user->uid;
       $node->created = NULL;
-      $node->menu = NULL;
+      $node->menu = clone_node_clone_menu($original_node);
       if (isset($node->book['mlid'])) {
         $node->book['mlid'] = NULL;
       }
@@ -152,7 +190,7 @@
       $node->name = $user->name;
       $node->uid = $user->uid;
       $node->created = NULL;
-      $node->menu = NULL;
+      $node->menu = clone_node_clone_menu($original_node);
       $node->book['mlid'] = NULL;
       $node->path = NULL;
       $node->files = array();
