diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-06-08 20:11:11 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2001-06-08 20:11:11 +0000 |
commit | d41c4f23f16e12c05616761486f55481a9b38edf (patch) | |
tree | 3e7682750901ad59ff28a1974d225e3cc7bb1c34 /modules/poll/poll.module | |
parent | a37211cf82cd1c1b45b7f8420b018edefc56f3e8 (diff) | |
download | brdo-d41c4f23f16e12c05616761486f55481a9b38edf.tar.gz brdo-d41c4f23f16e12c05616761486f55481a9b38edf.tar.bz2 |
- Added "dirty" support for theming the poll-bars... uses $theme->pollfill and $theme->pollempty for now.
Diffstat (limited to 'modules/poll/poll.module')
-rw-r--r-- | modules/poll/poll.module | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 8f2c53465..f4caebe8c 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -91,9 +91,9 @@ function poll_help() { <?php } -function poll_graph($val) { +function poll_graph($val, $clrfill = "#000000", $clrempty = "#ffffff") { $p = round($val * 100); - return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: #000000;\"><span style=\"font-size: 4pt;\"> </span></td>" : "") . ($p < 100 ? "<td style=\"background-color: #ffffff;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\"> </span></td>":"") . "</tr></table>"; + return "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>" . ($p ? "<td width=\"" . $p . "%\" style=\"background-color: $clrfill;\"><span style=\"font-size: 4pt;\"> </span></td>" : "") . ($p < 100 ? "<td style=\"background-color: $clrempty;\" width=\"" . (100 - $p) . "%\"><span style=\"font-size: 4pt;\"> </span></td>":"") . "</tr></table>"; } function poll_view($node, $main = 0, $block = 0) { @@ -125,9 +125,9 @@ function poll_view($node, $main = 0, $block = 0) { foreach ($node->choice as $key => $value) { if ($value) { if ($block) { - $output .= (!$block ? "<br>" : "") . check_output($value) . "<br><table width=\"90%\" align=\"center\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"70%\" valign=\"middle\" align=\"left\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>"; + $output .= (!$block ? "<br>" : "") . check_output($value) . "<br><table width=\"90%\" align=\"center\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"70%\" valign=\"middle\" align=\"left\">" . poll_graph($node->chvotes[$key] / $node->maxvotes, $theme->pollfill, $theme->pollempty) . "</td><td align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>"; } else { - $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>"; + $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes, $theme->pollfill, $theme->pollempty) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>"; } } } @@ -279,4 +279,4 @@ function poll_user() { } } -?>
\ No newline at end of file +?> |