jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/345512 )

Change subject: BSFoundation: SkinTemplate - Added language_urls to 
personalInfo section
......................................................................


BSFoundation: SkinTemplate - Added language_urls to personalInfo section

* part of #5786

Change-Id: Ieaccccf1b0ce72b469d9db663adbc90f132b51e4
(cherry picked from commit b5d2f78f1113fa98ac3ffb8c873f525881aad5bd)
---
M includes/skins/BsBaseTemplate.php
1 file changed, 48 insertions(+), 0 deletions(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/BsBaseTemplate.php 
b/includes/skins/BsBaseTemplate.php
index 2c6aacb..97ff544 100644
--- a/includes/skins/BsBaseTemplate.php
+++ b/includes/skins/BsBaseTemplate.php
@@ -560,6 +560,53 @@
 
        protected function printPersonalInfo(&$aOut){
                $aOut[] = '<ul id="bs-personal-info">';
+
+               if( $this->data['language_urls'] ) {
+                       $iCountLinks = 1;
+                       foreach( $this->data['language_urls'] as $aLangLink ) {
+                               $aLangLink['class'] .= " 
bs-lang-flag-{$aLangLink['lang']}";
+                               $aOut[] = Html::rawElement( 'li', [
+                                               'id' => 
"pt-interlanguagelink-{$aLangLink['lang']}",
+                                               'class' => 
'pt-interlanguagelink',
+                                       ],
+                                       Html::element( 'a', $aLangLink, 
$aLangLink['text'] )
+                               );
+                               //only show up to 3 links
+                               if( $iCountLinks >= 3 ) {
+                                       break;
+                               }
+                               $iCountLinks++;
+                       }
+                       //if there is more than 3 links, show an additional 
more button with
+                       //all items included
+                       if( count( $this->data['language_urls'] ) > 
$iCountLinks ) {
+                               $aOut[] = Html::openElement( 'li', [
+                                       'id' => "pt-interlanguagelink-more",
+                                       'class' => 'pt-interlanguagelink-more',
+                               ]);
+                               $aOut[] = Html::element( 'a', [
+                                       'href' => '#',
+                                       'text' => 
wfMessage('otherlanguages')->plain(),
+                                       'class' => 
'pt-interlanguagelink-more-btn menuToggler',
+                                       'title' => 
wfMessage('otherlanguages')->plain(),
+                               ]);
+                               $aOut[] = Html::openElement( 'ul', [
+                                       'class' => 
'pt-interlanguagelink-more-list menu',
+                               ]);
+                               foreach( $this->data['language_urls'] as 
$aLangLink ) {
+                                       $aLangLink['class'] .=
+                                               " 
bs-lang-flag-{$aLangLink['lang']}";
+                                               $aOut[] = Html::rawElement( 
'li', [
+                                                       'class' => 
'pt-interlanguagelink-more-list-item',
+                                               ],
+                                               Html::element( 'a', $aLangLink, 
$aLangLink['text'] )
+                                       );
+                               }
+                               $aOut[] = Html::closeElement( 'ul' );
+                               $aOut[] = Html::closeElement( 'li' );
+                       }
+               }
+
                foreach( $this->data['bs_personal_info'] as $item ) {
                        $sActiveClass = $item['active'] ? 'active' : '';
                        $aOut[] = Html::rawElement(
@@ -578,6 +625,7 @@
                                )
                        );
                }
+
                $aOut[] = '</ul>';
                return true;
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieaccccf1b0ce72b469d9db663adbc90f132b51e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to