Index: trunk/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -37,7 +37,8 @@ |
38 | 38 | |
39 | 39 | private $fld_protection = false, $fld_talkid = false, |
40 | 40 | $fld_subjectid = false, $fld_url = false, |
41 | | - $fld_readable = false, $fld_watched = false; |
| 41 | + $fld_readable = false, $fld_watched = false, |
| 42 | + $fld_preload = false; |
42 | 43 | |
43 | 44 | public function __construct( $query, $moduleName ) { |
44 | 45 | parent :: __construct( $query, $moduleName, 'in' ); |
— | — | @@ -200,6 +201,7 @@ |
201 | 202 | $this->fld_subjectid = isset( $prop['subjectid'] ); |
202 | 203 | $this->fld_url = isset( $prop['url'] ); |
203 | 204 | $this->fld_readable = isset( $prop['readable'] ); |
| 205 | + $this->fld_preload = isset ( $prop['preload'] ); |
204 | 206 | } |
205 | 207 | |
206 | 208 | $pageSet = $this->getPageSet(); |
— | — | @@ -321,6 +323,16 @@ |
322 | 324 | } |
323 | 325 | if ( $this->fld_readable && $title->userCanRead() ) |
324 | 326 | $pageInfo['readable'] = ''; |
| 327 | + |
| 328 | + if ( $this->fld_preload ) { |
| 329 | + if ( $title->exists() ) |
| 330 | + $pageInfo['preload'] = ''; |
| 331 | + else { |
| 332 | + wfRunHooks( 'EditFormPreloadText', array( &$text, &$title ) ); |
| 333 | + |
| 334 | + $pageInfo['preload'] = $text; |
| 335 | + } |
| 336 | + } |
325 | 337 | return $pageInfo; |
326 | 338 | } |
327 | 339 | |
— | — | @@ -553,6 +565,7 @@ |
554 | 566 | 'subjectid', |
555 | 567 | 'url', |
556 | 568 | 'readable', |
| 569 | + 'preload' |
557 | 570 | ) ), |
558 | 571 | 'token' => array ( |
559 | 572 | ApiBase :: PARAM_DFLT => null, |
— | — | @@ -570,7 +583,10 @@ |
571 | 584 | ' protection - List the protection level of each page', |
572 | 585 | ' talkid - The page ID of the talk page for each non-talk page', |
573 | 586 | ' watched - List the watched status of each page', |
574 | | - ' subjectid - The page ID of the parent page for each talk page' |
| 587 | + ' subjectid - The page ID of the parent page for each talk page', |
| 588 | + ' url - Gives a full URL to the page, and also an edit URL', |
| 589 | + ' readable - Whether the user can read this page', |
| 590 | + ' preload - Gives the text returned by EditFormPreloadText' |
575 | 591 | ), |
576 | 592 | 'token' => 'Request a token to perform a data-modifying action on a page', |
577 | 593 | 'continue' => 'When more results are available, use this to continue', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -812,6 +812,7 @@ |
813 | 813 | * (bug 21922) YAML output should quote asterisk when used as key |
814 | 814 | * (bug 22297) safesubst: to allow substitution without breaking transclusion |
815 | 815 | * (bug 18758) API read of watchlist's wl_notificationtimestamp |
| 816 | +* (bug 20809) Expose EditFormPreloadText via the API |
816 | 817 | |
817 | 818 | === Languages updated in 1.16 === |
818 | 819 | |