/[drupal]/contributions/modules/excerpt/excerpt.module
ViewVC logotype

Diff of /contributions/modules/excerpt/excerpt.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5.2.1 by unconed, Sat Apr 23 03:37:45 2005 UTC revision 1.5.2.2 by hayesr, Wed Jan 2 03:37:30 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: excerpt.module,v 1.5 2005/04/23 03:37:00 unconed Exp $  // $Id: excerpt.module,v 1.5.2.1 2005/04/23 03:37:45 unconed Exp $
3    
4  function excerpt_help($section) {  function excerpt_help($section) {
5    switch ($section) {    switch ($section) {
# Line 16  function excerpt_nodeapi(&$node, $op, $a Line 16  function excerpt_nodeapi(&$node, $op, $a
16        return form_radios(t('Teasers'), "excerpt_$node->type", variable_get("excerpt_$node->type", 1), array(t('Auto-generated'), t('Manual excerpt')), t('Choose whether teasers are generated automatically or can be entered manually by the author.'));        return form_radios(t('Teasers'), "excerpt_$node->type", variable_get("excerpt_$node->type", 1), array(t('Auto-generated'), t('Manual excerpt')), t('Choose whether teasers are generated automatically or can be entered manually by the author.'));
17      case 'form post':      case 'form post':
18        if (variable_get("excerpt_$node->type", 1)) {        if (variable_get("excerpt_$node->type", 1)) {
19          $output = form_textarea(t('Excerpt'), 'teaser', $node->teaser, 60, 10, 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.'));          $teaser = ($node->teaser != node_teaser($node->body) ? $node->teaser : '');
20            $output = form_textarea(t('Excerpt'), 'teaser', $teaser, 60, 10, 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 automatically generate an excerpt from the body, or enter a space character to have no excerpt.'));
21        }        }
22        break;        break;
23      case 'validate':      case 'validate':
# Line 25  function excerpt_nodeapi(&$node, $op, $a Line 26  function excerpt_nodeapi(&$node, $op, $a
26        }        }
27        break;        break;
28      case 'view':      case 'view':
29        $node->readmore = $node->teaser !== $node->body;        if ($main) {
30            $node->readmore = check_output($node->teaser, $node->format) !== $node->body;
31          }
32          else {
33            $node->readmore = $node->teaser !== check_output($node->body, $node->format);
34          }
35        break;        break;
36    }    }
37    

Legend:
Removed from v.1.5.2.1  
changed lines
  Added in v.1.5.2.2

  ViewVC Help
Powered by ViewVC 1.1.3