Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/239302
Change subject: More inline help for mixins
......................................................................
More inline help for mixins
Also adds help message support for the top-level mixin label.
Change-Id: I56fcb74f64ce9b181886391796105ecf2118c0f3
---
M CentralNotice.modules.php
M CentralNotice.php
M i18n/en.json
M i18n/qqq.json
M special/SpecialCentralNotice.php
5 files changed, 30 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice
refs/changes/02/239302/1
diff --git a/CentralNotice.modules.php b/CentralNotice.modules.php
index 1288f1b..4e37b1e 100644
--- a/CentralNotice.modules.php
+++ b/CentralNotice.modules.php
@@ -140,8 +140,11 @@
// Banner history logger
'centralnotice-banner-history-logger-rate',
+ 'centralnotice-banner-history-logger-rate-help',
'centralnotice-banner-history-logger-max-entry-age',
+ 'centralnotice-banner-history-logger-max-entry-age-help',
'centralnotice-banner-history-logger-max-entries',
+ 'centralnotice-banner-history-logger-max-entries-help',
// Legacy campaigns
'centralnotice-set-record-impression-sample-rate',
diff --git a/CentralNotice.php b/CentralNotice.php
index f7abdea..ddc4371 100644
--- a/CentralNotice.php
+++ b/CentralNotice.php
@@ -252,24 +252,29 @@
'bannerHistoryLogger' => array(
'module' => 'ext.centralNotice.bannerHistoryLogger',
'nameMsg' => 'centralnotice-banner-history-logger',
+ 'helpMsg' => 'centralnotice-banner-history-logger-help',
'parameters' => array(
'rate' => array(
'type' => 'float',
'labelMsg' =>
'centralnotice-banner-history-logger-rate',
+ 'helpMsg' =>
'centralnotice-banner-history-logger-rate-help',
),
'maxEntryAge' => array(
'type' => 'integer',
- 'labelMsg' =>
'centralnotice-banner-history-logger-max-entry-age'
+ 'labelMsg' =>
'centralnotice-banner-history-logger-max-entry-age',
+ 'helpMsg' =>
'centralnotice-banner-history-logger-max-entry-age-help'
),
'maxEntries' => array(
'type' => 'integer',
- 'labelMsg' =>
'centralnotice-banner-history-logger-max-entries'
+ 'labelMsg' =>
'centralnotice-banner-history-logger-max-entries',
+ 'helpMsg' =>
'centralnotice-banner-history-logger-max-entries-help'
)
)
),
'legacySupport' => array(
'module' => 'ext.centralNotice.legacySupport',
'nameMsg' => 'centralnotice-legacy-support',
+ 'helpMsg' => 'centralnotice-legacy-support-help',
'parameters' => array(
'setSRISampleRate' => array(
'type' => 'boolean',
diff --git a/i18n/en.json b/i18n/en.json
index d910250..af83729 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -259,10 +259,15 @@
"apihelp-query+centralnoticelogs-param-end": "End time of range
(optional).",
"apihelp-query+centralnoticelogs-example-1": "Show logs",
"centralnotice-banner-history-logger": "Banner history logger",
- "centralnotice-banner-history-logger-rate": "Sample rate (should be
between 0 and 1 inclusive)",
+ "centralnotice-banner-history-logger-help": "Track the sequence of
banners seen by readers, and occasionally send it back to the server.",
+ "centralnotice-banner-history-logger-rate": "Sample rate",
+ "centralnotice-banner-history-logger-rate-help": "Probability that data
will be sampled and sent back to the server. Decimal between 0 (never) and 1
(always).",
"centralnotice-banner-history-logger-max-entry-age": "Maximum age of
log entries (in days)",
+ "centralnotice-banner-history-logger-max-entry-age-help": "Log entries
older than this will be expired and will not be sent back to the server.",
"centralnotice-banner-history-logger-max-entries": "Maximum number of
entries to keep in log",
+ "centralnotice-banner-history-logger-max-entries-help": "If more
history is recorded before the log is sent to the server, the oldest items will
disappear.",
"centralnotice-legacy-support": "Legacy support",
+ "centralnotice-legacy-support-help": "Settings for compability with
older banners that rely on Special:RecordImpression or include javascript that
hides the banner.",
"centralnotice-set-record-impression-sample-rate": "Set sample rate for
Special:RecordImpression",
"centralnotice-custom-record-impression-sample-rate":
"Special:RecordImpression sample rate (should be between 0 and 1 inclusive)",
"centralnotice-banners-not-guaranteed-to-display": "Banners might not
display, as determined by in-banner JavaScript"
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6eb58b9..10089b8 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -282,10 +282,15 @@
"apihelp-query+centralnoticelogs-param-end":
"{{doc-apihelp-param|query+centralnoticelogs|end}}",
"apihelp-query+centralnoticelogs-example-1":
"{{doc-apihelp-example|query+centralnoticelogs}}",
"centralnotice-banner-history-logger": "Name of the banner history
logger campaign mixin, for adminsitration UI control",
+ "centralnotice-banner-history-logger-help": "Description of the banner
history feature",
"centralnotice-banner-history-logger-rate": "Label for the banner
history logger campaign mixin sample rate control in the administration UI",
+ "centralnotice-banner-history-logger-rate-help": "Help text for the
sample rate field",
"centralnotice-banner-history-logger-max-entry-age": "Label for the
banner history logger campaign mixin maximum entry age control in the
administration UI",
+ "centralnotice-banner-history-logger-max-entry-age-help": "Help text
for the log expiration age field",
"centralnotice-banner-history-logger-max-entries": "Label for the
banner history logger campaign mixin maximum number of log entries control in
the administration UI",
+ "centralnotice-banner-history-logger-max-entries-help": "Help text for
the maximum log size field",
"centralnotice-legacy-support": "Name of the legacy support campaign
mixin, for administration UI control",
+ "centralnotice-legacy-support-help": "Description of the legacy support
feature",
"centralnotice-set-record-impression-sample-rate": "Label for the
control to activate setting the sample rate for Special:RecordImpression, for
the legacy support campaign mixin",
"centralnotice-custom-record-impression-sample-rate": "Label for the
control to determine the sample rate for Special:RecordImpression, for the
legacy support campaign mixin",
"centralnotice-banners-not-guaranteed-to-display": "Label for the
control to indicate that banners might not display, for the legacy support
campaign mixin"
diff --git a/special/SpecialCentralNotice.php b/special/SpecialCentralNotice.php
index f6a7573..e8aae80 100644
--- a/special/SpecialCentralNotice.php
+++ b/special/SpecialCentralNotice.php
@@ -746,7 +746,8 @@
// Handle campaign-associated mixins
foreach ( $wgCentralNoticeCampaignMixins
- as $mixinName => $mixinDef ) {
+ as $mixinName => $mixinDef
+ ) {
$mixinControlName =
self::makeNoticeMixinControlName( $mixinName );
@@ -1046,6 +1047,13 @@
array( 'for' =>
$mixinControlName )
);
+ if ( !empty( $mixinDef['helpMsg'] ) ) {
+ $htmlOut .= Html::element(
'div',
+ array( 'class' =>
'htmlform-help' ),
+ $this->msg(
$mixinDef['helpMsg'] )->text()
+ );
+ }
+
$htmlOut .= Xml::closeElement( 'div' );
}
--
To view, visit https://gerrit.wikimedia.org/r/239302
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56fcb74f64ce9b181886391796105ecf2118c0f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits