Index: terms_of_use.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/terms_of_use/terms_of_use.module,v
retrieving revision 1.1.2.26
diff -u -p -r1.1.2.26 terms_of_use.module
--- terms_of_use.module	15 May 2010 13:05:40 -0000	1.1.2.26
+++ terms_of_use.module	7 Jan 2011 10:17:22 -0000
@@ -80,6 +80,27 @@ function terms_of_use_admin_settings() {
     '#default_value' => variable_get('terms_of_use_fieldset_name', t('Terms of Use')),
     '#description' => t('The text for the Terms of Use and the [x] checkbox are contained in a fieldset. Type here the title for that fieldset.'),
   );
+  $fields = array('body');
+  if (function_exists('content_fields')) {
+    $node = node_load(variable_get('terms_of_use_node_id', 0));
+    if (isset($node->type)) {
+      $all_fields = content_fields();
+      foreach ($all_fields as $field) {
+        if ($field['type_name'] == $node->type) {
+          $fields[] = $field['field_name'];
+        }
+      }
+    }
+  }
+  if (count($fields) > 1) {
+    $form['terms_of_use_form']['terms_of_use_field'] = array(
+      '#type' => 'select',
+      '#options' => drupal_map_assoc($fields),
+      '#title' => t('Retrieve the ToS from'),
+      '#default_value' => variable_get('terms_of_use_field', 'body'),
+      '#description' => t('You can specify the field what contains the Terms of Service. If you change the node, the list of available fields may be chaged.'),
+    );
+  }
   $form['terms_of_use_form']['terms_of_use_checkbox_label'] = array(
     '#type' => 'textfield',
     '#title' => t('Label for the checkbox'),
@@ -176,11 +197,20 @@ function terms_of_use_form_user_register
       }
       // Adding the nodes body by theme_terms_of_use() to the fieldset if desired.
       if ($show_terms) {
-        $node = node_prepare(node_load($terms_of_use_node_id));
-        if ($node->body) {
+        $field = variable_get('terms_of_use_field', 'body');
+        if ($field == 'body' || !function_exists('content_view')) {
+          $node = node_prepare(node_load($terms_of_use_node_id));
+          $tos = $node->body;
+        }
+        else {
+          $node = node_load($terms_of_use_node_id);
+          content_view($node, FALSE, TRUE);
+          $tos = drupal_render($node->content[$field]);
+        }
+        if (!empty($tos)) {
           drupal_add_css(drupal_get_path('module', 'terms_of_use') . '/terms_of_use.css');
           $form['terms_of_use']['terms_of_use_text'] = array(
-                  '#value' => theme('terms_of_use', $node->body, $node),
+                  '#value' => theme('terms_of_use', $tos, $node),
           );
         }
         else {
@@ -285,4 +315,4 @@ function tou_i18nstrings($name, $string,
   else {
     return $string;
   }
-}
\ No newline at end of file
+}
