Commit e3f1c92d authored by Dries's avatar Dries
Browse files

- Patch #14936 by Goba:

   + The "add new comment" was missing for polls.

   + Renames $main to $teaser where appropriate to follow latest Drupal conventions.
parent aacfec0f
...@@ -299,7 +299,7 @@ function poll_teaser($node) { ...@@ -299,7 +299,7 @@ function poll_teaser($node) {
/** /**
* Generates the voting form for a poll. * Generates the voting form for a poll.
*/ */
function poll_view_voting(&$node, $main, $page, $block) { function poll_view_voting(&$node, $teaser, $page, $block) {
$output = '<div class="poll">'; $output = '<div class="poll">';
$form = '<div class="vote-form">'; $form = '<div class="vote-form">';
...@@ -324,7 +324,7 @@ function poll_view_voting(&$node, $main, $page, $block) { ...@@ -324,7 +324,7 @@ function poll_view_voting(&$node, $main, $page, $block) {
/** /**
* Generates a graphical representation of the results of a poll. * Generates a graphical representation of the results of a poll.
*/ */
function poll_view_results(&$node, $main, $page, $block) { function poll_view_results(&$node, $teaser, $page, $block) {
// Display the results // Display the results
// Count the votes and find the maximum // Count the votes and find the maximum
...@@ -415,10 +415,10 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) { ...@@ -415,10 +415,10 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
$output = ''; $output = '';
if ($node->allowvotes && ($block || arg(2) != 'results')) { if ($node->allowvotes && ($block || arg(2) != 'results')) {
$output .= poll_view_voting($node, $main, $page, $block); $output .= poll_view_voting($node, $teaser, $page, $block);
} }
else { else {
$output .= poll_view_results($node, $main, $page, $block); $output .= poll_view_results($node, $teaser, $page, $block);
} }
// Special display for side-block // Special display for side-block
...@@ -426,7 +426,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) { ...@@ -426,7 +426,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
// No 'read more' link // No 'read more' link
$node->body = $node->teaser = ''; $node->body = $node->teaser = '';
$links = module_invoke_all('link', 'node', $node, 0); $links = module_invoke_all('link', 'node', $node, 1);
$links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.'))); $links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.')));
if ($node->allowvotes && $block) { if ($node->allowvotes && $block) {
$links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.'))); $links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.')));
......
...@@ -299,7 +299,7 @@ function poll_teaser($node) { ...@@ -299,7 +299,7 @@ function poll_teaser($node) {
/** /**
* Generates the voting form for a poll. * Generates the voting form for a poll.
*/ */
function poll_view_voting(&$node, $main, $page, $block) { function poll_view_voting(&$node, $teaser, $page, $block) {
$output = '<div class="poll">'; $output = '<div class="poll">';
$form = '<div class="vote-form">'; $form = '<div class="vote-form">';
...@@ -324,7 +324,7 @@ function poll_view_voting(&$node, $main, $page, $block) { ...@@ -324,7 +324,7 @@ function poll_view_voting(&$node, $main, $page, $block) {
/** /**
* Generates a graphical representation of the results of a poll. * Generates a graphical representation of the results of a poll.
*/ */
function poll_view_results(&$node, $main, $page, $block) { function poll_view_results(&$node, $teaser, $page, $block) {
// Display the results // Display the results
// Count the votes and find the maximum // Count the votes and find the maximum
...@@ -415,10 +415,10 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) { ...@@ -415,10 +415,10 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
$output = ''; $output = '';
if ($node->allowvotes && ($block || arg(2) != 'results')) { if ($node->allowvotes && ($block || arg(2) != 'results')) {
$output .= poll_view_voting($node, $main, $page, $block); $output .= poll_view_voting($node, $teaser, $page, $block);
} }
else { else {
$output .= poll_view_results($node, $main, $page, $block); $output .= poll_view_results($node, $teaser, $page, $block);
} }
// Special display for side-block // Special display for side-block
...@@ -426,7 +426,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) { ...@@ -426,7 +426,7 @@ function poll_view(&$node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
// No 'read more' link // No 'read more' link
$node->body = $node->teaser = ''; $node->body = $node->teaser = '';
$links = module_invoke_all('link', 'node', $node, 0); $links = module_invoke_all('link', 'node', $node, 1);
$links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.'))); $links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.')));
if ($node->allowvotes && $block) { if ($node->allowvotes && $block) {
$links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.'))); $links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.')));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment