r46645 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46644‎ | r46645 | r46646 >
Date:15:56, 31 January 2009
Author:catrope
Status:deferred
Tags:
Comment:
API: (bug 17224) Add siprop=rightsinfo to meta=siteinfo. Modified patch by Brianna Laugher
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -58,6 +58,7 @@
5959 * Agbad
6060 * Brad Jorsch
6161 * Brent G
 62+* Brianna Laugher
6263 * Daniel Arnold
6364 * Danny B.
6465 * FunPika
Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -79,6 +79,9 @@
8080 case 'fileextensions':
8181 $this->appendFileExtensions( $p );
8282 break;
 83+ case 'rightsinfo':
 84+ $this->appendRightsInfo( $p );
 85+ break;
8386 default :
8487 ApiBase :: dieDebug( __METHOD__, "Unknown prop=$p" );
8588 }
@@ -335,6 +338,24 @@
336339 }
337340
338341
 342+ protected function appendRightsInfo( $property ) {
 343+ global $wgRightsPage, $wgRightsUrl, $wgRightsText;
 344+ $title = Title::newFromText( $wgRightsPage );
 345+ $url = $title ? $title->getFullURL() : $wgRightsUrl;
 346+ $text = $wgRightsText;
 347+ if( !$text && $title ) {
 348+ $text = $title->getPrefixedText();
 349+ }
 350+
 351+ $data = array(
 352+ 'url' => $url ? $url : '',
 353+ 'text' => $text ? $text : ''
 354+ );
 355+
 356+ $this->getResult()->addValue( 'query', $property, $data );
 357+ }
 358+
 359+
339360 public function getAllowedParams() {
340361 return array(
341362 'prop' => array(
@@ -352,6 +373,7 @@
353374 'usergroups',
354375 'extensions',
355376 'fileextensions',
 377+ 'rightsinfo',
356378 )
357379 ),
358380 'filteriw' => array(
@@ -379,6 +401,7 @@
380402 ' "usergroups" - Returns user groups and the associated permissions',
381403 ' "extensions" - Returns extensions installed on the wiki',
382404 ' "fileextensions" - Returns list of file extensions allowed to be uploaded',
 405+ ' "rightsinfo" - Returns wiki rights (license) information if available',
383406 ),
384407 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
385408 'showalldb' => 'List all database servers, not just the one lagging the most',
Index: trunk/phase3/RELEASE-NOTES
@@ -138,6 +138,7 @@
139139 Building query properly now using makeList()
140140 * (bug 17182) Fix pretty printer so URLs with parentheses in them are
141141 autolinked correctly
 142+* (bug 17224) Added siprop=rightsinfo to meta=siteinfo
142143
143144 === Languages updated in 1.15 ===
144145

Status & tagging log