Anomie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/169209
Change subject: Supply jump-text when creating poll, and pass title message to
remote poll
......................................................................
Supply jump-text when creating poll, and pass title message to remote poll
Bug: 72574
Bug: 72575
Change-Id: Ib27e72a2f973e50e254949ddf562da2ca8b77c8b
---
M i18n/en.json
M i18n/qqq.json
M includes/pages/CreatePage.php
3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll
refs/changes/09/169209/1
diff --git a/i18n/en.json b/i18n/en.json
index 43038f6..2635c25 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -151,6 +151,7 @@
"securepoll-create-layout-election_dates": "Start on $1 (at 00:00 UTC)
and run for $2 day(s)",
"securepoll-create-label-election_disallow-change": "Prevent voters
from changing their votes",
"securepoll-create-label-election_return-url": "Return-to URL:",
+ "securepoll-create-label-election_jump-text": "Jump text:",
"securepoll-create-label-election_type": "Poll type:",
"securepoll-create-label-election_crypt": "Encryption:",
"securepoll-create-label-property_admins": "Admins:",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index cb7118a..46429cc 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -129,6 +129,7 @@
"securepoll-create-layout-election_dates": "Layout message for the date
range input on [[Special:SecurePoll/create]].\n\nParameters:\n* $1 - HTML for
the starting date control\n* $2 - HTML for the number-of-days control, cannot
be used for PLURAL\nSee also:\n*
{{msg-mw|Securepoll-htmlform-daterange-absolute-layout}}\n*
{{msg-mw|Securepoll-htmlform-daterange-relative-layout}}",
"securepoll-create-label-election_disallow-change": "Label for form
field on Special:SecurePoll/create.",
"securepoll-create-label-election_return-url": "Label for form field on
Special:SecurePoll/create.",
+ "securepoll-create-label-election_jump-text": "Label for form field on
Special:SecurePoll/create.",
"securepoll-create-label-election_type": "Label for form field on
Special:SecurePoll/create.",
"securepoll-create-label-election_crypt": "Label for form field on
Special:SecurePoll/create.",
"securepoll-create-label-property_admins": "Label for form field on
Special:SecurePoll/create.\n{{Identical|Admin}}",
diff --git a/includes/pages/CreatePage.php b/includes/pages/CreatePage.php
index 9ebe476..53242a0 100644
--- a/includes/pages/CreatePage.php
+++ b/includes/pages/CreatePage.php
@@ -154,6 +154,18 @@
'type' => 'url',
);
+ if ( isset( $formItems['property_wiki'] ) ) {
+ $formItems['jump-text'] = array(
+ 'label-message' =>
'securepoll-create-label-election_jump-text',
+ 'type' => 'text',
+ );
+ if ( $formItems['property_wiki']['type'] === 'select' )
{
+ $formItems['jump-text']['hide-if'] = array(
'===', 'property_wiki', wfWikiId() );
+ } else {
+ $formItems['jump-text']['hide-if'] = array(
'===', 'property_wiki-select', wfWikiId() );
+ }
+ }
+
$formItems[] = $layoutTableStart;
$formItems['election_type'] = array(
@@ -550,6 +562,7 @@
SecurePollContentHandler::getDataFromElection(
$this->election )
);
$p = &$data['properties'];
+ $m = &$data['messages'];
$startDate = new MWTimestamp( $data['startDate'] );
$endDate = new MWTimestamp( $data['endDate'] );
@@ -568,6 +581,7 @@
$endDate->diff( $startDate )->format( '%a' ),
),
'return-url' => isset( $p['return-url'] ) ?
$p['return-url'] : null,
+ 'jump-text' => isset( $m['jump-text'] ) ?
$m['jump-text'] : null,
'election_type' => "{$ballot}+{$tally}",
'election_crypt' => $crypt,
'disallow-change' => (bool)isset( $p['disallow-change']
) ? $p['disallow-change'] : null,
@@ -899,6 +913,7 @@
);
$this->messages[$this->lang][$eId] = array(
'title' => $formData['election_title'],
+ 'jump-text' => $formData['jump-text'],
);
$admins = $this->getAdminsList( $formData['property_admins'] );
@@ -924,6 +939,10 @@
$this->properties[$rId]['jump-url'] =
SpecialPage::getTitleFor( 'SecurePoll' )->getFullUrl();
$this->properties[$rId]['jump-id'] = $eId;
$this->properties[$rId]['admins'] = $admins;
+ $this->messages[$this->lang][$rId] = array(
+ 'title' => $formData['election_title'],
+ 'jump-text' => $formData['jump-text'],
+ );
}
$this->processFormData( $eId, $formData,
SecurePoll_Ballot::$ballotTypes[$ballot], 'election' );
--
To view, visit https://gerrit.wikimedia.org/r/169209
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib27e72a2f973e50e254949ddf562da2ca8b77c8b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits