Index: trunk/extensions/Deployment/specials/SpecialExtensions.php |
— | — | @@ -84,8 +84,8 @@ |
85 | 85 | protected function getExtensionList() { |
86 | 86 | global $wgExtensionCredits; |
87 | 87 | |
88 | | - $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) . |
89 | | - Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) ); |
| 88 | + $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ); |
| 89 | + $out .= Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) ); |
90 | 90 | |
91 | 91 | $extensionTypes = SpecialVersion::getExtensionTypes(); |
92 | 92 | |
Index: trunk/extensions/Deployment/specials/SpecialInstall.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | $extensions = $this->findExtenions( $wgRequest->getText( 'filtertype' ), $wgRequest->getText( 'filtervalue' ) ); |
52 | 52 | |
53 | 53 | if ( count( $extensions ) > 0 ) { |
54 | | - $this->showExtensionList(); |
| 54 | + $this->showExtensionList( $extensions ); |
55 | 55 | } |
56 | 56 | else { |
57 | 57 | // TODO |
— | — | @@ -152,6 +152,7 @@ |
153 | 153 | |
154 | 154 | /** |
155 | 155 | * Show the extensions that where found in a list. |
| 156 | + * This method assumes it gets only called when there are more then 0 extensions. |
156 | 157 | * |
157 | 158 | * @since 0.1 |
158 | 159 | * |
— | — | @@ -160,15 +161,63 @@ |
161 | 162 | protected function showExtensionList( array $extensions ) { |
162 | 163 | global $wgOut; |
163 | 164 | |
164 | | - // TODO: this is just a debug mockup |
| 165 | + $listHtml = Html::openElement( |
| 166 | + 'table', |
| 167 | + array( 'class' => 'wikitable' ) |
| 168 | + ); |
165 | 169 | |
166 | | - $list = array(); |
| 170 | + $listHtml .= '<tr>' . |
| 171 | + Html::element( 'th', array(), wfMsg( 'extensionlist-name' ) ) . |
| 172 | + Html::element( 'th', array(), wfMsg( 'extensionlist-version' ) ) . |
| 173 | + Html::element( 'th', array(), wfMsg( 'extensionlist-stability' ) ) . |
| 174 | + Html::element( 'th', array(), wfMsg( 'extensionlist-description' ) ) |
| 175 | + . '</tr>'; |
167 | 176 | |
168 | 177 | foreach ( $extensions as $extension ) { |
169 | | - $list[] = $extension['name']; |
170 | | - } |
| 178 | + $listHtml .= $this->getExtensionForList( $extension ); |
| 179 | + } |
| 180 | + |
| 181 | + $listHtml .= Html::closeElement( 'table' ); |
171 | 182 | |
172 | | - $wgOut->addHTML( implode( ',', $list ) ); |
| 183 | + $wgOut->addHTML( $listHtml ); |
173 | 184 | } |
174 | 185 | |
| 186 | + /** |
| 187 | + * Creates and returns the html for a single extension in the list. |
| 188 | + * |
| 189 | + * @since 0.1 |
| 190 | + * |
| 191 | + * @param $extensions Object |
| 192 | + * |
| 193 | + * @return string |
| 194 | + */ |
| 195 | + protected function getExtensionForList( $extension ) { |
| 196 | + $html = '<tr>'; |
| 197 | + |
| 198 | + $html .= Html::rawElement( |
| 199 | + 'td', |
| 200 | + array(), |
| 201 | + Html::element( |
| 202 | + 'a', |
| 203 | + array( |
| 204 | + 'href' => $extension->url, |
| 205 | + 'class' => 'external text' |
| 206 | + ), |
| 207 | + $extension->name |
| 208 | + ) |
| 209 | + ); |
| 210 | + |
| 211 | + $html .= Html::element( 'td', array(), $extension->version ); |
| 212 | + $html .= Html::element( 'td', array(), 'Stable' ); // TODO |
| 213 | + |
| 214 | + $html .= Html::element( |
| 215 | + 'td', |
| 216 | + array(), |
| 217 | + $extension->description . ' ' . |
| 218 | + wfMsgExt( 'extensionlist-createdby', 'parsemag', $extension->authors ) |
| 219 | + ); |
| 220 | + |
| 221 | + return $html . '</tr>'; |
| 222 | + } |
| 223 | + |
175 | 224 | } |
\ No newline at end of file |
Index: trunk/extensions/Deployment/Deployment.i18n.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | 'extensionlist-details' => 'Details', |
62 | 62 | 'extensionlist-download' => 'Download', |
63 | 63 | 'extensionlist-installnow' => 'Install now', |
| 64 | + 'extensionlist-createdby' => 'By $1', |
64 | 65 | |
65 | 66 | 'stability-alpha' => 'Alpha', |
66 | 67 | 'stability-beta' => 'Beta', |
Index: trunk/extensions/Deployment/includes/DistributionRepository.php |
— | — | @@ -60,10 +60,9 @@ |
61 | 61 | $extensions = array(); |
62 | 62 | |
63 | 63 | if ( $response !== false ) { |
64 | | - $extensions = FormatJson::decode( $response ); |
| 64 | + $extensions = FormatJson::decode( $response )->query->extensions; |
65 | 65 | } |
66 | | - // TODO |
67 | | - var_dump($extensions);exit; |
| 66 | + |
68 | 67 | return $extensions; |
69 | 68 | } |
70 | 69 | |