Index: trunk/extensions/ApiSandbox/SpecialApiSandbox.php |
— | — | @@ -1,6 +1,10 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class SpecialApiSandbox extends SpecialPage { |
| 5 | + |
| 6 | + /** |
| 7 | + * @var ApiQuery |
| 8 | + */ |
5 | 9 | private $apiQuery; |
6 | 10 | /** |
7 | 11 | * Constructor |
— | — | @@ -49,6 +53,9 @@ |
50 | 54 | $out->addHTML( "\n</div>" ); # <div id="api-sandbox-content"> |
51 | 55 | } |
52 | 56 | |
| 57 | + /** |
| 58 | + * @return string |
| 59 | + */ |
53 | 60 | private function getInputs() { |
54 | 61 | global $wgEnableWriteAPI; |
55 | 62 | |
— | — | @@ -94,6 +101,10 @@ |
95 | 102 | return $s; |
96 | 103 | } |
97 | 104 | |
| 105 | + /** |
| 106 | + * @param $type string |
| 107 | + * @return array |
| 108 | + */ |
98 | 109 | private function getQueryModules( $type ) { |
99 | 110 | $res = array(); |
100 | 111 | $params = $this->apiQuery->getAllowedParams(); |
— | — | @@ -115,6 +126,12 @@ |
116 | 127 | return $res; |
117 | 128 | } |
118 | 129 | |
| 130 | + /** |
| 131 | + * @param $name string |
| 132 | + * @param $items array |
| 133 | + * @param $default bool |
| 134 | + * @return string |
| 135 | + */ |
119 | 136 | private static function getSelect( $name, $items, $default = false ) { |
120 | 137 | $s = Html::openElement( 'select', array( |
121 | 138 | 'class' => 'api-sandbox-input', |
— | — | @@ -144,11 +161,21 @@ |
145 | 162 | return $s; |
146 | 163 | } |
147 | 164 | |
| 165 | + /** |
| 166 | + * @param $value string |
| 167 | + * @param $text string |
| 168 | + * @param $attributes array |
| 169 | + * @return string |
| 170 | + */ |
148 | 171 | private static function option( $value, $text, $attributes = array() ) { |
149 | 172 | $attributes['value'] = $value; |
150 | 173 | return Html::element( 'option', $attributes, $text ); |
151 | 174 | } |
152 | 175 | |
| 176 | + /** |
| 177 | + * @param $name string |
| 178 | + * @return string |
| 179 | + */ |
153 | 180 | private function openFieldset( $name ) { |
154 | 181 | return "\n" . Html::openElement( 'fieldset', array( 'id' => "api-sandbox-$name" ) ) |
155 | 182 | . "\n\t" . Html::rawElement( 'legend', array(), wfMessage( "apisb-$name" )->parse() ) |
— | — | @@ -157,6 +184,8 @@ |
158 | 185 | |
159 | 186 | /** |
160 | 187 | * Callback that returns false if its argument (format name) ends with 'fm' |
| 188 | + * |
| 189 | + * @param $value string |
161 | 190 | * @return boolean |
162 | 191 | */ |
163 | 192 | private static function filterFormats( $value ) { |