Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
cd19768b
Commit
cd19768b
authored
May 11, 2002
by
Steven Wittens
Browse files
Poll.module:
- Fixed edit form not defaulting to the correct amount of choices.
parent
30066738
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/poll.module
View file @
cd19768b
...
@@ -45,7 +45,7 @@ function poll_form(&$node, &$help, &$error) {
...
@@ -45,7 +45,7 @@ function poll_form(&$node, &$help, &$error) {
$_duration
=
array
(
0
=>
t
(
"Unlimited"
),
86400
=>
format_interval
(
86400
),
172800
=>
format_interval
(
172800
),
345600
=>
format_interval
(
345600
),
604800
=>
format_interval
(
604800
),
1209600
=>
format_interval
(
1209600
),
2419200
=>
format_interval
(
2419200
),
4838400
=>
format_interval
(
4838400
),
9676800
=>
format_interval
(
9676800
),
31536000
=>
format_interval
(
31536000
));
$_duration
=
array
(
0
=>
t
(
"Unlimited"
),
86400
=>
format_interval
(
86400
),
172800
=>
format_interval
(
172800
),
345600
=>
format_interval
(
345600
),
604800
=>
format_interval
(
604800
),
1209600
=>
format_interval
(
1209600
),
2419200
=>
format_interval
(
2419200
),
4838400
=>
format_interval
(
4838400
),
9676800
=>
format_interval
(
9676800
),
31536000
=>
format_interval
(
31536000
));
$_active
=
array
(
0
=>
t
(
"Closed"
),
1
=>
t
(
"Active"
));
$_active
=
array
(
0
=>
t
(
"Closed"
),
1
=>
t
(
"Active"
));
$node
->
choices
=
$node
->
choices
?
$node
->
choices
:
max
(
2
,
count
(
$node
->
choice
s
)
?
count
(
$node
->
choice
s
)
:
5
);
$node
->
choices
=
$node
->
choices
?
$node
->
choices
:
max
(
2
,
count
(
$node
->
choice
)
?
count
(
$node
->
choice
)
:
5
);
if
(
isset
(
$node
->
title
))
{
if
(
isset
(
$node
->
title
))
{
// Check for at least two options and validate amount of votes:
// Check for at least two options and validate amount of votes:
...
@@ -263,7 +263,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
...
@@ -263,7 +263,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
}
}
}
}
}
}
$output
.
=
"<br /><div align=
\"
center
\"
>Total votes: "
.
$votestotal
.
"</div>"
;
$output
.
=
"<br /><div align=
\"
center
\"
>Total votes: "
.
$votestotal
.
(
$block
?
"<br />"
.
$theme
->
links
(
link_node
(
$node
,
1
))
:
""
)
.
"</div>"
;
}
}
// Force the output on both the mainpage and elsewhere
// Force the output on both the mainpage and elsewhere
$node
->
body
=
$output
;
$node
->
body
=
$output
;
...
...
modules/poll/poll.module
View file @
cd19768b
...
@@ -45,7 +45,7 @@ function poll_form(&$node, &$help, &$error) {
...
@@ -45,7 +45,7 @@ function poll_form(&$node, &$help, &$error) {
$_duration
=
array
(
0
=>
t
(
"Unlimited"
),
86400
=>
format_interval
(
86400
),
172800
=>
format_interval
(
172800
),
345600
=>
format_interval
(
345600
),
604800
=>
format_interval
(
604800
),
1209600
=>
format_interval
(
1209600
),
2419200
=>
format_interval
(
2419200
),
4838400
=>
format_interval
(
4838400
),
9676800
=>
format_interval
(
9676800
),
31536000
=>
format_interval
(
31536000
));
$_duration
=
array
(
0
=>
t
(
"Unlimited"
),
86400
=>
format_interval
(
86400
),
172800
=>
format_interval
(
172800
),
345600
=>
format_interval
(
345600
),
604800
=>
format_interval
(
604800
),
1209600
=>
format_interval
(
1209600
),
2419200
=>
format_interval
(
2419200
),
4838400
=>
format_interval
(
4838400
),
9676800
=>
format_interval
(
9676800
),
31536000
=>
format_interval
(
31536000
));
$_active
=
array
(
0
=>
t
(
"Closed"
),
1
=>
t
(
"Active"
));
$_active
=
array
(
0
=>
t
(
"Closed"
),
1
=>
t
(
"Active"
));
$node
->
choices
=
$node
->
choices
?
$node
->
choices
:
max
(
2
,
count
(
$node
->
choice
s
)
?
count
(
$node
->
choice
s
)
:
5
);
$node
->
choices
=
$node
->
choices
?
$node
->
choices
:
max
(
2
,
count
(
$node
->
choice
)
?
count
(
$node
->
choice
)
:
5
);
if
(
isset
(
$node
->
title
))
{
if
(
isset
(
$node
->
title
))
{
// Check for at least two options and validate amount of votes:
// Check for at least two options and validate amount of votes:
...
@@ -263,7 +263,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
...
@@ -263,7 +263,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
}
}
}
}
}
}
$output
.
=
"<br /><div align=
\"
center
\"
>Total votes: "
.
$votestotal
.
"</div>"
;
$output
.
=
"<br /><div align=
\"
center
\"
>Total votes: "
.
$votestotal
.
(
$block
?
"<br />"
.
$theme
->
links
(
link_node
(
$node
,
1
))
:
""
)
.
"</div>"
;
}
}
// Force the output on both the mainpage and elsewhere
// Force the output on both the mainpage and elsewhere
$node
->
body
=
$output
;
$node
->
body
=
$output
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment