You are here

function poll_teaser in Drupal 7

Same name and namespace in other branches
  1. 4 modules/poll.module \poll_teaser()
  2. 5 modules/poll/poll.module \poll_teaser()
  3. 6 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
Form submit handler for node_form().

File

modules/poll/poll.module, line 688
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 $choice) {
      if ($choice['chtext'] != '') {
        $teaser .= '* ' . check_plain($choice['chtext']) . "\n";
      }
    }
  }
  return $teaser;
}