Index: trunk/extensions/Gadgets/ApiQueryGadgets.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | |
23 | 23 | class ApiQueryGadgets extends ApiQueryBase { |
24 | 24 | private $props, |
25 | | - $category, |
| 25 | + $categories, |
26 | 26 | $neededNames, |
27 | 27 | $listAllowed, |
28 | 28 | $listEnabled; |
— | — | @@ -48,6 +48,9 @@ |
49 | 49 | $this->applyList( $this->getList() ); |
50 | 50 | } |
51 | 51 | |
| 52 | + /** |
| 53 | + * @return array |
| 54 | + */ |
52 | 55 | private function getList() { |
53 | 56 | $gadgets = Gadget::loadStructuredList(); |
54 | 57 | |
— | — | @@ -88,7 +91,7 @@ |
89 | 92 | } |
90 | 93 | |
91 | 94 | /** |
92 | | - * |
| 95 | + * @return bool |
93 | 96 | */ |
94 | 97 | private function isNeeded( Gadget $gadget ) { |
95 | 98 | global $wgUser; |
— | — | @@ -97,7 +100,7 @@ |
98 | 101 | && ( !$this->listAllowed || $gadget->isAllowed( $wgUser ) ) |
99 | 102 | && ( !$this->listEnabled || $gadget->isEnabled( $wgUser ) ); |
100 | 103 | } |
101 | | - |
| 104 | + |
102 | 105 | private function fakeMetadata( Gadget $g ) { |
103 | 106 | return array( |
104 | 107 | 'settings' => array( |
— | — | @@ -124,9 +127,9 @@ |
125 | 128 | 'dependencies' => 'dependency', |
126 | 129 | 'messages' => 'message', |
127 | 130 | ); |
128 | | - |
| 131 | + |
129 | 132 | $result = $this->getResult(); |
130 | | - foreach ( $metadata as $type => &$data ) { |
| 133 | + foreach ( $metadata as &$data ) { |
131 | 134 | foreach ( $data as $key => &$value ) { |
132 | 135 | if ( is_array( $value ) ) { |
133 | 136 | $tag = isset( $tagNames[$key] ) ? $tagNames[$key] : $key; |