Index: clone.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/node_clone/clone.module,v
retrieving revision 1.9.2.6
diff -u -p -r1.9.2.6 clone.module
--- clone.module	13 Dec 2007 01:29:38 -0000	1.9.2.6
+++ clone.module	12 Feb 2008 19:45:17 -0000

@@ -155,10 +155,44 
+/*
+ * Views field for cloning.  Adds a 'Clone' link field option similar to the node 'Edit' and 'Delete' fields.
+ */
+function clone_views_tables() {
+  $tables['clone'] = array(
+    'name' => 'node',
+    'provider' => 'internal', // won't show up in external list.
+    'fields' => array(
+      'clone' => array(
+        'name' => t('Clone: Clone link'),
+        'handler' => 'clone_views_handler_clone_link',
+        'notafield' => TRUE,
+        'option' => 'string',
+        'help' => t('Display a link to clone the node. Enter the text of this link into the option field; if blank the default "Clone" will be used.'),
+      ),
+    ),
+  );
+  return $tables;
+}
+
+/**
+ * display a link to clone a node with a destination return
+ */
+function clone_views_handler_clone_link($fieldinfo, $fielddata, $value, $data) {
+  $data->type = $data->node_type;
+  $data->uid = $data->node_uid;
+  global $user;
+  $access = (user_access('clone node') && clone_is_permitted($node->type) && node_access('create',$node->type));
+  if ($access) {
+    $link_text = $fielddata['options'] ? $fielddata['options'] : t('Clone');
+    return l($link_text, "node/$data->nid/clone", NULL, drupal_get_destination());
+  } 
+}
\ No newline at end of file
