Index: poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.222
diff -u -r1.222 poll.module
--- poll.module	25 Dec 2006 09:48:42 -0000	1.222
+++ poll.module	6 Jun 2007 21:13:02 -0000
@@ -125,6 +125,14 @@
     '#default_value' => $node->title,
     '#weight' => -1
   );
+  $form['body_filter']['body'] = array(
+    '#type' => 'textarea',
+    '#title' => check_plain($type->body_label),
+    '#default_value' => $node->body,
+    '#rows' => 5,
+    '#description' => t('Optional description for this poll, e.g. details, motivation.')
+  );
+  $form['body_filter']['format'] = filter_form($node->format);
 
   if (isset($form_values)) {
     $choices = $form_values['choices'];
@@ -321,7 +329,8 @@
       'module' => 'poll',
       'description' => t("A poll is a multiple-choice question which visitors can vote on."),
       'title_label' => t('Question'),
-      'has_body' => FALSE,
+      'has_body' => TRUE,
+      'body_label' => t('Description'),
     )
   );
 }
@@ -364,6 +373,9 @@
  * Generates the voting form for a poll.
  */
 function poll_view_voting($node, $block) {
+  if (!empty($node->body)) {
+    $form['description'] = array('#value' => check_markup($node->body, $node->format, FALSE));
+  }
   if ($node->choice) {
     $list = array();
     foreach ($node->choice as $i => $choice) {
@@ -387,6 +399,11 @@
  */
 function theme_poll_view_voting($form) {
   $output .= '<div class="poll">';
+  if (isset($form['description'])) {
+    $output .= '<div class="description">';
+    $output .= drupal_render($form['description']);
+    $output .= '</div>';
+  }
   $output .= '  <div class="vote-form">';
   $output .= '    <div class="choices">';
   $output .= drupal_render($form['choice']);
@@ -415,15 +432,18 @@
     }
   }
 
-  $output .= theme('poll_results', check_plain($node->title), $poll_results, $total_votes, $node->links, $block, $node->nid, $node->vote);
+  $output .= theme('poll_results', check_plain($node->title), check_markup($node->body, $node->format, FALSE), $poll_results, $total_votes, $node->links, $block, $node->nid, $node->vote);
 
   return $output;
 }
 
-function theme_poll_results($title, $results, $votes, $links, $block, $nid, $vote) {
+function theme_poll_results($title, $description, $results, $votes, $links, $block, $nid, $vote) {
   if ($block) {
     $output .= '<div class="poll">';
     $output .= '<div class="title">'. $title .'</div>';
+    if (!empty($description)) {
+      $output .= '<div class="description">'. $description .'</div>';
+    }
     $output .= $results;
     $output .= '<div class="total">'. t('Total votes: %votes', array('%votes' => $votes)) .'</div>';
     $output .= '</div>';
@@ -431,6 +451,9 @@
   }
   else {
     $output .= '<div class="poll">';
+    if (!empty($description)) {
+      $output .= '<div class="description">'. $description .'</div>';
+    }
     $output .= $results;
     $output .= '<div class="total">'. t('Total votes: %votes', array('%votes' => $votes)) .'</div>';
     if (isset($vote) && $vote > -1 && user_access('cancel own vote')) {
