Index: branches/js2-work/phase3/includes/api/ApiQueryAllmessages.php |
— | — | @@ -80,10 +80,15 @@ |
81 | 81 | if($skip && $message === $params['from']) |
82 | 82 | $skip = false; |
83 | 83 | if(!$skip) { |
84 | | - |
85 | 84 | $a = array( 'name' => $message ); |
86 | | - if( isset( $params['arg'] ) && count( $params['arg'] ) != 0 ){ |
87 | | - $msg = wfMsgExt( $message, array( 'parsemag' ), $params['arg'] ); |
| 85 | + if( isset( $params['args'] ) && count( $params['args'] ) != 0 ){ |
| 86 | + // Check if the parser is enabled: |
| 87 | + if( $params[ 'enableparser' ] ){ |
| 88 | + $msg = wfMsgExt( $message, array( 'parsemag' ), $params['args'] ); |
| 89 | + } else { |
| 90 | + $msgString = wfMsgGetKey( $message, true, false, false ); |
| 91 | + $msg = wfMsgReplaceArgs( $msgString, $params['args'] ); |
| 92 | + } |
88 | 93 | }else{ |
89 | 94 | $msg = wfMsgGetKey( $message, true, false, false ); |
90 | 95 | } |
— | — | @@ -123,7 +128,8 @@ |
124 | 129 | 'default' |
125 | 130 | ) |
126 | 131 | ), |
127 | | - 'arg' => array( |
| 132 | + 'enableparser' => false, |
| 133 | + 'args' => array( |
128 | 134 | ApiBase :: PARAM_ISMULTI => true |
129 | 135 | ), |
130 | 136 | 'filter' => array(), |
— | — | @@ -136,7 +142,10 @@ |
137 | 143 | return array ( |
138 | 144 | 'messages' => 'Which messages to output. "*" means all messages', |
139 | 145 | 'prop' => 'Which properties to get', |
140 | | - 'arg' => 'Arguments to be substituted into msg', |
| 146 | + 'enableparser' => 'Set to enable parser, will parses the wikitext of message \n' . |
| 147 | + 'Will substitute magic words, handle templates etc.', |
| 148 | + 'args' => 'Arguments to be substituted into message. \n' . |
| 149 | + 'Will replace $1, $2 with values. ( values are \'|\' separated )', |
141 | 150 | 'filter' => 'Return only messages that contain this string', |
142 | 151 | 'lang' => 'Return messages in this language', |
143 | 152 | 'from' => 'Return messages starting at this message', |