Index: excerpt.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/excerpt/excerpt.module,v
retrieving revision 1.6
diff -u -r1.6 excerpt.module
--- excerpt.module	30 Dec 2005 17:31:10 -0000	1.6
+++ excerpt.module	1 Feb 2007 01:12:44 -0000
@@ -1,44 +1,34 @@
 <?php
 // $Id: excerpt.module,v 1.6 2005/12/30 17:31:10 unconed Exp $
 
-function excerpt_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      return t('Allows users to enter a separate excerpt for nodes.');
-    case 'admin/node/configure/defaults':
-      return t('<p>If you want users to be able to enter separate excerpts for nodes, check the <em>excerpt</em> box in the appropriate column.</p>');
-  }
-}
-
-function excerpt_nodeapi(&$node, $op, $arg) {
+function excerpt_nodeapi(&$node, $op, $teaser) {
   switch ($op) {
     case 'validate':
+    case 'load':
       if (trim($node->teaser) == '') {
         $node->teaser = node_teaser($node->body);
       }
       break;
     case 'view':
-      $node->readmore = $node->teaser != $node->body;
+      $node->readmore = ($node->teaser != $node->body);
       break;
   }
 }
 
 function excerpt_form_alter($form_id, &$form) {
+  if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
+    $form['workflow']['excerpt'] = array(
+      '#type' => 'radios',
+      '#title' => t('Teaser'),
+      '#default_value' => variable_get('excerpt_'. $form['#node_type']->type, 1),
+        '#options' => array(t('Auto-generated'), t('Manual excerpt')),
+        '#description' => t('Choose whether the node teaser must be generated automatically or manually entered by the author.')
+    );
+  }
+
   if (isset($form['type'])) {
     $node = $form['#node'];
-    
-    if ($form['type']['#value'] .'_node_settings' == $form_id) {
-      $form['excerpt'] = array('#type' => 'fieldset', '#title' => t('Excerpt'));
-      $form['excerpt']['excerpt_options_'. $form['type']['#value']] = array(
-        '#type' => 'radios',
-        '#title' => t('Teasers'),
-        '#default_value' => variable_get('excerpt_options_'. $form['type']['#value'], 1),
-        '#options' => array(t('Auto-generated'), t('Manual excerpt')),
-        '#description' => t('Choose whether teasers are generated automatically or can be entered manually by the author.')
-      );
-    }
-    
-    if ($form['type']['#value'] .'_node_form' == $form_id && variable_get('excerpt_options_'. $node->type, 1)) {
+    if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("excerpt_$node->type", TRUE)) {
       $form['teaser'] = array(
         '#type' => 'textarea',
         '#title' => t('Teaser'),
@@ -49,6 +39,5 @@
         '#description' => t('Enter an excerpt for this item. It will be shown on listing pages along with a <em>read more</em> link which leads to the full view. Leave empty to auto-generate one from the body.')
       );
     }
-  
   }
 }
\ No newline at end of file
