? menu_tab.patch Index: clone.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/node_clone/clone.module,v retrieving revision 1.23 diff -u -p -r1.23 clone.module --- clone.module 15 Oct 2008 18:39:44 -0000 1.23 +++ clone.module 8 Nov 2008 08:08:49 -0000 @@ -1,6 +1,6 @@ 'clone.pages.inc', 'description' => 'Allows users to clone (copy then edit) an existing node.', ); + + $menu_type = MENU_LOCAL_TASK; + if (!variable_get('clone_menu_tabs', TRUE)) { + $menu_type = MENU_CALLBACK; + } + $items['node/%node/clone'] = array( 'access callback' => 'clone_access', 'access arguments' => array(1), @@ -46,8 +52,9 @@ function clone_menu() { 'title' => 'Clone', 'weight' => 5, 'file' => 'clone.pages.inc', - 'type' => MENU_LOCAL_TASK, + 'type' => $menu_type, ); + return $items; } @@ -100,3 +107,16 @@ function clone_views_api() { ); } +/** +* Return a link to the clone menu callback for a specific node. +*/ +function clone_create_link($node) { + if (clone_access($node)) { + $options = array( + 'attributes' => array( + 'class' => 'clone', + ), + ); + return l(t('Clone'), 'node/'. $node->nid .'/clone', $options); + } +} \ No newline at end of file Index: clone.pages.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/node_clone/clone.pages.inc,v retrieving revision 1.3 diff -u -p -r1.3 clone.pages.inc --- clone.pages.inc 7 May 2008 02:28:58 -0000 1.3 +++ clone.pages.inc 8 Nov 2008 08:08:49 -0000 @@ -1,6 +1,6 @@ array(t('Require confirmation (recommended)'), t('Bypass confirmation')), '#description' => t('A new node may be saved immediately upon clicking the "clone" tab when viewing a node, bypassing the normal confirmation form.'), ); + $form['basic']['clone_menu_tabs'] = array( + '#type' => 'checkbox', + '#title' => t('Show clone tab on nodes'), + '#default_value' => variable_get('clone_menu_tabs', TRUE), + '#description' => t('When checked, a tab labeled \'Clone\' will appear on all nodes of the appropriate content type for users with the appropriate permissions. If unchecked, this tab will not appear, and you will have to add your own link in your site\'s theme. NOTE: If you change this setting you may need to clear your cache.'), + ); $form['publishing'] = array( '#type' => 'fieldset',