summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-10-22 09:25:33 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-10-22 09:25:33 +0000
commit2cc43fffd40c1f47f23f41d520a8bdabab49d277 (patch)
tree632fe2e122f6426450d9a609c9774666f7601f1e
parentb94f2716cfc4d1e91304a5fbf7783486932fa8c1 (diff)
downloadbrdo-2cc43fffd40c1f47f23f41d520a8bdabab49d277.tar.gz
brdo-2cc43fffd40c1f47f23f41d520a8bdabab49d277.tar.bz2
#184198 by Eaton: move button title change in polls to the theme, so it does not interfere with the cached form
-rw-r--r--modules/poll/poll.module7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 64582d451..4833332c5 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -238,10 +238,6 @@ function poll_form(&$node, $form_state) {
),
);
- // If we're using the javascript version (99% use-case), change the button
- // title to 'Add another choice' to reflect the javascript behavior.
- drupal_add_js("if (Drupal.jsEnabled) { $(document).ready(function() { $('#edit-poll-more').val('". t('Add another choice') ."'); }); }", 'inline');
-
// Poll attributes
$_duration = array(0 => t('Unlimited')) + drupal_map_assoc(array(86400, 172800, 345600, 604800, 1209600, 2419200, 4838400, 9676800, 31536000), "format_interval");
$_active = array(0 => t('Closed'), 1 => t('Active'));
@@ -633,6 +629,9 @@ function poll_view_results(&$node, $teaser, $page, $block) {
* Theme the admin poll form for choices.
*/
function theme_poll_choices($form) {
+ // Change the button title to reflect the behavior when using JavaScript.
+ drupal_add_js('if (Drupal.jsEnabled) { $(document).ready(function() { $("#edit-poll-more").val("'. t('Add another choice') .'"); }); }', 'inline');
+
$rows = array();
$headers = array(
t('Choice'),