Jhobs has uploaded a new change for review.

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

Change subject: Custom interstitial button for non-js browsers
......................................................................

Custom interstitial button for non-js browsers

Support for allowing per-partner customization of an additional
button for non-javascript browsers.

Change-Id: I206c27db47364f906e8380ee8e75fd8d488ea349
---
M includes/ZeroSpecialPage.php
1 file changed, 28 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroBanner 
refs/changes/59/238659/1

diff --git a/includes/ZeroSpecialPage.php b/includes/ZeroSpecialPage.php
index a5ec05d..8fa75f1 100644
--- a/includes/ZeroSpecialPage.php
+++ b/includes/ZeroSpecialPage.php
@@ -284,7 +284,7 @@
                                        'class' => 'cancel inline zerobutton',
                                        'role' => 'button',
                                        'href' => $redir['from'] ),
-                               $this->msg( 'zero-go-back' )->parse() ) . '';
+                               $this->msg( 'cancel' )->parse() ) . '';
 
                $accept = Html::rawElement(
                                'a',
@@ -296,12 +296,37 @@
                                $this->msg( 'zero-accept' )->parse() );
 
                $lang = $this->getLanguage();
+               $customText = $config->partnerInfoText();
+               if ( array_key_exists( $lang->getCode(), $customText ) ) {
+                       $customText = $customText[$lang->getCode()];
+               } else {
+                       unset( $customText );
+               }
+               if ( isset( $customText ) ) {
+                       $custom = Html::rawElement(
+                               'a',
+                               array(
+                                       'class' => 'button zerobutton',
+                                       'role' => 'button',
+                                       'href' => $config->partnerInfoUrl(),
+                                       'target' => '_blank',
+                                       'tabindex' => '0' ),
+                               $customText );
+               }
                $divOpen = '<div class="button-bar button-bar-centered 
buttonBar zerobar">';
                $divClose = '</div>';
                if ( $lang->isRTL() ) {
-                       $buttons = $divOpen . $accept . ' ' . $reject . 
$divClose;
+                       if ( isset( $custom ) ) {
+                               $buttons = $divOpen . $accept . ' ' . $reject . 
' ' . $custom . $divClose;
+                       } else {
+                               $buttons = $divOpen . $accept . ' ' . $reject . 
$divClose;
+                       }
                } else {
-                       $buttons = $divOpen . $reject . ' ' . $accept . 
$divClose;
+                       if ( isset( $custom ) ) {
+                               $buttons = $divOpen . $custom . ' ' . $reject . 
' ' . $accept . $divClose;
+                       } else {
+                               $buttons = $divOpen . $reject . ' ' . $accept . 
$divClose;
+                       }
                }
                $dir = $lang->getDir();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I206c27db47364f906e8380ee8e75fd8d488ea349
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroBanner
Gerrit-Branch: master
Gerrit-Owner: Jhobs <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to