From 34b51897d2bbc63864934d9af17d00de03f8c535 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 30 May 2003 21:40:41 +0000 Subject: - Better CSS for the poll module. --- modules/poll.module | 23 ++++++++++------------- modules/poll/poll.module | 23 ++++++++++------------- 2 files changed, 20 insertions(+), 26 deletions(-) (limited to 'modules') diff --git a/modules/poll.module b/modules/poll.module index d0a617d6b..d58dae7f2 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -293,28 +293,25 @@ function poll_view_results(&$node, $main, $block, $links) { $votesmax = max($votesmax, 1); } - /* - ** Define CSS classes for the bars - ** (note: style is not allowed outside , but the alternative is very - ** ugly and it seems to work in all browsers) - */ - + // Output the divs for the text, bars and percentages + $output .= "
"; if ($node->choice) { foreach ($node->choice as $key => $value) { if ($value != "") { $width = round($node->chvotes[$key] * 100 / $votesmax); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); - - $output .= "
". filter($value) ."
"; - $output .= "
"; - $output .= "
"; - $output .= "
$percentage%". (!$block ? " (". format_plural($node->chvotes[$key], "1 vote", "%count votes") .")" : "") ."
"; + $output .= "
". filter($value) ."
"; + $output .= "
"; + $output .= "
"; + $output .= "
"; + $output .= "
"; + $output .= "
$percentage%". (!$block ? " (". format_plural($node->chvotes[$key], "1 vote", "%count votes") .")" : "") ."
"; } } } - $output .= "
". t("Total votes") .": $votestotal"; + $output .= "
". t("Total votes") .": $votestotal
"; - $output .= ($block ? "
". theme("links", $links) : "") ."
"; + $output .= ($block ? "
". theme("links", $links) ."
" : "") ."
"; return $output; } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index d0a617d6b..d58dae7f2 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -293,28 +293,25 @@ function poll_view_results(&$node, $main, $block, $links) { $votesmax = max($votesmax, 1); } - /* - ** Define CSS classes for the bars - ** (note: style is not allowed outside , but the alternative is very - ** ugly and it seems to work in all browsers) - */ - + // Output the divs for the text, bars and percentages + $output .= "
"; if ($node->choice) { foreach ($node->choice as $key => $value) { if ($value != "") { $width = round($node->chvotes[$key] * 100 / $votesmax); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); - - $output .= "
". filter($value) ."
"; - $output .= "
"; - $output .= "
"; - $output .= "
$percentage%". (!$block ? " (". format_plural($node->chvotes[$key], "1 vote", "%count votes") .")" : "") ."
"; + $output .= "
". filter($value) ."
"; + $output .= "
"; + $output .= "
"; + $output .= "
"; + $output .= "
"; + $output .= "
$percentage%". (!$block ? " (". format_plural($node->chvotes[$key], "1 vote", "%count votes") .")" : "") ."
"; } } } - $output .= "
". t("Total votes") .": $votestotal"; + $output .= "
". t("Total votes") .": $votestotal
"; - $output .= ($block ? "
". theme("links", $links) : "") ."
"; + $output .= ($block ? "
". theme("links", $links) ."
" : "") ."
"; return $output; } -- cgit v1.2.3