Yurik has uploaded a new change for review.
https://gerrit.wikimedia.org/r/68737
Change subject: Added default text of the zero config page
......................................................................
Added default text of the zero config page
Note that the page text is not a valid JSON,
and should be cleaned up before saving.
Change-Id: Ic56eb5b57094222d53eddcb75a3885cf2950fc9b
---
M includes/ZeroConfigContentHandler.php
1 file changed, 41 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess
refs/changes/37/68737/1
diff --git a/includes/ZeroConfigContentHandler.php
b/includes/ZeroConfigContentHandler.php
index 36e35c4..ac07917 100644
--- a/includes/ZeroConfigContentHandler.php
+++ b/includes/ZeroConfigContentHandler.php
@@ -40,6 +40,46 @@
* @return Content
*/
public function makeEmptyContent() {
- return new ZeroConfigContent( '' );
+ $default = <<<EOD
+{
+ "comment": "Full Company Name", // Optional
+ "enabled": // Optional, true by default
+ "sites": [
+ // Optional, a list of values such as "zero.wikipedia" and
"m.wikipedia"
+ // Both values are used by default
+ ],
+ "name": {
+ "en": "Company"
+ },
+ "banner": {
+ "en": "Free {{SITENAME}} access by $1",
+ },
+ "bannerUrl": "http://wikipedia.org", // optional
+ "showLangs": [
+ "en"
+ // required, which languages should be shown on the landing page.
+ // If only one language is listed, the landing page will be redirected
+ // to the Main Page, unless showZeroPage is set to override it.
+ ],
+ "whitelistedLangs": [
+ // Required but can be an empty list = ALL, or a list of languages:
"en", "ru", ...
+ ],
+ "langNameOverrides": {
+ "en": "Canadian" // Optional
+ }
+ "background": "#FFB612", // Optional, default = #E31230
+ "foreground": "#000000", // Optional, default = #551011
+ "fontSize": "0.9em", // Optional, skipped by default
+ "bannerWarning": false, // Optional, default = true
+ "showImages": false, // Optional, default = true
+ "showZeroPage": false, // Optional, default is count('showLangs') > 1 ?
true : false
+ "ips": [
+ // Neither of these two private CIDR ranges are legal
+ "192.168.0.0/16",
+ "10.0.0.0/8",
+ ]
+}
+EOD;
+ return new ZeroConfigContent( $default );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/68737
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic56eb5b57094222d53eddcb75a3885cf2950fc9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits