jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/377216 )

Change subject: BSFoundation: Added more hook base classes
......................................................................


BSFoundation: Added more hook base classes

* GetPreferences
* SkinTemplateOutputPageBeforeExec

Change-Id: Ia7d142fd81b506a7894f4b63cb2c730ea200bb3c
---
A src/Hook/GetPreferences.php
A src/Hook/SkinTemplateOutputPageBeforeExec.php
2 files changed, 150 insertions(+), 0 deletions(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/Hook/GetPreferences.php b/src/Hook/GetPreferences.php
new file mode 100644
index 0000000..6d4d341
--- /dev/null
+++ b/src/Hook/GetPreferences.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Hook handler base class for MediaWiki hook GetPreferences
+ *
+ * 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 GetPreferences extends Hook {
+
+       /**
+        *
+        * @var \User
+        */
+       protected $user = null;
+
+       /**
+        *
+        * @var array
+        */
+       protected $preferences = null;
+
+       /**
+        *
+        * @param \User $user
+        * @param array $preferences
+        * @return boolean
+        */
+       public static function callback( $user, &$preferences ) {
+               $className = static::class;
+               $hookHandler = new $className(
+                       null,
+                       null,
+                       $user,
+                       $preferences
+               );
+               return $hookHandler->process();
+       }
+
+       /**
+        *
+        * @param \IContextSource $context
+        * @param \Config $config
+        * @param \User $user
+        * @param array $preferences
+        */
+       public function __construct( $context, $config, &$user, &$preferences ) 
{
+               parent::__construct( $context, $config );
+
+               $this->user = $user;
+               $this->preferences = &$preferences;
+       }
+}
\ No newline at end of file
diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php 
b/src/Hook/SkinTemplateOutputPageBeforeExec.php
new file mode 100644
index 0000000..cc1ebad
--- /dev/null
+++ b/src/Hook/SkinTemplateOutputPageBeforeExec.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Hook handler base class for MediaWiki hook SkinTemplateOutputPageBeforeExec
+ *
+ * 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 SkinTemplateOutputPageBeforeExec extends Hook {
+
+       /**
+        *
+        * @var \SkinTemplate
+        */
+       protected $skin = null;
+
+       /**
+        *
+        * @var \QuickTemplate
+        */
+       protected $template = null;
+
+       /**
+        *
+        * @param \SkinTemplate $skin
+        * @param \QuickTemplate template
+        * @return boolean
+        */
+       public static function callback( &$skin, &$template ) {
+               $className = static::class;
+               $hookHandler = new $className(
+                       null,
+                       null,
+                       $skin,
+                       $template
+               );
+               return $hookHandler->process();
+       }
+
+       /**
+        *
+        * @param \IContextSource $context
+        * @param \Config $config
+        * @param \SkinTemplate $skin
+        * @param \QuickTemplate template
+        */
+       public function __construct( $context, $config, &$skin, &$template ) {
+               parent::__construct( $context, $config );
+
+               $this->skin = $skin;
+               $this->template = &$template;
+       }
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/377216
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7d142fd81b506a7894f4b63cb2c730ea200bb3c
Gerrit-PatchSet: 1
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

Reply via email to