Dvogel hallowelt has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405862 )
Change subject: Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge
......................................................................
Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge
fields in $template->data array
These fiels are used to provide data for BlueSpiceSkin. The functions
prevent notice if field is not definded before setting an value.
Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40
---
M src/Hook/SkinTemplateOutputPageBeforeExec.php
1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/62/405862/1
diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php b/src/Hook/SkinTemplateOutputPageBeforeExec.php
index 3cee34b..fb38635 100644
--- a/src/Hook/SkinTemplateOutputPageBeforeExec.php
+++ b/src/Hook/SkinTemplateOutputPageBeforeExec.php
@@ -71,4 +71,32 @@
$this->skin = $skin;
$this->template = &$template;
}
+
+
+ /**
+ *
+ * @param string $fieldName
+ * @param array $item
+ */
+ protected function mergeSkinDataArray( $fieldName, $item ) {
+ if( !isset( $this->template->data[$fieldName] ) ) {
+ $this->template->data[$fieldName] = [];
+ }
+
+ $this->template->data[$fieldName] += $item;
+ }
+
+ /**
+ *
+ * @param string $fieldName
+ * @param array $item
+ */
+ protected function appendSkinDataArray( $fieldName, $item ) {
+ if( !isset( $this->template->data[$fieldName] ) ) {
+ $this->template->data[$fieldName] = [];
+ }
+
+ $this->template->data[$fieldName][]= $item;
+ }
+
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/405862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Dvogel hallowelt <daniel.vogel@hallowelt.com>
_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
Change subject: Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge
......................................................................
Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge
fields in $template->data array
These fiels are used to provide data for BlueSpiceSkin. The functions
prevent notice if field is not definded before setting an value.
Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40
---
M src/Hook/SkinTemplateOutputPageBeforeExec.php
1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/62/405862/1
diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php b/src/Hook/SkinTemplateOutputPageBeforeExec.php
index 3cee34b..fb38635 100644
--- a/src/Hook/SkinTemplateOutputPageBeforeExec.php
+++ b/src/Hook/SkinTemplateOutputPageBeforeExec.php
@@ -71,4 +71,32 @@
$this->skin = $skin;
$this->template = &$template;
}
+
+
+ /**
+ *
+ * @param string $fieldName
+ * @param array $item
+ */
+ protected function mergeSkinDataArray( $fieldName, $item ) {
+ if( !isset( $this->template->data[$fieldName] ) ) {
+ $this->template->data[$fieldName] = [];
+ }
+
+ $this->template->data[$fieldName] += $item;
+ }
+
+ /**
+ *
+ * @param string $fieldName
+ * @param array $item
+ */
+ protected function appendSkinDataArray( $fieldName, $item ) {
+ if( !isset( $this->template->data[$fieldName] ) ) {
+ $this->template->data[$fieldName] = [];
+ }
+
+ $this->template->data[$fieldName][]= $item;
+ }
+
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/405862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Dvogel hallowelt <daniel.vogel@hallowelt.com>
_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits