r66843 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66842‎ | r66843 | r66844 >
Date:18:57, 24 May 2010
Author:dale
Status:deferred
Tags:
Comment:
fixed bug in stand alone message loading
Modified paths:
  • /branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php (modified) (history)
  • /branches/MwEmbedStandAlone/jsScriptLoader.php (modified) (history)
  • /branches/MwEmbedStandAlone/languages/mw.Language.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php
@@ -148,7 +148,7 @@
149149 if( !is_file( $msgFile ) ) {
150150 throw new MWException( "Missing msgFile: " . htmlspecialchars( $msgFile ) . "\n" );
151151 }
152 - require_once( $msgFile );
 152+ require( $msgFile );
153153 // Save some time by only including the current language in the cache:
154154 if( isset( $messages[ $langKey ] ) ) {
155155 $wgMessageCache = array_merge( $wgMessageCache, $messages[ $langKey ] );
Index: branches/MwEmbedStandAlone/languages/mw.Language.js
@@ -187,7 +187,10 @@
188188 * @param {Array} args An array of string or jquery objects to be swapped in
189189 * @return string
190190 */
191 - replaceStringArgs : function() {
 191+ replaceStringArgs : function() {
 192+ if( ! this.arguments ) {
 193+ return ;
 194+ }
192195 // Replace Values
193196 for ( var v = 0; v < this.arguments.length; v++ ) {
194197 if( typeof this.arguments[v] == 'undefined' ) {
Index: branches/MwEmbedStandAlone/jsScriptLoader.php
@@ -131,7 +131,7 @@
132132
133133 // Output the loaders js
134134 $loaderJS = jsClassLoader::getCombinedLoaderJs();
135 - // Transform the loader text to remove debug statments and
 135+ // Transform the loader text to remove debug statements and
136136 // update language msgs if any are present
137137 $this->output .= $this->transformScriptText( $loaderJS , 'mwEmbed');
138138
@@ -789,6 +789,7 @@
790790 /*
791791 * Transform script text with language key substitution
792792 * and clear out debug lines if present.
 793+ * @param {String} $scriptText Text string to be transformed
793794 */
794795 function transformScriptText( $scriptText , $moduleName){
795796 global $wgEnableScriptLocalization;
@@ -801,7 +802,6 @@
802803 if ( $wgEnableScriptLocalization ){
803804 // Get the mw.addMessage javascript from scriptText and moduleName
804805 $addMessageJs = $this->getAddMessagesFromScriptText( & $scriptText , $moduleName);
805 -
806806 //@@NOTE getAddMessagesFromClass could identify which mode we are in and we would not need to
807807 // try each of these search patterns in the same order as before.
808808
@@ -1033,7 +1033,7 @@
10341034 * @param {Array} $jmsg Associative array of message key -> message value pairs
10351035 * @param {String} $langCode Language code override
10361036 */
1037 - static public function updateMessageValues(& $messegeArray, $langCode = false){
 1037+ static public function updateMessageValues( & $messegeArray, $langCode = false ){
10381038 global $wgLang;
10391039 // Check the langCode
10401040 if(!$langCode && $wgLang) {

Status & tagging log