Sbisson has uploaded a new change for review. https://gerrit.wikimedia.org/r/230648
Change subject: [WIP] Beta feature Flow on user talk page ...................................................................... [WIP] Beta feature Flow on user talk page * Beta feature to enable flow on user talk page Bug: T98270 Change-Id: Ia9950c4eb1c0e5f912761a65c76c5a2b3b99c8ee --- M Flow.php M Hooks.php M defines.php M i18n/en.json M i18n/qqq.json A images/betafeature-flow-ltr.svg A images/betafeature-flow-rtl.svg 7 files changed, 263 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/48/230648/1 diff --git a/Flow.php b/Flow.php index cc92149..587dd9e 100644 --- a/Flow.php +++ b/Flow.php @@ -163,6 +163,10 @@ $wgHooks['EchoGetDefaultNotifiedUsers'][] = 'Flow\NotificationController::getDefaultNotifiedUsers'; $wgHooks['EchoGetBundleRules'][] = 'Flow\NotificationController::onEchoGetBundleRules'; +// Beta feature Flow on user talk page +$wgHooks['GetBetaFeaturePreferences'][] = 'FlowHooks::onGetBetaFeaturePreferences'; +$wgHooks['UserSaveOptions'][] = 'FlowHooks::onUserSaveOptions'; + // Extension initialization $wgExtensionFunctions[] = 'FlowHooks::initFlowExtension'; diff --git a/Hooks.php b/Hooks.php index 6720c1c..f4ca2a5 100644 --- a/Hooks.php +++ b/Hooks.php @@ -1601,4 +1601,46 @@ return false; } + + /** + * @param User $user + * @param array $prefs + */ + public static function onGetBetaFeaturePreferences( $user, &$prefs ) { + global $wgExtensionAssetsPath; + + $prefs[BETA_FEATURE_FLOW_USER_TALK_PAGE] = array( + // The first two are message keys + 'label-message' => 'flow-talk-page-beta-feature-message', + 'desc-message' => 'flow-talk-page-beta-feature-description', + 'screenshot' => array( + 'ltr' => "$wgExtensionAssetsPath/Flow/images/betafeature-flow-ltr.svg", + 'rtl' => "$wgExtensionAssetsPath/Flow/images/betafeature-flow-rtl.svg", + ), + 'info-link' => 'https://www.mediawiki.org/wiki/Extension:Flow', + 'discussion-link' => 'https://www.mediawiki.org/wiki/Extension_talk:Flow', + ); + } + + /** + * @param User $user + * @param array $options + * @return bool + */ + public static function onUserSaveOptions( $user, &$options ) { + if ( !array_key_exists( BETA_FEATURE_FLOW_USER_TALK_PAGE, $options ) ) { + return true; + } + + $before = BetaFeatures::isFeatureEnabled( $user, BETA_FEATURE_FLOW_USER_TALK_PAGE ); + $after = $options[BETA_FEATURE_FLOW_USER_TALK_PAGE]; + + if ( !$before && $after ) { + // enable Flow on user talk page + } elseif ( $before && !$after ) { + // restore wikitext talk page + } + + return true; + } } diff --git a/defines.php b/defines.php index 40381ec..72b0196 100644 --- a/defines.php +++ b/defines.php @@ -3,4 +3,5 @@ // Constants define( 'RC_FLOW', 142 ); // Random number chosen. Can be replaced with rc_source; see bug 72157. define( 'NS_TOPIC', 2600 ); -define( 'FLOW_TALK_PAGE_MANAGER_USER', 'Flow talk page manager' ); \ No newline at end of file +define( 'FLOW_TALK_PAGE_MANAGER_USER', 'Flow talk page manager' ); +define( 'BETA_FEATURE_FLOW_USER_TALK_PAGE', 'beta-feature-flow-user-talk-page' ); diff --git a/i18n/en.json b/i18n/en.json index 36203d3..6b6183c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -549,5 +549,7 @@ "flow-mark-revision-patrolled-link-title": "Mark this page as patrolled", "flow-mark-diff-patrolled-link-text": "Mark as patrolled", "flow-mark-diff-patrolled-link-title": "Mark as patrolled", - "flow-description-last-modified-at": "This description was last modified on $1, at $2." + "flow-description-last-modified-at": "This description was last modified on $1, at $2.", + "flow-talk-page-beta-feature-message": "User talk page discussion", + "flow-talk-page-beta-feature-description": "New discussion system for your user talk page. Simplify the collaboration with other editors. Existing content will remain available through an archive." } diff --git a/i18n/qqq.json b/i18n/qqq.json index 5aa0f8e..b3452e2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -556,5 +556,7 @@ "flow-mark-revision-patrolled-link-title": "Title of the link to mark a revision as patrolled on a revision page.", "flow-mark-diff-patrolled-link-text": "Text of the link to mark a revision as patrolled on a diff page.\n{{Identical|Mark as patrolled}}", "flow-mark-diff-patrolled-link-title": "Title of the link to mark a revision as patrolled on a diff page.\n{{Identical|Mark as patrolled}}", - "flow-description-last-modified-at": "Timestamp line stating when description was modified. See also {{msg-mw|lastmodifiedat}}. Parameters:\n* $1 - Date\n* $2 - Time" + "flow-description-last-modified-at": "Timestamp line stating when description was modified. See also {{msg-mw|lastmodifiedat}}. Parameters:\n* $1 - Date\n* $2 - Time", + "flow-talk-page-beta-feature-message": "Title of the beta feature to enable Flow on the user's talk page.", + "flow-talk-page-beta-feature-description": "Description of the beta feature to enable Flow on the user's talk page." } diff --git a/images/betafeature-flow-ltr.svg b/images/betafeature-flow-ltr.svg new file mode 100644 index 0000000..3dd4f66 --- /dev/null +++ b/images/betafeature-flow-ltr.svg @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="264" + height="162" + viewBox="0 0 264 162" + id="svg2"> + <metadata + id="metadata64"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs62" /> + <g + id="g4"> + <path + d="M 13.366,161.357 0.5,151.749 V 0.5 h 263 v 151.749 l -9,6.705 V 42.5 h -39 v 112.6 l -4.393,-3.731 -7.607,5.33 V 42.5 h -155 v 110.85 l -9.751,8.03 -13.916,-10.019 z" + id="path6" + style="fill:#ffffff" /> + <path + d="m 263,1 v 150.998 l -8,5.96 V 42 h -40 v 112.02 l -3.274,-2.781 -0.589,-0.498 -0.633,0.441 -6.504,4.556 V 42 H 48 v 111.1 l -9.257,7.66 -13.295,-9.57 -0.645,-0.463 -0.598,0.521 -10.864,9.47 L 1,151.499 V 1 h 262 m 1,-1 H 0 V 152 L 13.391,162 24.865,152 38.756,162 49,153.6 V 43 H 203 V 157.66 L 211.078,152 216,156.18 V 43 h 38 v 116.95 l 10,-7.45 V 0 z" + id="path8" + style="fill:#e5e5e5" /> + </g> + <path + d="M 203,157.66 V 43 H 49 v 110.6 l 2.145,-1.6 12.555,10 13.809,-10 14.229,10 12.972,-10 12.973,10 13.811,-10 12.136,10 13.391,-10 14.229,10 12.972,-10 12.974,10 5.804,-4.34 z" + id="path10" + style="fill:#e5e5e5" /> + <path + d="m 11,36 c 0,-7.732 6.268,-14 14,-14 7.732,0 14,6.268 14,14 0,7.732 -6.268,14 -14,14 -7.732,0 -14,-6.268 -14,-14 z" + id="path12" + style="fill:#e5e5e5" /> + <path + d="M 254,159.95 V 43 h -38 v 113.18 l 7.551,5.82 13.811,-10 13.891,10 2.747,-2.05 z" + id="path14" + style="fill:#e5e5e5" /> + <path + d="M 38,132.35366 V 72 H 13 v 60.35366 h 25 z" + id="path16" + style="fill:#e5e5e5" /> + <path + d="m 232.51,5 h 26 v 6 h -26 V 5 z" + id="path18" + style="fill:#e5e5e5" /> + <path + d="m 208.51,5 h 22 v 6 h -22 z" + id="path20" + style="fill:#e5e5e5" /> + <path + d="m 142,6 v 4 H 50 V 6 h 92 m 1,-1 H 49 v 6 h 94 V 5 z" + id="path22" + style="fill:#e5e5e5" /> + <path + d="m 184.51,5 h 22 v 6 h -22 z" + id="path24" + style="fill:#e5e5e5" /> + <path + d="m 161.51,5 h 13 v 6 h -13 z" + id="path26" + style="fill:#e5e5e5" /> + <path + d="m 176.51,5 h 6 v 6 h -6 z" + id="path28" + style="fill:#e5e5e5" /> + <path + d="m 153.51,5 h 6 v 6 h -6 z" + id="path30" + style="fill:#e5e5e5" /> + <path + d="m 9,5 h 32 v 6 H 9 z" + id="path32" + style="fill:#e5e5e5" /> + <path + d="M 2,14.5 H 262" + id="path34" + style="fill:#e5e5e5;stroke:#e5e5e5" /> + <path + d="m 52,7 h 2 v 2 h -2 z" + id="path36" + style="fill:#e5e5e5" /> + <path + d="M 38,59 V 54 H 13 v 5 h 25 z" + id="path38" + style="fill:#e5e5e5" /> + <path + d="M 163.04682,85.460252 V 124.6863 l 8.7169,8.7169 H 110.74543 V 85.460252 h 52.30139 z M 88.953179,63.668004 h 52.301391 v 17.433798 h -34.86759 v 30.509148 h -26.1507 l 8.716899,-8.7169 c 0,0 0,-39.226046 0,-39.226046 z" + id="path4059" + style="fill:#347bff;fill-opacity:1" /> +</svg> diff --git a/images/betafeature-flow-rtl.svg b/images/betafeature-flow-rtl.svg new file mode 100644 index 0000000..003f858 --- /dev/null +++ b/images/betafeature-flow-rtl.svg @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.1" + width="264" + height="162" + viewBox="0 0 264 162" + id="svg2"> + <metadata + id="metadata64"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs62" /> + <g + transform="matrix(-1,0,0,1,264,0)" + id="g4"> + <path + d="M 13.366,161.357 0.5,151.749 V 0.5 h 263 v 151.749 l -9,6.705 V 42.5 h -39 v 112.6 l -4.393,-3.731 -7.607,5.33 V 42.5 h -155 v 110.85 l -9.751,8.03 -13.916,-10.019 z" + id="path6" + style="fill:#ffffff" /> + <path + d="m 263,1 v 150.998 l -8,5.96 V 42 h -40 v 112.02 l -3.274,-2.781 -0.589,-0.498 -0.633,0.441 -6.504,4.556 V 42 H 48 v 111.1 l -9.257,7.66 -13.295,-9.57 -0.645,-0.463 -0.598,0.521 -10.864,9.47 L 1,151.499 V 1 h 262 m 1,-1 H 0 V 152 L 13.391,162 24.865,152 38.756,162 49,153.6 V 43 H 203 V 157.66 L 211.078,152 216,156.18 V 43 h 38 v 116.95 l 10,-7.45 V 0 z" + id="path8" + style="fill:#e5e5e5" /> + </g> + <path + d="M 61,157.66 V 43 H 215 V 153.6 L 212.855,152 200.3,162 186.491,152 172.262,162 159.29,152 146.317,162 132.506,152 120.37,162 106.979,152 92.75,162 79.778,152 66.804,162 61,157.66 z" + id="path10" + style="fill:#e5e5e5" /> + <path + d="m 253,36 c 0,-7.732 -6.268,-14 -14,-14 -7.732,0 -14,6.268 -14,14 0,7.732 6.268,14 14,14 7.732,0 14,-6.268 14,-14 z" + id="path12" + style="fill:#e5e5e5" /> + <path + d="M 10,159.95 V 43 H 48 V 156.18 L 40.449,162 26.638,152 12.747,162 10,159.95 z" + id="path14" + style="fill:#e5e5e5" /> + <path + d="M 226,132.35366 V 72 h 25 v 60.35366 h -25 z" + id="path16" + style="fill:#e5e5e5" /> + <path + d="m 31.49,5 h -26 v 6 h 26 V 5 z" + id="path18" + style="fill:#e5e5e5" /> + <path + d="m 55.49,5 h -22 v 6 h 22 z" + id="path20" + style="fill:#e5e5e5" /> + <path + d="m 122,6 v 4 h 92 V 6 h -92 m -1,-1 h 94 v 6 H 121 V 5 z" + id="path22" + style="fill:#e5e5e5" /> + <path + d="m 79.49,5 h -22 v 6 h 22 z" + id="path24" + style="fill:#e5e5e5" /> + <path + d="m 102.49,5 h -13 v 6 h 13 z" + id="path26" + style="fill:#e5e5e5" /> + <path + d="m 87.49,5 h -6 v 6 h 6 z" + id="path28" + style="fill:#e5e5e5" /> + <path + d="m 110.49,5 h -6 v 6 h 6 z" + id="path30" + style="fill:#e5e5e5" /> + <path + d="m 255,5 h -32 v 6 h 32 z" + id="path32" + style="fill:#e5e5e5" /> + <path + d="M 262,14.5 H 2" + id="path34" + style="fill:#e5e5e5;stroke:#e5e5e5" /> + <path + d="m 212,7 h -2 v 2 h 2 z" + id="path36" + style="fill:#e5e5e5" /> + <path + d="m 226,59 v -5 h 25 v 5 h -25 z" + id="path38" + style="fill:#e5e5e5" /> + <path + d="M 100.95318,85.460252 V 124.6863 l -8.7169,8.7169 h 61.01829 V 85.460252 h -52.30139 z m 74.09364,-21.792248 h -52.30139 v 17.433798 h 34.86759 v 30.509148 h 26.1507 l -8.7169,-8.7169 c 0,0 0,-39.226046 0,-39.226046 z" + id="path4059" + style="fill:#347bff;fill-opacity:1" /> +</svg> -- To view, visit https://gerrit.wikimedia.org/r/230648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9950c4eb1c0e5f912761a65c76c5a2b3b99c8ee Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Sbisson <sbis...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits