http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88422
Revision: 88422
Author: jeroendedauw
Date: 2011-05-19 19:17:34 +0000 (Thu, 19 May 2011)
Log Message:
-----------
follow up to r88421
Modified Paths:
--------------
trunk/extensions/SemanticWatchlist/api/ApiAddWatchlistGroup.php
trunk/extensions/SemanticWatchlist/api/ApiDeleteWatchlistGroup.php
trunk/extensions/SemanticWatchlist/api/ApiEditWatchlistGroup.php
Modified: trunk/extensions/SemanticWatchlist/api/ApiAddWatchlistGroup.php
===================================================================
--- trunk/extensions/SemanticWatchlist/api/ApiAddWatchlistGroup.php
2011-05-19 19:09:07 UTC (rev 88421)
+++ trunk/extensions/SemanticWatchlist/api/ApiAddWatchlistGroup.php
2011-05-19 19:17:34 UTC (rev 88422)
@@ -70,6 +70,11 @@
public function getParamDescription() {
return array(
+ 'name' => 'The name of the group, used for display in
the user preferences',
+ 'properties' => 'The properties this watchlist group
covers',
+ 'categories' => 'The categories this watchlist group
covers',
+ 'namespaces' => 'The namespaces this watchlist group
covers',
+ 'concepts' => 'The concepts this watchlist group
covers',
);
}
Modified: trunk/extensions/SemanticWatchlist/api/ApiDeleteWatchlistGroup.php
===================================================================
--- trunk/extensions/SemanticWatchlist/api/ApiDeleteWatchlistGroup.php
2011-05-19 19:09:07 UTC (rev 88421)
+++ trunk/extensions/SemanticWatchlist/api/ApiDeleteWatchlistGroup.php
2011-05-19 19:17:34 UTC (rev 88422)
@@ -53,6 +53,7 @@
public function getParamDescription() {
return array(
+ 'ids' => 'The IDs of the watchlist groups to delete'
);
}
Modified: trunk/extensions/SemanticWatchlist/api/ApiEditWatchlistGroup.php
===================================================================
--- trunk/extensions/SemanticWatchlist/api/ApiEditWatchlistGroup.php
2011-05-19 19:09:07 UTC (rev 88421)
+++ trunk/extensions/SemanticWatchlist/api/ApiEditWatchlistGroup.php
2011-05-19 19:17:34 UTC (rev 88422)
@@ -27,15 +27,59 @@
$params = $this->extractRequestParams();
+ $group = new SWLGroup(
+ $params['id'],
+ $params['name'],
+ $params['categories'],
+ $params['namespaces'],
+ $params['properties'],
+ $params['concepts']
+ );
+
+ $group->writeToDB();
}
public function getAllowedParams() {
return array(
+ 'id' => array(
+ ApiBase::PARAM_TYPE => 'integer',
+ ApiBase::PARAM_REQUIRED => true,
+ ),
+ 'name' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_REQUIRED => true,
+ ),
+ 'properties' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_REQUIRED => true,
+ ),
+ 'categories' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_DFLT => '',
+ ),
+ 'namespaces' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_DFLT => '',
+ ),
+ 'concepts' => array(
+ ApiBase::PARAM_TYPE => 'string',
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_DFLT => '',
+ ),
);
}
public function getParamDescription() {
return array(
+ 'id' => 'The ID of the watchlist group to edit',
+ 'name' => 'The name of the group, used for display in
the user preferences',
+ 'properties' => 'The properties this watchlist group
covers',
+ 'categories' => 'The categories this watchlist group
covers',
+ 'namespaces' => 'The namespaces this watchlist group
covers',
+ 'concepts' => 'The concepts this watchlist group
covers',
);
}
@@ -52,7 +96,7 @@
protected function getExamples() {
return array(
- 'api.php?action=semanticwatchlist',
+ 'api.php?action=editswlgroup&id=42&name=My group of
awesome&properties=Has awesomeness|Has epicness&categories=Awesome stuff',
);
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs