Index: trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | $this->getOutput()->addModules( 'ext.centralauth' ); |
29 | 29 | $this->getOutput()->addModuleStyles( 'ext.centralauth.noflash' ); |
30 | | - $this->addMergeMethodDescriptions(); |
| 30 | + $this->getOutput()->addJsConfigVars( 'wgMergeMethodDescriptions', $this->getMergeMethodDescriptions() ); |
31 | 31 | |
32 | 32 | $this->mUserName = |
33 | 33 | trim( |
— | — | @@ -701,15 +701,15 @@ |
702 | 702 | return $total; |
703 | 703 | } |
704 | 704 | |
705 | | - function addMergeMethodDescriptions() { |
706 | | - $js = "wgMergeMethodDescriptions = {\n"; |
| 705 | + function getMergeMethodDescriptions() { |
| 706 | + $mergeMethodDescriptions = array(); |
707 | 707 | foreach ( array( 'primary', 'new', 'empty', 'password', 'mail', 'admin', 'login' ) as $method ) { |
708 | | - $short = Xml::encodeJsVar( $this->getLanguage()->ucfirst( wfMsgHtml( "centralauth-merge-method-{$method}" ) ) ); |
709 | | - $desc = Xml::encodeJsVar( wfMsgWikiHtml( "centralauth-merge-method-{$method}-desc" ) ); |
710 | | - $js .= "\t'{$method}' : { 'short' : {$short}, 'desc' : {$desc} }\n"; |
| 708 | + $mergeMethodDescriptions[$method] = array( |
| 709 | + 'short' => $this->getLanguage()->ucfirst( wfMsgHtml( "centralauth-merge-method-{$method}" ) ), |
| 710 | + 'desc' => wfMsgWikiHtml( "centralauth-merge-method-{$method}-desc" ) |
| 711 | + ); |
711 | 712 | } |
712 | | - $js .= "}"; |
713 | | - $this->getOutput()->addInlineScript( $js ); |
| 713 | + return $mergeMethodDescriptions; |
714 | 714 | } |
715 | 715 | |
716 | 716 | /** |