jenkins-bot has submitted this change and it was merged. ( 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(-) Approvals: Pwirth: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php b/src/Hook/SkinTemplateOutputPageBeforeExec.php index 3cee34b..649f60d 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] = array_merge( $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: merged Gerrit-Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Dvogel hallowelt <daniel.vo...@hallowelt.com> Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Pwirth <wi...@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