Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -136,10 +136,17 @@ |
137 | 137 | $result_array = array(); |
138 | 138 | if ( $params['redirects'] && !is_null( $redirValues ) ) |
139 | 139 | $result_array['redirects'] = $redirValues; |
| 140 | + |
140 | 141 | if ( isset( $prop['text'] ) ) { |
141 | 142 | $result_array['text'] = array(); |
142 | 143 | $result->setContent( $result_array['text'], $p_result->getText() ); |
143 | 144 | } |
| 145 | + |
| 146 | + if ( !is_null( $params['summary'] ) ) { |
| 147 | + $result_array['parsedsummary'] = array(); |
| 148 | + $result->setContent( $result_array['parsedsummary'], $wgUser->getSkin()->formatComment( $params['summary'], $titleObj ) ); |
| 149 | + } |
| 150 | + |
144 | 151 | if ( isset( $prop['langlinks'] ) ) |
145 | 152 | $result_array['langlinks'] = $this->formatLangLinks( $p_result->getLanguageLinks() ); |
146 | 153 | if ( isset( $prop['categories'] ) ) |
— | — | @@ -242,6 +249,7 @@ |
243 | 250 | ApiBase :: PARAM_DFLT => 'API', |
244 | 251 | ), |
245 | 252 | 'text' => null, |
| 253 | + 'summary' => null, |
246 | 254 | 'page' => null, |
247 | 255 | 'redirects' => false, |
248 | 256 | 'oldid' => null, |
— | — | @@ -270,6 +278,7 @@ |
271 | 279 | public function getParamDescription() { |
272 | 280 | return array ( |
273 | 281 | 'text' => 'Wikitext to parse', |
| 282 | + 'summary' => 'Summary to parse', |
274 | 283 | 'redirects' => 'If the page parameter is set to a redirect, resolve it', |
275 | 284 | 'title' => 'Title of page the text belongs to', |
276 | 285 | 'page' => 'Parse the content of this page. Cannot be used together with text and title', |