Index: nodegoto.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/nodegoto/Attic/nodegoto.module,v
retrieving revision 1.1.2.1.2.4.2.1
diff -u -r1.1.2.1.2.4.2.1 nodegoto.module
--- nodegoto.module	30 Jan 2007 11:36:01 -0000	1.1.2.1.2.4.2.1
+++ nodegoto.module	11 Apr 2007 10:28:09 -0000
@@ -13,16 +13,14 @@
 function nodegoto_help($section) {
   switch ($section) {
      case 'admin/settings/nodegoto':
-      return t('     
-
-<p>This module allows you to <strong>define any page or URL as the target</strong>, after you:</p>
+      return t("<p>This module allows you to <strong>define any page or URL as the target</strong>, after you:</p>
 <ul>
-  <li>create  a node</li>
-  <li>update  a node</li>
-  <li>delete  a node</li>
+  <li>create a node</li>
+  <li>update a node</li>
+  <li>delete a node</li>
 </ul>
-<p>It also has the option to send the target page a variable informing from  where it came.</p>
-');
+<p>If you have the <a href='@token'>Token module</a> installed you can use dynamic placeholder tokens in your paths.</p>
+<p>It also has the option to send the target page a variable informing from  where it came.</p>", array('@token' => 'http://www.drupal.org/project/token'));
   }
 }
 /**
@@ -32,7 +30,7 @@
     
 	$nodetype=$node->type;
 	$nid=$node->nid;
-	$nodeto= variable_get('nodegoto_'.$op.'_'.$nodetype,'');
+	$nodeto = module_exists('token') ? token_replace(variable_get('nodegoto_'.$op.'_'.$nodetype,''), 'node', $node) : variable_get('nodegoto_'.$op.'_'.$nodetype,'');
 	
 	if (variable_get('nodegoto_camefrom',0)==1){
   $camefrom='camefrom='.urlencode('node/'.$nid);  
@@ -86,7 +84,7 @@
         '#type' => 'fieldset',
         '#title' => t('Set the path to redirect for, when INSERTING'),
         '#collapsible' => TRUE,
-        '#description' => t('You can set a path like \'node/1\' or like a full URL \'http://www.example.com\''),
+        '#description' => module_exists('token') ? t('You can set a static path like \'node/1\', a full URL like \'http://www.example.com\', or a dynamic path like \'user/1/track\'. See placeholder token instructions below for more details.'): t('You can set a static path like \'node/1\' or full URL like \'http://www.example.com\''),
         '#collapsed' => true,
       );
   
@@ -104,7 +102,7 @@
      $form['nodesupdate'] = array(
       '#type' => 'fieldset',
       '#title' => t('Set the path to redirect for, when UPDATING'),
-      '#description' => t('You can set a path like \'node/1\' or like a full URL \'http://www.example.com\''),
+      '#description' => module_exists('token') ? t('You can set a static path like \'node/1\', a full URL like \'http://www.example.com\', or a dynamic path like \'user/1/track\'. See placeholder token instructions below for more details.'): t('You can set a static path like \'node/1\' or full URL like \'http://www.example.com\''),
       '#collapsed' => true,
       '#collapsible' => TRUE,
       );
@@ -123,7 +121,7 @@
    $form['nodesdelete'] = array(
       '#type' => 'fieldset',
       '#title' => t('Set the path to redirect for, when DELETING'),
-      '#description' => t('You can set a path like \'node/1\' or like a full URL \'http://www.example.com\''),
+      '#description' => module_exists('token') ? t('You can set a static path like \'node/1\', a full URL like \'http://www.example.com\', or a dynamic path like \'user/1/track\'. See placeholder token instructions below for more details.'): t('You can set a static path like \'node/1\' or full URL like \'http://www.example.com\''),
       '#collapsed' => true,
       '#collapsible' => TRUE,
       );
@@ -139,6 +137,25 @@
      );    
    }
    
+  $form['help'] = array(
+    '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#title' => t('Placeholder tokens'),
+    '#description' => t("The following placeholder tokens can be used in paths. They will be replaced with the appropriate values."),
+  );
+  
+  if (module_exists('token')) {
+    $form['help']['tokens'] = array(
+      '#value' => theme('token_help', 'node'),
+    );
+  }
+  else {
+    $form['help']['#description'] = t("To use dynamic placeholder tokens in your paths download and install the <a href='@token'>Token module</a> from Drupal.org.", array('@token' => 'http://www.drupal.org/project/token'));
+    $form['help']['#collapsible'] = FALSE;
+    $form['help']['#collapsed'] = FALSE;
+  }
+
   $form['nodescamefrom'] = array(
       '#type' => 'fieldset',
       '#title' => t('Advanced options'),
