Index: trunk/extensions/PageTriage/api/ApiQueryPageTriage.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | $userId = $context->getUser()->getId(); |
41 | 41 | |
42 | 42 | $params = $this->extractRequestParams(); |
43 | | - $action = $params['action']; |
| 43 | + $mode = $params['mode']; |
44 | 44 | |
45 | 45 | if( !preg_match('/^\D+$/', $params['id'] ) ) { |
46 | 46 | $this->dieUsageMsg( array( 'pagetriage-api-invalidid', $params['id'] ) ); |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | |
59 | 59 | $res = $this->getResult(); |
60 | 60 | |
61 | | - if( $action === 'checkout' ) { |
| 61 | + if( $mode === 'checkout' ) { |
62 | 62 | // the unique index on ptc_recentchanges_id ensures that this will fail if there's an existing row. |
63 | 63 | // doing it this way allows for atomic checking w/o starting a transaction. |
64 | 64 | // |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } else { |
84 | 84 | $res->addValue( 'pagetriage', 'result', 'already-checked-out' ); |
85 | 85 | } |
86 | | - } elseif ( $action === 'checkin' ) { |
| 86 | + } elseif ( $mode === 'checkin' ) { |
87 | 87 | // delete this user's row, if any. |
88 | 88 | $dbw->delete( |
89 | 89 | 'pagetriage_checkouts', |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | 'id' => array( |
104 | 104 | ApiBase::PARAM_REQUIRED => true, |
105 | 105 | ), |
106 | | - 'action' => array( |
| 106 | + 'mode' => array( |
107 | 107 | ApiBase::PARAM_DFLT => 'checkout', |
108 | 108 | ApiBase::PARAM_ISMULTI => false, |
109 | 109 | ApiBase::PARAM_TYPE => array( |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | public function getParamDescription() { |
117 | 117 | return array( |
118 | 118 | 'id' => 'The ID of the recentchanges entry you\'d like to check out/in', |
119 | | - 'action' => 'What you\'d like to do', |
| 119 | + 'mode' => 'What you\'d like to do', |
120 | 120 | ); |
121 | 121 | } |
122 | 122 | |
— | — | @@ -125,8 +125,8 @@ |
126 | 126 | |
127 | 127 | public function getExamples() { |
128 | 128 | return array( |
129 | | - 'api.php?action=pagetriage&ptrid=12345', |
130 | | - 'api.php?action=pagetriage&ptrid=12345&action=checkin', |
| 129 | + 'api.php?action=pagetriage&id=12345', |
| 130 | + 'api.php?action=pagetriage&id=12345&mode=checkin', |
131 | 131 | ); |
132 | 132 | } |
133 | 133 | |
Index: trunk/extensions/PageTriage/PageTriage.php |
— | — | @@ -32,6 +32,11 @@ |
33 | 33 | $wgSpecialPages['PageTriageList'] = 'SpecialPageTriageList'; |
34 | 34 | $wgSpecialPageGroups['PageTriageList'] = 'changes'; |
35 | 35 | |
| 36 | +$wgAutoloadClasses['ApiWikiLove'] = $dir . 'api/ApiWikiLove.php'; |
| 37 | + |
| 38 | +// api modules |
| 39 | +$wgAPIModules['pagetriage'] = 'ApiQueryPageTriage'; |
| 40 | + |
36 | 41 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efPageTriageSchemaUpdates'; |
37 | 42 | |
38 | 43 | /** |