jenkins-bot has submitted this change and it was merged.
Change subject: Refactor some of the warning code for footer links.
......................................................................
Refactor some of the warning code for footer links.
Rather than assuming that the links are using certain messages, it
now retrieves the messages that are set for the skin template by
the SkinMobile class.
This makes the handling of the footer links more flexible and less
fragile.
Change-Id: I41e636911613ac1cade752618b219d7a3011ccdb
---
M includes/PageRenderingHooks.php
1 file changed, 6 insertions(+), 8 deletions(-)
Approvals:
Dr0ptp4kt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index 19dff29..1d6abf1 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -144,12 +144,10 @@
if ( $bannersSupported ) {
self::rewriteLangLinks( $template,
$title );
}
- self::addWarning( $template, 'mobile-license',
$title,
- wfMessage(
'mobile-frontend-footer-license' )->parse() );
- self::addWarning( $template, 'privacy', $title,
- $template->getSkin()->footerLink(
'mobile-frontend-privacy-link-text', 'privacypage' ) );
- self::addWarning( $template, 'terms-use',
$title,
- wfMessage(
'mobile-frontend-terms-use-text' )->parse() );
+ // Add warnings to footer links
+ self::addWarning( $template, 'mobile-license',
$title );
+ self::addWarning( $template, 'privacy', $title
);
+ self::addWarning( $template, 'terms-use',
$title );
}
}
return true;
@@ -777,9 +775,9 @@
* @param BaseTemplate $template
* @param string $templateValName The name of the template
* @param Title $title current page title
- * @param string $link The full link, usually parsed wikitext.
*/
- private static function addWarning( BaseTemplate $template,
$templateValName, Title $title, $link ) {
+ private static function addWarning( BaseTemplate $template,
$templateValName, Title $title ) {
+ $link = $template->get( $templateValName );
if ( preg_match( '/href=([\'"])(.*?)\1/', $link, $match ) ) {
$href = $match[2];
$ch0 = substr( $href, 0, 1 );
--
To view, visit https://gerrit.wikimedia.org/r/85391
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41e636911613ac1cade752618b219d7a3011ccdb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits