Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242602

Change subject: Support multiple license links in footer
......................................................................

Support multiple license links in footer

The existing MobileLicenseLink hook allows the registration of only one
license URL. This generalises it to support one than one URL, which might
be applicable on projects like Wikidata where license differs depending on
namespace.

Guidance of how this can be used is provided here:
https://gist.github.com/jdlrobson/3cc0b7254de7de508d01

Change-Id: I9e625a0724df81a02ccef3b36bfa4949d667ac29
---
M includes/skins/SkinMinerva.php
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/02/242602/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 901c498..8f7e358 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -1233,8 +1233,9 @@
                // Generate the licensing text displayed in the footer of each 
page.
                // See Skin::getCopyright for desktop equivalent.
                $license = self::getLicense( 'footer' );
-               if ( isset( $license['link'] ) && $license['link'] ) {
-                       $licenseText = $this->msg( 'mobile-frontend-copyright' 
)->rawParams( $license['link'] )->text();
+               if ( isset( $license['args'] ) && $license['args'] ) {
+                       $licenseText = call_user_func_array( array( $this->msg( 
'mobile-frontend-copyright' ), 'rawParams' ),
+                               $license['args'] )->text();
                } else {
                        $licenseText = '';
                }
@@ -1297,7 +1298,8 @@
                }
 
                // Allow other extensions (for example, WikimediaMessages) to 
override
-               Hooks::run( 'MobileLicenseLink', array( &$link, $context, 
$attribs ) );
+               $args = array( $link );
+               Hooks::run( 'MobileLicenseLink', array( &$args, $context, 
$attribs ) );
 
                // for plural support we need the info, if there is one or more 
licenses used in the license text
                // this check if very simple and works on the base, that more 
than one license will
@@ -1311,7 +1313,7 @@
                );
 
                return array(
-                       'link' => $link,
+                       'args' => $args,
                        'plural' => $isPlural
                );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/242602
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e625a0724df81a02ccef3b36bfa4949d667ac29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to