Robert Vogel has uploaded a new change for review. https://gerrit.wikimedia.org/r/311935
Change subject: [WIP] BSApiWikiPageTasks: added new tasks ...................................................................... [WIP] BSApiWikiPageTasks: added new tasks Change-Id: I25b65775e4afe958d8d979cb76bc8ec88431cf16 --- M includes/api/BSApiWikiPageTasks.php A resources/bluespice.extjs/BS/action/APIAddCategories.js A resources/bluespice.extjs/BS/action/APIRemoveCategories.js A resources/bluespice.extjs/BS/action/APISetCategories.js 4 files changed, 64 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/35/311935/1 diff --git a/includes/api/BSApiWikiPageTasks.php b/includes/api/BSApiWikiPageTasks.php index 39a5bf3..8311ef2 100644 --- a/includes/api/BSApiWikiPageTasks.php +++ b/includes/api/BSApiWikiPageTasks.php @@ -31,7 +31,12 @@ * @package BlueSpice_Foundation */ class BSApiWikiPageTasks extends BSApiTasksBase { - protected $aTasks = array( 'setCategories' ); + protected $aTasks = array( + 'setCategories', + 'getExplicitCategories', + 'addCategories', + 'removeCategories' + ); /** * Configures the global permission requirements @@ -39,10 +44,19 @@ */ protected function getRequiredTaskPermissions() { return array( - 'setCategories' => array( 'edit' ) + 'setCategories' => array( 'edit' ), + 'getExplicitCategories' => array( 'read' ), + 'addCategories' => array( 'edit' ), + 'removeCategories' => array( 'edit' ) ); } + /** + * + * @param stdClass $oTaskData + * @param array $aParams + * @return BSStandardAPIResponse + */ protected function task_setCategories( $oTaskData, $aParams ) { $oResponse = $this->makeStandardReturn(); @@ -128,6 +142,47 @@ return $oResponse; } + /** + * + * @param stdClass $oTaskData + * @param array $aParams + * @return BSStandardAPIResponse + */ + protected function task_getExplicitCategories( $oTaskData, $aParams ) { + $oResponse = $this->makeStandardReturn(); + $aCategories = []; + + $oResponse->success = true; + $oResponse->payload = $aCategories; + $oResponse->payload_count = count( $aCategories ); + + return $oResponse; + } + + /** + * + * @param stdClass $oTaskData + * @param array $aParams + * @return BSStandardAPIResponse + */ + protected function task_addCategories( $oTaskData, $aParams ) { + $oResponse = $this->makeStandardReturn(); + //TODO: Implement + return $oResponse; + } + + /** + * + * @param stdClass $oTaskData + * @param array $aParams + * @return BSStandardAPIResponse + */ + protected function task_removeCategories( $oTaskData, $aParams ) { + $oResponse = $this->makeStandardReturn(); + //TODO: Implement + return $oResponse; + } + public function needsToken() { return parent::needsToken(); } diff --git a/resources/bluespice.extjs/BS/action/APIAddCategories.js b/resources/bluespice.extjs/BS/action/APIAddCategories.js new file mode 100644 index 0000000..9facedf --- /dev/null +++ b/resources/bluespice.extjs/BS/action/APIAddCategories.js @@ -0,0 +1,7 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + + diff --git a/resources/bluespice.extjs/BS/action/APIRemoveCategories.js b/resources/bluespice.extjs/BS/action/APIRemoveCategories.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/resources/bluespice.extjs/BS/action/APIRemoveCategories.js diff --git a/resources/bluespice.extjs/BS/action/APISetCategories.js b/resources/bluespice.extjs/BS/action/APISetCategories.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/resources/bluespice.extjs/BS/action/APISetCategories.js -- To view, visit https://gerrit.wikimedia.org/r/311935 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25b65775e4afe958d8d979cb76bc8ec88431cf16 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits