Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1224,6 +1224,9 @@ |
1225 | 1225 | 'SkinTemplateToolboxEnd': Called by SkinTemplate skins after toolbox links have been rendered (useful for adding more) |
1226 | 1226 | $tools: array of tools |
1227 | 1227 | |
| 1228 | +'SoftwareInfo': Called by Special:Version for returning information about the software |
| 1229 | +$software: The array of software in format 'name' => 'version'. See SpecialVersion::softwareInformation() |
| 1230 | + |
1228 | 1231 | 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions |
1229 | 1232 | $id: User identifier |
1230 | 1233 | |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -80,25 +80,30 @@ |
81 | 81 | static function softwareInformation() { |
82 | 82 | $dbr = wfGetDB( DB_SLAVE ); |
83 | 83 | |
84 | | - return Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMsg( 'version-software' ) ) . |
85 | | - Xml::openElement( 'table', array( 'id' => 'sv-software' ) ) . |
| 84 | + // Put the software in an array of form 'name' => 'version'. All messages should |
| 85 | + // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup |
| 86 | + // can be used |
| 87 | + $software = array(); |
| 88 | + $software['[http://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); |
| 89 | + $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")"; |
| 90 | + $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion(); |
| 91 | + |
| 92 | + // Allow a hook to add/remove items |
| 93 | + wfRunHooks( 'SoftwareInfo', array( &$software ) ); |
| 94 | + |
| 95 | + $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMsg( 'version-software' ) ) . |
| 96 | + Xml::openElement( 'table', array( 'id' => 'sv-software' ) ) . |
86 | 97 | "<tr> |
87 | 98 | <th>" . wfMsg( 'version-software-product' ) . "</th> |
88 | 99 | <th>" . wfMsg( 'version-software-version' ) . "</th> |
89 | | - </tr>\n |
90 | | - <tr> |
91 | | - <td>[http://www.mediawiki.org/ MediaWiki]</td> |
92 | | - <td>" . self::getVersionLinked() . "</td> |
93 | | - </tr>\n |
94 | | - <tr> |
95 | | - <td>[http://www.php.net/ PHP]</td> |
96 | | - <td>" . phpversion() . " (" . php_sapi_name() . ")</td> |
97 | | - </tr>\n |
98 | | - <tr> |
99 | | - <td>" . $dbr->getSoftwareLink() . "</td> |
100 | | - <td>" . $dbr->getServerVersion() . "</td> |
101 | | - </tr>\n" . |
102 | | - Xml::closeElement( 'table' ); |
| 100 | + </tr>\n"; |
| 101 | + foreach( $software as $name => $version ) { |
| 102 | + $out .= "<tr> |
| 103 | + <td>" . $name . "</td> |
| 104 | + <td>" . $version . "</td> |
| 105 | + </tr>\n"; |
| 106 | + } |
| 107 | + return $out . Xml::closeElement( 'table' ); |
103 | 108 | } |
104 | 109 | |
105 | 110 | /** |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -167,6 +167,8 @@ |
168 | 168 | * Special:AllPages: Move hardcoded styles from code to CSS |
169 | 169 | * (bug 6092) Add parser function equivalents of {{REVISIONID}}, |
170 | 170 | {{REVISIONTIMESTAMP}} (and friends) and {{REVISIONUSER}} magic words |
| 171 | +* (bug 18529) New hook: SoftwareInfo for adding information about the software |
| 172 | + to Special:Version |
171 | 173 | |
172 | 174 | === Bug fixes in 1.15 === |
173 | 175 | * (bug 16968) Special:Upload no longer throws useless warnings. |