? excerpt.drupal-5.patch.txt ? excerpt.info 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 14 Nov 2006 07:33:48 -0000 @@ -1,15 +1,6 @@ If you want users to be able to enter separate excerpts for nodes, check the excerpt box in the appropriate column.

'); - } -} - function excerpt_nodeapi(&$node, $op, $arg) { switch ($op) { case 'validate': @@ -24,31 +15,25 @@ } function excerpt_form_alter($form_id, &$form) { - 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)) { - $form['teaser'] = array( - '#type' => 'textarea', - '#title' => t('Teaser'), - '#default_value' => $node->teaser, - '#cols' => 60, - '#rows' => 5, - '#weight' => -17.5, - '#description' => t('Enter an excerpt for this item. It will be shown on listing pages along with a read more link which leads to the full view. Leave empty to auto-generate one from the body.') - ); - } - + if ('node_type_form' == $form_id) { + $form['excerpt'] = array('#type' => 'fieldset', '#weight' => 0, '#title' => t('Excerpt')); + $form['excerpt']['excerpt_options'] = array( + '#type' => 'radios', + '#title' => t('Teasers'), + '#default_value' => variable_get('excerpt_options_'. $form['old_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.') + ); } -} \ No newline at end of file + if ($form['type']['#value'] .'_node_form' == $form_id && variable_get('excerpt_options_'. $node->type, 1)) { + $form['teaser'] = array( + '#type' => 'textarea', + '#title' => t('Teaser'), + '#default_value' => $form['#node']->teaser, + '#cols' => 60, + '#rows' => 5, + '#weight' => 0, + '#description' => t('Enter an excerpt for this item. It will be shown on listing pages along with a read more link which leads to the full view. Leave empty to auto-generate one from the body.') + ); + } +}