summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2001-05-22 21:46:48 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2001-05-22 21:46:48 +0000
commit404cd22b3a52aa90bf982ae9e12c461f517ea8f9 (patch)
treeb4d627595fd02d7c5ac659bf8b87703313daf74b
parent54a4f06ce4b289b7ff6f9f24b283c5cadccf6382 (diff)
downloadbrdo-404cd22b3a52aa90bf982ae9e12c461f517ea8f9.tar.gz
brdo-404cd22b3a52aa90bf982ae9e12c461f517ea8f9.tar.bz2
Slight improvement to the "choiceboxes" thingie.
-rw-r--r--modules/poll.module2
-rw-r--r--modules/poll/poll.module2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/poll.module b/modules/poll.module
index 9385db811..e299cc2c7 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -163,7 +163,7 @@ function poll_form($edit = array(), $nocheck = 0) {
$admin = ($edit[nid] && user_access($user,"poll")) ? 1 : 0;
/* Mini-form for number of choiceboxes */
- $choices = $edit[choices]?$edit[choices]:5;
+ $choices = $edit[choices]?$edit[choices]:max(5,sizeof($edit[choice]));
for ($c = 2; $c <= 20; $c++) $opts[$c]=$c;
$form .= form_select(t("Number of choices"), "choices", $choices, $opts, t("This box specifies the number of choiceboxes in this form, it doesn't affect the actual amount of choices in the poll."));
$form .= form_submit(t("Refresh")) . "<br><br><br>";
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 9385db811..e299cc2c7 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -163,7 +163,7 @@ function poll_form($edit = array(), $nocheck = 0) {
$admin = ($edit[nid] && user_access($user,"poll")) ? 1 : 0;
/* Mini-form for number of choiceboxes */
- $choices = $edit[choices]?$edit[choices]:5;
+ $choices = $edit[choices]?$edit[choices]:max(5,sizeof($edit[choice]));
for ($c = 2; $c <= 20; $c++) $opts[$c]=$c;
$form .= form_select(t("Number of choices"), "choices", $choices, $opts, t("This box specifies the number of choiceboxes in this form, it doesn't affect the actual amount of choices in the poll."));
$form .= form_submit(t("Refresh")) . "<br><br><br>";