Index: trunk/phase3/skins/Vector.php |
— | — | @@ -540,7 +540,7 @@ |
541 | 541 | <div id="personal"> |
542 | 542 | <div class="buffer"> |
543 | 543 | <h5><?php $this->msg('personaltools') ?></h5> |
544 | | - <ul <?php echo $this->langAttributes() ?>> |
| 544 | + <ul <?php $this->html('userlangattributes') ?>> |
545 | 545 | <?php foreach($this->data['personal_urls'] as $key => $item): ?> |
546 | 546 | <li <?= $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li> |
547 | 547 | <?php endforeach; ?> |
— | — | @@ -553,7 +553,7 @@ |
554 | 554 | <!-- namespaces --> |
555 | 555 | <div id="namespaces"> |
556 | 556 | <h5><?php $this->msg('namespaces') ?></h5> |
557 | | - <ul <?php echo $this->langAttributes() ?>> |
| 557 | + <ul <?php $this->html('userlangattributes') ?>> |
558 | 558 | <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?> |
559 | 559 | <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
560 | 560 | <?php endforeach; ?> |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | <div id="variants"> |
567 | 567 | <h5><div class="icon"><span><?php $this->msg('variants') ?></span></div></h5> |
568 | 568 | <div class="menu"> |
569 | | - <ul <?php echo $this->langAttributes() ?>> |
| 569 | + <ul <?php $this->html('userlangattributes') ?>> |
570 | 570 | <?php foreach ($this->data['variant_urls'] as $key => $link ): ?> |
571 | 571 | <li<?php echo $link['attributes'] ?><?php if(!empty($link['class'])): ?> class="<?php echo htmlspecialchars($link['class']) ?>"<?php endif; ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
572 | 572 | <?php endforeach; ?> |
— | — | @@ -580,7 +580,7 @@ |
581 | 581 | <?php if ( count( $this->data['view_urls'] ) > 0 ): ?> |
582 | 582 | <div id="views"> |
583 | 583 | <h5><?php $this->msg('views') ?></h5> |
584 | | - <ul <?php echo $this->langAttributes() ?>> |
| 584 | + <ul <?php $this->html('userlangattributes') ?>> |
585 | 585 | <?php foreach ($this->data['view_urls'] as $key => $link ): ?> |
586 | 586 | <li<?php echo $link['attributes'] ?><?php if(!empty($link['class'])): ?> class="<?php echo htmlspecialchars($link['class']) ?>"<?php endif; ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
587 | 587 | <?php endforeach; ?> |
— | — | @@ -593,7 +593,7 @@ |
594 | 594 | <div id="actions"> |
595 | 595 | <h5><div class="icon"><span><?php $this->msg('actions') ?></span></div></h5> |
596 | 596 | <div class="menu"> |
597 | | - <ul <?php echo $this->langAttributes() ?>> |
| 597 | + <ul <?php $this->html('userlangattributes') ?>> |
598 | 598 | <?php foreach ($this->data['action_urls'] as $key => $link ): ?> |
599 | 599 | <li<?php echo $link['attributes'] ?><?php if(!empty($link['class'])): ?> class="<?php echo htmlspecialchars($link['class']) ?>"<?php endif; ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
600 | 600 | <?php endforeach; ?> |
— | — | @@ -605,7 +605,7 @@ |
606 | 606 | <!-- search --> |
607 | 607 | <div id="search"> |
608 | 608 | <div class="buffer"> |
609 | | - <h5 <?php echo $this->langAttributes() ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> |
| 609 | + <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> |
610 | 610 | <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> |
611 | 611 | <div> |
612 | 612 | <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> |
— | — | @@ -710,7 +710,7 @@ |
711 | 711 | private function toolBox() { |
712 | 712 | ?> |
713 | 713 | <div class="portal" id="p-tb"> |
714 | | - <h5 <?php echo $this->langAttributes() ?>><?php $this->msg( 'toolbox' ) ?></h5> |
| 714 | + <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5> |
715 | 715 | <div class="body"> |
716 | 716 | <ul> |
717 | 717 | <?php if( $this->data['notspecialpage'] ): ?> |
— | — | @@ -757,7 +757,7 @@ |
758 | 758 | if( $this->data['language_urls'] ) { |
759 | 759 | ?> |
760 | 760 | <div class="portal" id="p-lang"> |
761 | | - <h5 <?php echo $this->langAttributes() ?>><?php $this->msg( 'otherlanguages' ) ?></h5> |
| 761 | + <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5> |
762 | 762 | <div class="body"> |
763 | 763 | <ul> |
764 | 764 | <?php foreach ( $this->data['language_urls'] as $langlink ): ?> |
— | — | @@ -778,7 +778,7 @@ |
779 | 779 | private function customBox( $bar, $content ) { |
780 | 780 | ?> |
781 | 781 | <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $bar ) ?>> |
782 | | - <h5 <?php echo $this->langAttributes() ?>><?php $out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out ) ) echo htmlspecialchars( $bar ); else echo htmlspecialchars( $out ); ?></h5> |
| 782 | + <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out ) ) echo htmlspecialchars( $bar ); else echo htmlspecialchars( $out ); ?></h5> |
783 | 783 | <div class="body"> |
784 | 784 | <?php if ( is_array( $content ) ): ?> |
785 | 785 | <ul> |
— | — | @@ -793,12 +793,4 @@ |
794 | 794 | </div> |
795 | 795 | <?php |
796 | 796 | } |
797 | | - |
798 | | - /** |
799 | | - * Build attributes describing user language |
800 | | - * @return HTML and XML Language attributes |
801 | | - */ |
802 | | - private function langAttributes() { |
803 | | - return 'lang="' . $this->data['userlang'] . '" xml:lang="' . $this->data['userlang'] . '"'; |
804 | | - } |
805 | 797 | } |
Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | <div id="p-cactions" class="portlet"> |
137 | 137 | <h5><?php $this->msg('views') ?></h5> |
138 | 138 | <div class="pBody"> |
139 | | - <ul <?php echo $this->langAttributes() ?>> |
| 139 | + <ul <?php $this->html('userlangattributes') ?>> |
140 | 140 | <?php foreach($this->data['content_actions'] as $key => $tab) { |
141 | 141 | echo ' |
142 | 142 | <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"'; |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | <div class="portlet" id="p-personal"> |
165 | 165 | <h5><?php $this->msg('personaltools') ?></h5> |
166 | 166 | <div class="pBody"> |
167 | | - <ul <?php echo $this->langAttributes() ?>> |
| 167 | + <ul <?php $this->html('userlangattributes') ?>> |
168 | 168 | <?php foreach($this->data['personal_urls'] as $key => $item) { ?> |
169 | 169 | <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php |
170 | 170 | if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | global $wgUseTwoButtonsSearchForm; |
254 | 254 | ?> |
255 | 255 | <div id="p-search" class="portlet"> |
256 | | - <h5 <?php echo $this->langAttributes() ?>><label for="searchInput"><?php $this->msg('search') ?></label></h5> |
| 256 | + <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg('search') ?></label></h5> |
257 | 257 | <div id="searchBody" class="pBody"> |
258 | 258 | <form action="<?php $this->text('wgScript') ?>" id="searchform"><div> |
259 | 259 | <input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/> |
— | — | @@ -274,7 +274,7 @@ |
275 | 275 | function toolbox() { |
276 | 276 | ?> |
277 | 277 | <div class="portlet" id="p-tb"> |
278 | | - <h5 <?php echo $this->langAttributes() ?>><?php $this->msg('toolbox') ?></h5> |
| 278 | + <h5 <?php $this->html('userlangattributes')?>><?php $this->msg('toolbox') ?></h5> |
279 | 279 | <div class="pBody"> |
280 | 280 | <ul> |
281 | 281 | <?php |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | if( $this->data['language_urls'] ) { |
337 | 337 | ?> |
338 | 338 | <div id="p-lang" class="portlet"> |
339 | | - <h5 <?php echo $this->langAttributes() ?>><?php $this->msg('otherlanguages') ?></h5> |
| 339 | + <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5> |
340 | 340 | <div class="pBody"> |
341 | 341 | <ul> |
342 | 342 | <?php foreach($this->data['language_urls'] as $langlink) { ?> |
— | — | @@ -353,7 +353,7 @@ |
354 | 354 | function customBox( $bar, $cont ) { |
355 | 355 | ?> |
356 | 356 | <div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>> |
357 | | - <h5 <?php echo $this->langAttributes() ?>><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5> |
| 357 | + <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5> |
358 | 358 | <div class='pBody'> |
359 | 359 | <?php if ( is_array( $cont ) ) { ?> |
360 | 360 | <ul> |
— | — | @@ -372,11 +372,6 @@ |
373 | 373 | </div> |
374 | 374 | <?php |
375 | 375 | } |
376 | | - |
377 | | - private function langAttributes() { |
378 | | - $languageCode = $this->data['userlang']; |
379 | | - return 'lang="' . $languageCode . '" xml:lang="' . $languageCode . '"'; |
380 | | - } |
381 | 376 | } // end of class |
382 | 377 | |
383 | 378 | |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -276,6 +276,7 @@ |
277 | 277 | $tpl->setRef( 'userpage', $this->userpage ); |
278 | 278 | $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] ); |
279 | 279 | $tpl->set( 'userlang', $wgLang->getCode() ); |
| 280 | + $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '"' ); |
280 | 281 | $tpl->set( 'pagecss', $this->setupPageCss() ); |
281 | 282 | $tpl->setRef( 'usercss', $this->usercss ); |
282 | 283 | $tpl->setRef( 'userjs', $this->userjs ); |