jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/372353 )
Change subject: BSFoundation: Adding Hook base classes for all hooks provided by BSFoundation ...................................................................... BSFoundation: Adding Hook base classes for all hooks provided by BSFoundation * also added the descriptin header to the existing hook base classes * also fixed some idention issues * also added the user object to the hook BSEntityDeleteComplete Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f --- M src/Entity.php M src/Hook.php A src/Hook/BSApiExtJSDBTableStoreAfterQuery.php A src/Hook/BSApiExtJSDBTableStoreBeforeQuery.php A src/Hook/BSApiExtJSStoreBaseAfterFilterData.php A src/Hook/BSApiExtJSStoreBaseBeforePostProcessData.php A src/Hook/BSApiExtJSStoreBaseBeforeReturnData.php A src/Hook/BSApiTasksBaseAfterExecuteTask.php A src/Hook/BSApiTasksBaseBeforeExecuteTask.php A src/Hook/BSBaseTemplateGetNavigationSidebar.php A src/Hook/BSCoreConfigGet.php A src/Hook/BSCoreGetUserMiniProfileBeforeInit.php A src/Hook/BSEntityConfigDefaults.php A src/Hook/BSEntityDelete.php A src/Hook/BSEntityDeleteComplete.php A src/Hook/BSEntityGetFullData.php A src/Hook/BSEntityInvalidate.php A src/Hook/BSEntityRegister.php A src/Hook/BSEntitySaveComplete.php A src/Hook/BSEntitySetValuesByObject.php A src/Hook/BSUserPageSettings.php A src/Hook/BSWidgetListHelperInitKeyWords.php A src/Hook/BeforeNotificationsInit.php M src/Hook/BeforePageDisplay.php A src/Hook/BsAdapterAjaxPingResult.php A src/Hook/BsFoundationBeforeMakeGlobalVariablesScript.php A src/Hook/BsSettingsAfterSaveSettings.php A src/Hook/BsSettingsBeforeSaveSettings.php M src/Hook/LinkEnd.php M src/Hook/LoadExtensionSchemaUpdates.php M src/Hook/MakeGlobalVariablesScript.php M src/Hook/PageContentSaveComplete.php M src/Hook/ParserFirstCallInit.php M src/Hook/SkinTemplateNavigation.php M src/Hook/SoftwareInfo.php M src/Hook/UserCan.php M src/Hook/UserGetRights.php A src/Hook/UserMiniProfileAfterInit.php 38 files changed, 2,470 insertions(+), 12 deletions(-) Approvals: Robert Vogel: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Entity.php b/src/Entity.php index f47e62f..0de18dd 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -302,7 +302,8 @@ $oWikiPage = \WikiPage::factory( $oTitle ); \Hooks::run( 'BSEntityDelete', [ $this, $oStatus, $oUser ] ); - if( $oStatus instanceof \Status && $oStatus->isOK() ) { return $oStatus; + if( $oStatus instanceof \Status && $oStatus->isOK() ) { + return $oStatus; } $this->bArchived = true; $this->setUnsavedChanges(); @@ -313,7 +314,8 @@ return \Status::newFatal( $e->getMessage() ); } - \Hooks::run( 'BSEntityDeleteComplete', [ $this, $oStatus ] ); if( !$oStatus->isOK() ) { + \Hooks::run( 'BSEntityDeleteComplete', [ $this, $oStatus, $oUser ] ); + if( !$oStatus->isOK() ) { return $oStatus; } diff --git a/src/Hook.php b/src/Hook.php index 4725063..ff72ace 100644 --- a/src/Hook.php +++ b/src/Hook.php @@ -1,4 +1,30 @@ <?php +/** + * Hook handler base class for BlueSpice + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice; abstract class Hook { diff --git a/src/Hook/BSApiExtJSDBTableStoreAfterQuery.php b/src/Hook/BSApiExtJSDBTableStoreAfterQuery.php new file mode 100644 index 0000000..4f58844 --- /dev/null +++ b/src/Hook/BSApiExtJSDBTableStoreAfterQuery.php @@ -0,0 +1,144 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiExtJSDBTableStoreAfterQuery + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiExtJSDBTableStoreAfterQuery extends Hook { + /** + * + * @var \BSApiExtJSDBTableStoreBase + */ + protected $store = null; + + /** + * + * @var string + */ + protected $queryString = null; + + /** + * + * @var array + */ + protected $filters = null; + + /** + * + * @var array + */ + protected $tables = null; + + /** + * + * @var array + */ + protected $fields = null; + + /** + * + * @var array + */ + protected $conditions = null; + + /** + * + * @var array + */ + protected $options = null; + + /** + * + * @var array + */ + protected $joinOptions = null; + + /** + * + * @var array + */ + protected $dataItems = null; + + /** + * Located in BSApiExtJSDBTableStoreBase::makeData. After the database + * query was executed + * @param \BSApiExtJSDBTableStoreBase $store + * @param string $queryString + * @param array $filters + * @param array $tables + * @param array $fields + * @param array $conditions + * @param array $options + * @param array $joinOptions + * @param array $dataItems + * @return boolean + */ + public static function callback( $store, $queryString, $filters, $tables, $fields, $conditions, $options, $joinOptions, &$dataItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $store, + $queryString, + $filters, + $tables, + $fields, + $conditions, + $options, + $joinOptions, + $dataItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiExtJSDBTableStoreBase $store + * @param string $queryString + * @param array $filters + * @param array $tables + * @param array $fields + * @param array $conditions + * @param array $options + * @param array $joinOptions + * @param array $dataItems + */ + public function __construct( $context, $config, $store, $queryString, $filters, $tables, $fields, $conditions, $options, $joinOptions, &$dataItems ) { + parent::__construct( $context, $config ); + + $this->store = $store; + $this->queryString = $queryString; + $this->filters = $filters; + $this->tables = $tables; + $this->fields = $fields; + $this->conditions = $conditions; + $this->options = $options; + $this->joinOptions = $joinOptions; + $this->dataItems = &$dataItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiExtJSDBTableStoreBeforeQuery.php b/src/Hook/BSApiExtJSDBTableStoreBeforeQuery.php new file mode 100644 index 0000000..e502044 --- /dev/null +++ b/src/Hook/BSApiExtJSDBTableStoreBeforeQuery.php @@ -0,0 +1,144 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiExtJSDBTableStoreBeforeQuery + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiExtJSDBTableStoreBeforeQuery extends Hook { + /** + * + * @var \BSApiExtJSDBTableStoreBase + */ + protected $store = null; + + /** + * + * @var string + */ + protected $queryString = null; + + /** + * + * @var array + */ + protected $filters = null; + + /** + * + * @var array + */ + protected $tables = null; + + /** + * + * @var array + */ + protected $fields = null; + + /** + * + * @var array + */ + protected $conditions = null; + + /** + * + * @var array + */ + protected $options = null; + + /** + * + * @var array + */ + protected $joinOptions = null; + + /** + * + * @var array + */ + protected $dataItems = null; + + /** + * Located in BSApiExtJSDBTableStoreBase::makeData. Before the database + * query gets executed + * @param \BSApiExtJSDBTableStoreBase $store + * @param string $queryString + * @param array $filters + * @param array $tables + * @param array $fields + * @param array $conditions + * @param array $options + * @param array $joinOptions + * @param array $dataItems + * @return boolean + */ + public static function callback( $store, $queryString, $filters, &$tables, &$fields, &$conditions, &$options, &$joinOptions, &$dataItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $store, + $queryString, + $filters, + $tables, + $fields, + $conditions, + $options, + $joinOptions, + $dataItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiExtJSDBTableStoreBase $store + * @param string $queryString + * @param array $filters + * @param array $tables + * @param array $fields + * @param array $conditions + * @param array $options + * @param array $joinOptions + * @param array $dataItems + */ + public function __construct( $context, $config, $store, $queryString, $filters, &$tables, &$fields, &$conditions, &$options, &$joinOptions, &$dataItems ) { + parent::__construct( $context, $config ); + + $this->store = $store; + $this->queryString = $queryString; + $this->filters = $filters; + $this->tables = &$tables; + $this->fields = &$fields; + $this->conditions = &$conditions; + $this->options = &$options; + $this->joinOptions = &$joinOptions; + $this->dataItems = &$dataItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiExtJSStoreBaseAfterFilterData.php b/src/Hook/BSApiExtJSStoreBaseAfterFilterData.php new file mode 100644 index 0000000..c95f724 --- /dev/null +++ b/src/Hook/BSApiExtJSStoreBaseAfterFilterData.php @@ -0,0 +1,74 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiExtJSStoreBaseAfterFilterData + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiExtJSStoreBaseAfterFilterData extends Hook { + /** + * The store api + * @var \BSApiExtJSStoreBase + */ + protected $store = null; + + /** + * An array of data itemss + * @var \stdClass[] + */ + protected $dataItems = null; + + /** + * Located in BSApiExtJSStoreBase::postProcessData. After the result was + * filtered. + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + * @return boolean + */ + public static function callback( $store, &$dataItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $store, + $dataItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + */ + public function __construct( $context, $config, $store, &$dataItems ) { + parent::__construct( $context, $config ); + + $this->store = $store; + $this->dataItems = &$dataItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiExtJSStoreBaseBeforePostProcessData.php b/src/Hook/BSApiExtJSStoreBaseBeforePostProcessData.php new file mode 100644 index 0000000..fd9467b --- /dev/null +++ b/src/Hook/BSApiExtJSStoreBaseBeforePostProcessData.php @@ -0,0 +1,74 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiExtJSStoreBaseBeforePostProcessData + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiExtJSStoreBaseBeforePostProcessData extends Hook { + /** + * The store api + * @var \BSApiExtJSStoreBase + */ + protected $store = null; + + /** + * An array of data itemss + * @var \stdClass[] + */ + protected $dataItems = null; + + /** + * Located in BSApiExtJSStoreBase::postProcessData. Before the result gets + * processed. Return false to abort any post processing. + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + * @return boolean + */ + public static function callback( $store, &$dataItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $store, + $dataItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + */ + public function __construct( $context, $config, $store, &$dataItems ) { + parent::__construct( $context, $config ); + + $this->store = $store; + $this->dataItems = &$dataItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiExtJSStoreBaseBeforeReturnData.php b/src/Hook/BSApiExtJSStoreBaseBeforeReturnData.php new file mode 100644 index 0000000..7aa3130 --- /dev/null +++ b/src/Hook/BSApiExtJSStoreBaseBeforeReturnData.php @@ -0,0 +1,84 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiExtJSStoreBaseBeforeReturnData + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiExtJSStoreBaseBeforeReturnData extends Hook { + /** + * The store api + * @var \BSApiExtJSStoreBase + */ + protected $store = null; + + /** + * An array of data itemss + * @var \stdClass[] + */ + protected $dataItems = null; + + /** + * An array of meta data itemss + * @var \stdClass[] + */ + protected $metaDataItems = null; + + /** + * Located in BSApiExtJSStoreBase::returnData. Before the result gets + * returned + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + * @param array $metaDataItems + * @return boolean + */ + public static function callback( $store, &$dataItems, &$metaDataItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $store, + $dataItems, + $metaDataItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiExtJSStoreBase $store + * @param array $dataItems + * @param array $metaDataItems + */ + public function __construct( $context, $config, $store, &$dataItems, &$metaDataItems ) { + parent::__construct( $context, $config ); + + $this->store = $store; + $this->dataItems = &$dataItems; + $this->metaDataItems = &$metaDataItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiTasksBaseAfterExecuteTask.php b/src/Hook/BSApiTasksBaseAfterExecuteTask.php new file mode 100644 index 0000000..f88b2e8 --- /dev/null +++ b/src/Hook/BSApiTasksBaseAfterExecuteTask.php @@ -0,0 +1,103 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiTasksBaseAfterExecuteTask + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiTasksBaseAfterExecuteTask extends Hook { + /** + * The task api + * @var \BSApiTasksBase + */ + protected $taskApi = null; + + /** + * Key of the requested task + * @var string + */ + protected $taskKey = null; + + /** + * Result of the called task + * @var \stdClass + */ + protected $result = null; + + /** + * Params for the requested task + * @var \stdClass + */ + protected $taskData = null; + + /** + * Params for the requested task + * @var array + */ + protected $params = null; + + /** + * Located in BSApiTasksBase::execute. After the requested task was called. + * @param \BSApiTasksBase $taskApi + * @param string $taskKey + * @param \stdClass $result + * @param \stdClass $taskData + * @param array $params + * @return boolean + */ + public static function callback( $taskApi, $taskKey, &$result, $taskData, $params ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $taskApi, + $taskKey, + $result, + $taskData, + $params + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiTasksBase $taskApi + * @param string $taskKey + * @param \stdClass $result + * @param \stdClass $taskData + * @param array $params + */ + public function __construct( $context, $config, $taskApi, $taskKey, &$result, $taskData, $params ) { + parent::__construct( $context, $config ); + + $this->taskApi = $taskApi; + $this->taskKey = $taskKey; + $this->result = &$result; + $this->taskData = $taskData; + $this->params = $params; + } +} \ No newline at end of file diff --git a/src/Hook/BSApiTasksBaseBeforeExecuteTask.php b/src/Hook/BSApiTasksBaseBeforeExecuteTask.php new file mode 100644 index 0000000..b86cbf1 --- /dev/null +++ b/src/Hook/BSApiTasksBaseBeforeExecuteTask.php @@ -0,0 +1,93 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSApiTasksBaseBeforeExecuteTask + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSApiTasksBaseBeforeExecuteTask extends Hook { + /** + * The task api + * @var \BSApiTasksBase + */ + protected $taskApi = null; + + /** + * Key of the requested task + * @var string + */ + protected $taskKey = null; + + /** + * Params for the requested task + * @var \stdClass + */ + protected $taskData = null; + + /** + * Params for the requested task + * @var array + */ + protected $params = null; + + /** + * Located in BSApiTasksBase::execute. Before the requested task get called. + * @param \BSApiTasksBase $taskApi + * @param string $taskKey + * @param \stdClass $taskData + * @param array $params + * @return boolean + */ + public static function callback( $taskApi, $taskKey, &$taskData, &$params ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $taskApi, + $taskKey, + $taskData, + $params + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BSApiTasksBase $taskApi + * @param string $taskKey + * @param \stdClass $taskData + * @param array $params + */ + public function __construct( $context, $config, $taskApi, $taskKey, &$taskData, &$params ) { + parent::__construct( $context, $config ); + + $this->taskApi = $taskApi; + $this->taskKey = $taskKey; + $this->taskData = &$taskData; + $this->params = &$params; + } +} \ No newline at end of file diff --git a/src/Hook/BSBaseTemplateGetNavigationSidebar.php b/src/Hook/BSBaseTemplateGetNavigationSidebar.php new file mode 100644 index 0000000..18b57c8 --- /dev/null +++ b/src/Hook/BSBaseTemplateGetNavigationSidebar.php @@ -0,0 +1,86 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSBaseTemplateGetNavigationSidebar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSBaseTemplateGetNavigationSidebar extends Hook { + /** + * + * @var \BsBaseTemplate + */ + protected $template = null; + + /** + * An array of \ViewBaseElement's + * @var \ViewBaseElement[] + */ + protected $portlets = null; + + /** + * An array of html strings. All executed \ViewBaseElement's output will be + * stored there. + * @var array + */ + protected $outputItems = null; + + /** + * Located in \BsBaseTemplate::getNavigationSidebar. Before the + * \ViewBaseElement's in $portlets are executed and their results stored in + * $outputItems + * @param \BsBaseTemplate $template + * @param array $portlets + * @param array $outputItems + * @return type + */ + public static function callback( $template, &$portlets, &$outputItems ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $template, + $portlets, + $outputItems + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \BsBaseTemplate $template + * @param array $portlets + * @param array $outputItems + */ + public function __construct( $context, $config, $template, &$portlets, &$outputItems ) { + parent::__construct( $context, $config ); + + $this->template = $template; + $this->portlets = &$portlets; + $this->outputItems = &$outputItems; + } +} \ No newline at end of file diff --git a/src/Hook/BSCoreConfigGet.php b/src/Hook/BSCoreConfigGet.php new file mode 100644 index 0000000..fceffaf --- /dev/null +++ b/src/Hook/BSCoreConfigGet.php @@ -0,0 +1,75 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSCoreConfigGet + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSCoreConfigGet extends Hook { + + /** + * The identifier of the variable + * @var string + */ + protected $path = null; + + /** + * The value of the variable + * @var mixed + */ + protected $returnResult = null; + + /** + * Located in BsConfig::get. Enables modification of the value of the + * BSConfig variable specified by path. + * @param string $path + * @param mixed $return + * @return boolean + */ + public static function callback( $path, &$returnResult ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $path, + $returnResult + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param string $path + * @param mixed $return + */ + public function __construct( $context, $config, $path, &$returnResult ) { + parent::__construct( $context, $config ); + + $this->path = $path; + $this->returnResult = &$returnResult; + } +} \ No newline at end of file diff --git a/src/Hook/BSCoreGetUserMiniProfileBeforeInit.php b/src/Hook/BSCoreGetUserMiniProfileBeforeInit.php new file mode 100644 index 0000000..43476e8 --- /dev/null +++ b/src/Hook/BSCoreGetUserMiniProfileBeforeInit.php @@ -0,0 +1,85 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSCoreGetUserMiniProfileBeforeInit + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSCoreGetUserMiniProfileBeforeInit extends Hook { + + /** + * + * @var \ViewUserMiniProfile + */ + protected $userMiniProfileView = null; + + /** + * + * @var \User + */ + protected $user = null; + + /** + * + * @var array + */ + Protected $params = null; + + /** + * Located in \BsCore::getUserMiniProfile. Before the created user mini + * profile view is initialized and returned. + * @param \ViewUserMiniProfile $userMiniProfileView + * @param \User $user + * @param array $params + * @return boolean + */ + public static function callback( &$userMiniProfileView, &$user, &$params ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $userMiniProfileView, + $user, + $params + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \ViewUserMiniProfile $userMiniProfileView + * @param \User $user + * @param array $params + */ + public function __construct( $context, $config, &$userMiniProfileView, &$user, &$params ) { + parent::__construct( $context, $config ); + + $this->userMiniProfileView = &$userMiniProfileView; + $this->user = &$user; + $this->params = &$params; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityConfigDefaults.php b/src/Hook/BSEntityConfigDefaults.php new file mode 100644 index 0000000..e4e8ad0 --- /dev/null +++ b/src/Hook/BSEntityConfigDefaults.php @@ -0,0 +1,65 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityConfigDefaults + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSEntityConfigDefaults extends Hook { + /** + * An array of settings [ key => mixed value ] + * @var array + */ + protected $defaultSettings = null; + + /** + * Located in \BlueSpice\EntityConfig::factory. After all instances of + * EntityConfig's have been created. A default setting will be returned, + * when a EntityConfig does not have a method get_<settingsKey> + * @param array $defaultSettings + * @return boolean + */ + public static function callback( &$defaultSettings ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $defaultSettings + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param array $defaultSettings + */ + public function __construct( $context, $config, &$defaultSettings ) { + parent::__construct( $context, $config ); + + $this->defaultSettings = &$defaultSettings; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityDelete.php b/src/Hook/BSEntityDelete.php new file mode 100644 index 0000000..cd3e2ff --- /dev/null +++ b/src/Hook/BSEntityDelete.php @@ -0,0 +1,85 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityDelete + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntityDelete extends Hook { + /** + * The Entity which will be deleted + * @var Entity + */ + protected $entity = null; + + /** + * + * @var \Status + */ + protected $status = null; + + /** + * User who performed this action + * @var \User + */ + protected $user = null; + + /** + * Located in \BlueSpice\Entity::delete. Before the entity will be deleted. + * Return a fatal $status to abort the deletion. + * @param Entity $entity + * @param \Status $status + * @param \User $user + * @return boolean + */ + public static function callback( $entity, $status, $user ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity, + $status, + $user + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + * @param \Status $status + * @param \User $user + */ + public function __construct( $context, $config, $entity, $status, $user ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + $this->status = $status; + $this->user = $user; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityDeleteComplete.php b/src/Hook/BSEntityDeleteComplete.php new file mode 100644 index 0000000..df2f04d --- /dev/null +++ b/src/Hook/BSEntityDeleteComplete.php @@ -0,0 +1,84 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityDeleteComplete + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntityDeleteComplete extends Hook { + /** + * The Entity which was deleted + * @var Entity + */ + protected $entity = null; + + /** + * + * @var \Status + */ + protected $status = null; + + /** + * User who performed this action + * @var \User + */ + protected $user = null; + + /** + * Located in \BlueSpice\Entity::delete. After the entity was deleted. + * @param Entity $entity + * @param \Status $status + * @param \User $user + * @return boolean + */ + public static function callback( $entity, $status, $user ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity, + $status, + $user + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + * @param \Status $status + * @param \User $user + */ + public function __construct( $context, $config, $entity, $status, $user ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + $this->status = $status; + $this->user = $user; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityGetFullData.php b/src/Hook/BSEntityGetFullData.php new file mode 100644 index 0000000..a1ae922 --- /dev/null +++ b/src/Hook/BSEntityGetFullData.php @@ -0,0 +1,75 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityGetFullData + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntityGetFullData extends Hook { + /** + * The Entity which stores the values + * @var Entity + */ + protected $entity = null; + + /** + * An array of values stored in the entity [ key => mixed value ]. + * @var array + */ + protected $data = null; + + /** + * Located in \BlueSpice\Entity::getFullData. Before the full set of values + * stored in the entity is returned + * @param Entity $entity + * @param array $data + * @return boolean + */ + public static function callback( $entity, &$data ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity, + $data + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + * @param array $data + */ + public function __construct( $context, $config, $entity, &$data ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + $this->data = &$data; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityInvalidate.php b/src/Hook/BSEntityInvalidate.php new file mode 100644 index 0000000..4e05656 --- /dev/null +++ b/src/Hook/BSEntityInvalidate.php @@ -0,0 +1,65 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityInvalidate + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntityInvalidate extends Hook { + /** + * The Entity which was invalidated + * @var Entity + */ + protected $entity = null; + + /** + * Located in \BlueSpice\Entity::invalidateCache. After the entity was + * invalidated. + * @param Entity $entity + * @return boolean + */ + public static function callback( $entity ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + */ + public function __construct( $context, $config, $entity ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntityRegister.php b/src/Hook/BSEntityRegister.php new file mode 100644 index 0000000..3304350 --- /dev/null +++ b/src/Hook/BSEntityRegister.php @@ -0,0 +1,65 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntityRegister + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSEntityRegister extends Hook { + /** + * An array of entity registrations + * [ entitykey => EntityConfig class name ]. + * @var array + */ + protected $entityRegistrations = null; + + /** + * Located in \BlueSpice\EntityRegistry::runRegister. Collects all entity + * configs and instantiates them. + * @param array $entityRegistrations + * @return boolean + */ + public static function callback( &$entityRegistrations ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entityRegistrations + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param array $entityRegistrations + */ + public function __construct( $context, $config, &$entityRegistrations ) { + parent::__construct( $context, $config ); + + $this->entityRegistrations = &$entityRegistrations; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntitySaveComplete.php b/src/Hook/BSEntitySaveComplete.php new file mode 100644 index 0000000..ee11933 --- /dev/null +++ b/src/Hook/BSEntitySaveComplete.php @@ -0,0 +1,85 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntitySaveComplete + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntitySaveComplete extends Hook { + /** + * The Entity which was saved + * @var Entity + */ + protected $entity = null; + + /** + * + * @var \Status + */ + protected $status = null; + + /** + * User who performed this action + * @var \User + */ + protected $user = null; + + /** + * Located in \BlueSpice\Entity::save. After the entity was saved + * successful. + * @param Entity $entity + * @param \Status $status + * @param \User $user + * @return boolean + */ + public static function callback( $entity, $status, $user ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity, + $status, + $user + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + * @param \Status $status + * @param \User $user + */ + public function __construct( $context, $config, $entity, $status, $user ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + $this->status = $status; + $this->user = $user; + } +} \ No newline at end of file diff --git a/src/Hook/BSEntitySetValuesByObject.php b/src/Hook/BSEntitySetValuesByObject.php new file mode 100644 index 0000000..47d7814 --- /dev/null +++ b/src/Hook/BSEntitySetValuesByObject.php @@ -0,0 +1,75 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSEntitySetValuesByObject + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; +use BlueSpice\Entity; + +abstract class BSEntitySetValuesByObject extends Hook { + /** + * The Entity which should store the values + * @var Entity + */ + protected $entity = null; + + /** + * An obect of values to store in the entity (object)[ key => mixed value ]. + * @var \stdClass + */ + protected $data = null; + + /** + * Located in \BlueSpice\Entity::setValuesByObject. After the known values + * are stored in the entity + * @param Entity $entity + * @param \stdClass $data + * @return boolean + */ + public static function callback( $entity, &$data ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $entity, + $data + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param Entity $entity + * @param \stdClass $data + */ + public function __construct( $context, $config, $entity, &$data ) { + parent::__construct( $context, $config ); + + $this->entity = $entity; + $this->data = &$data; + } +} \ No newline at end of file diff --git a/src/Hook/BSUserPageSettings.php b/src/Hook/BSUserPageSettings.php new file mode 100644 index 0000000..a45c8e5 --- /dev/null +++ b/src/Hook/BSUserPageSettings.php @@ -0,0 +1,87 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BS:UserPageSettings + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSUserPageSettings extends Hook { + /** + * The user related to the user page + * @var \User + */ + protected $user = null; + + /** + * The user page + * @var \Title + */ + protected $title = null; + + /** + * An array of \ViewBaseElement's + * @var []\ViewBaseElement + */ + protected $settingViews = null; + + /** + * This hook is called: 'BS:UserPageSettings' + * Located in BsCoreHooks::addProfilePageSettings. This is where the + * user setting buttons on the users page are registered, when the current + * user is on his user page. + * @param \User $user + * @param \Title $title + * @param array $settingViews + * @return boolean + */ + public static function callback( $user, $title, &$settingViews ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $user, + $title, + $settingViews + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \User $user + * @param \Title $title + * @param array $settingViews + * @return boolean + */ + public function __construct( $context, $config, $user, $title, &$settingViews ) { + parent::__construct( $context, $config ); + + $this->user = $user; + $this->title = $title; + $this->settingViews = &$settingViews; + } +} \ No newline at end of file diff --git a/src/Hook/BSWidgetListHelperInitKeyWords.php b/src/Hook/BSWidgetListHelperInitKeyWords.php new file mode 100644 index 0000000..367eb0a --- /dev/null +++ b/src/Hook/BSWidgetListHelperInitKeyWords.php @@ -0,0 +1,73 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BSWidgetListHelperInitKeyWords + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BSWidgetListHelperInitKeyWords extends Hook { + /** + * Array of strings representing the widget key words + * @var array + */ + protected $keywords = null; + + /** + * The \Title, in which context the keywords are managed + * @var \Title + */ + protected $title = null; + + /** + * Located in BsWidgetListHelper::__construct + * @param array $keywords + * @param \Title $title + * @return boolean + */ + public static function callback( &$keywords, $title ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $keywords, + $title + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param array $keywords + * @param \Title $title + */ + public function __construct( $context, $config, &$keywords, $title ) { + parent::__construct( $context, $config ); + + $this->keywords = &$keywords; + $this->title = $title; + } +} \ No newline at end of file diff --git a/src/Hook/BeforeNotificationsInit.php b/src/Hook/BeforeNotificationsInit.php new file mode 100644 index 0000000..c3cce41 --- /dev/null +++ b/src/Hook/BeforeNotificationsInit.php @@ -0,0 +1,55 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BeforeNotificationsInit + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BeforeNotificationsInit extends Hook { + + /** + * This is a BlueSpice hook (missing a BS prefix) + * Located in BSNotifications::init. Before the registered notification + * handlers get initialized. + * @return boolean + */ + public static function callback() { + $className = static::class; + $hookHandler = new $className( + null, + null + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + */ + public function __construct( $context, $config ) { + parent::__construct( $context, $config ); + } +} \ No newline at end of file diff --git a/src/Hook/BeforePageDisplay.php b/src/Hook/BeforePageDisplay.php index 61a7b58..4b5d0f8 100644 --- a/src/Hook/BeforePageDisplay.php +++ b/src/Hook/BeforePageDisplay.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook BeforePageDisplay + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/BsAdapterAjaxPingResult.php b/src/Hook/BsAdapterAjaxPingResult.php new file mode 100644 index 0000000..5517c5f --- /dev/null +++ b/src/Hook/BsAdapterAjaxPingResult.php @@ -0,0 +1,126 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BsAdapterAjaxPingResult + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BsAdapterAjaxPingResult extends Hook { + + /** + * Reference key of a single ping request + * @var string + */ + protected $reference = null; + + /** + * Params for a single ping request + * @var array + */ + protected $params = null; + + /** + * ID of the Article, in which context the ping was sent + * @var integer + */ + protected $articleId = null; + + /** + * Title text of the Article, in which context the ping was sent + * @var string + */ + protected $titleText = null; + + /** + * Namespace index of the Article, in which context the ping was sent + * @var integer + */ + protected $namespaceIndex = null; + + /** + * ID of the revision of the Article, in which context the ping was sent + * @var integer + */ + protected $revisionId = null; + + /** + * Result data of the single ping request + * @var array + */ + protected $singleResults = null; + + /** + * Located in BSApiPingTasks::task_ping. After each single ping request was + * processed. Return false to set the whole ping request's success to false + * and abort any further processing. + * @param string $reference + * @param array $params + * @param integer $articleId + * @param string $titleText + * @param integer $namespaceIndex + * @param integer $revisionId + * @param array $singleResults + * @return boolean + */ + public static function callback( $reference, $params, $articleId, $titleText, $namespaceIndex, $revisionId, &$singleResults ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $reference, + $params, + $articleId, + $titleText, + $namespaceIndex, + $revisionId, + $singleResults + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param string $reference + * @param array $params + * @param integer $articleId + * @param string $titleText + * @param integer $namespaceIndex + * @param integer $revisionId + * @param array $singleResults + */ + public function __construct( $context, $config, $reference, $params, $articleId, $titleText, $namespaceIndex, $revisionId, &$singleResults ) { + parent::__construct( $context, $config ); + + $this->reference = $reference; + $this->params = $params; + $this->articleId = $articleId; + $this->titleText = $titleText; + $this->namespaceIndex = $namespaceIndex; + $this->revisionId = $revisionId; + $this->singleResults = &$singleResults; + } +} \ No newline at end of file diff --git a/src/Hook/BsFoundationBeforeMakeGlobalVariablesScript.php b/src/Hook/BsFoundationBeforeMakeGlobalVariablesScript.php new file mode 100644 index 0000000..8264f87 --- /dev/null +++ b/src/Hook/BsFoundationBeforeMakeGlobalVariablesScript.php @@ -0,0 +1,74 @@ +<?php +/** + * Hook handler base class for BlueSpice hook + * BsFoundationBeforeMakeGlobalVariablesScript + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BsFoundationBeforeMakeGlobalVariablesScript extends Hook { + + /** + * + * @var \User + */ + protected $user = null; + + /** + * + * @var array + */ + protected $scriptSettings = null; + + /** + * Located in BsCoreHooks::onMakeGlobalVariablesScript, before the + * javascript globals for BlueSpice get added to the javascript globals + * @param \User $user + * @param array $scriptSettings + * @return boolean + */ + public static function callback( $user, &$scriptSettings ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $user, + $scriptSettings + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + */ + public function __construct( $context, $config, $user, &$scriptSettings ) { + parent::__construct( $context, $config ); + + $this->user = $user; + $this->scriptSettings = &$scriptSettings; + } +} \ No newline at end of file diff --git a/src/Hook/BsSettingsAfterSaveSettings.php b/src/Hook/BsSettingsAfterSaveSettings.php new file mode 100644 index 0000000..a79cfbe --- /dev/null +++ b/src/Hook/BsSettingsAfterSaveSettings.php @@ -0,0 +1,68 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BsSettingsAfterSaveSettings + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BsSettingsAfterSaveSettings extends Hook { + + /** + * Array of settings + * [ + * [ key => string ] + * [ value => serialized string ] + * ] + * @var array + */ + protected $settings = null; + + /** + * Located in BsConfig::saveSettings. After the settings have been saved. + * @param array $settings + * @return boolean + */ + public static function callback( $settings ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $settings + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param array $settings + */ + public function __construct( $context, $config, &$settings ) { + parent::__construct( $context, $config ); + + $this->settings = &$settings; + } +} \ No newline at end of file diff --git a/src/Hook/BsSettingsBeforeSaveSettings.php b/src/Hook/BsSettingsBeforeSaveSettings.php new file mode 100644 index 0000000..12d4b0c --- /dev/null +++ b/src/Hook/BsSettingsBeforeSaveSettings.php @@ -0,0 +1,69 @@ +<?php +/** + * Hook handler base class for BlueSpice hook BsSettingsBeforeSaveSettings + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class BsSettingsBeforeSaveSettings extends Hook { + + /** + * Array of Settings + * [ + * [ key => string ] + * [ value => serialized string ] + * ] + * @var array + */ + protected $settings = null; + + /** + * Located in BsConfig::saveSettings. Enables modification of the settings + * before they are saved. + * @param array $settings + * @return boolean + */ + public static function callback( &$settings ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $settings + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param array $settings + */ + public function __construct( $context, $config, &$settings ) { + parent::__construct( $context, $config ); + + $this->settings = &$settings; + } +} \ No newline at end of file diff --git a/src/Hook/LinkEnd.php b/src/Hook/LinkEnd.php index 46b3dd8..c3b6675 100644 --- a/src/Hook/LinkEnd.php +++ b/src/Hook/LinkEnd.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook LinkEnd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/LoadExtensionSchemaUpdates.php b/src/Hook/LoadExtensionSchemaUpdates.php index 72a074a..b062a6a 100644 --- a/src/Hook/LoadExtensionSchemaUpdates.php +++ b/src/Hook/LoadExtensionSchemaUpdates.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook LoadExtensionSchemaUpdates + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/MakeGlobalVariablesScript.php b/src/Hook/MakeGlobalVariablesScript.php index 0053520..cf792f0 100644 --- a/src/Hook/MakeGlobalVariablesScript.php +++ b/src/Hook/MakeGlobalVariablesScript.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook MakeGlobalVariablesScript + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; @@ -16,6 +41,7 @@ * @var \OutputPage */ protected $out = null; + /** * * @param array$vars diff --git a/src/Hook/PageContentSaveComplete.php b/src/Hook/PageContentSaveComplete.php index 9c3475c..b02a0d3 100644 --- a/src/Hook/PageContentSaveComplete.php +++ b/src/Hook/PageContentSaveComplete.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook PageContentSaveComplete + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/ParserFirstCallInit.php b/src/Hook/ParserFirstCallInit.php index 61a4811..e5fbb21 100644 --- a/src/Hook/ParserFirstCallInit.php +++ b/src/Hook/ParserFirstCallInit.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook ParserFirstCallInit + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/SkinTemplateNavigation.php b/src/Hook/SkinTemplateNavigation.php index 2623d15..701f6f2 100644 --- a/src/Hook/SkinTemplateNavigation.php +++ b/src/Hook/SkinTemplateNavigation.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook SkinTemplateNavigation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/SoftwareInfo.php b/src/Hook/SoftwareInfo.php index c4747ae..1b24ea7 100644 --- a/src/Hook/SoftwareInfo.php +++ b/src/Hook/SoftwareInfo.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook SoftwareInfo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/UserCan.php b/src/Hook/UserCan.php index 022f134..0709e74 100644 --- a/src/Hook/UserCan.php +++ b/src/Hook/UserCan.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook UserCan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/UserGetRights.php b/src/Hook/UserGetRights.php index e0f9e33..6d6decc 100644 --- a/src/Hook/UserGetRights.php +++ b/src/Hook/UserGetRights.php @@ -1,5 +1,30 @@ <?php - +/** + * Hook handler base class for MediaWiki hook UserGetRights + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Robert Vogel <vo...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ namespace BlueSpice\Hook; use BlueSpice\Hook; diff --git a/src/Hook/UserMiniProfileAfterInit.php b/src/Hook/UserMiniProfileAfterInit.php new file mode 100644 index 0000000..a07fd24 --- /dev/null +++ b/src/Hook/UserMiniProfileAfterInit.php @@ -0,0 +1,66 @@ +<?php +/** + * Hook handler base class for BlueSpice hook UserMiniProfileAfterInit + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * This file is part of BlueSpice MediaWiki + * For further information visit http://bluespice.com + * + * @author Patric Wirth <wi...@hallowelt.com> + * @package BlueSpiceFoundation + * @copyright Copyright (C) 2017 Hallo Welt! GmbH, All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ +namespace BlueSpice\Hook; +use BlueSpice\Hook; + +abstract class UserMiniProfileAfterInit extends Hook { + + /** + * + * @var \ViewUserMiniProfile + */ + protected $userMiniProfileView = null; + + /** + * This is a BlueSpice hook (missing the BS prefix) + * Located in \ViewUserMiniProfile::init. After the user miniprofile was + * initialized + * @param \ViewUserMiniProfile $userMiniProfileView + * @return boolean + */ + public static function callback( &$userMiniProfileView ) { + $className = static::class; + $hookHandler = new $className( + null, + null, + $userMiniProfileView + ); + return $hookHandler->process(); + } + + /** + * @param \IContextSource $context + * @param \Config $config + * @param \ViewUserMiniProfile $userMiniProfileView + */ + public function __construct( $context, $config, &$userMiniProfileView ) { + parent::__construct( $context, $config ); + + $this->userMiniProfileView = &$userMiniProfileView; + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/372353 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice07909cbb5fd4aa50e42d9bcfc392011b6ef12f Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth <wi...@hallowelt.biz> Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits