You are here

function poll_teaser in Drupal 6

Same name and namespace in other branches
  1. 4 modules/poll.module \poll_teaser()
  2. 5 modules/poll/poll.module \poll_teaser()
  3. 7 modules/poll/poll.module \poll_teaser()

Creates a simple teaser that lists all the choices.

This is primarily used for RSS.

1 call to poll_teaser()
poll_node_form_submit in modules/poll/poll.module
Renumbers fields and creates a teaser when a poll node is submitted.

File

modules/poll/poll.module, line 525
Enables your site to capture votes on different topics in the form of multiple choice questions.

Code

function poll_teaser($node) {
  $teaser = NULL;
  if (is_array($node->choice)) {
    foreach ($node->choice as $k => $choice) {
      if ($choice['chtext'] != '') {
        $teaser .= '* ' . check_plain($choice['chtext']) . "\n";
      }
    }
  }
  return $teaser;
}