Bsitu has uploaded a new change for review.
https://gerrit.wikimedia.org/r/102783
Change subject: Allow defining clousre for notification icon path
......................................................................
Allow defining clousre for notification icon path
In some cases, we need to add wgLang->getDir() for icon patch, but
wgLang is not yet fully initialized
Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
---
M formatters/BasicFormatter.php
M includes/EmailFormatter.php
2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/83/102783/1
diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php
index 8d3bce3..f9f1aa6 100644
--- a/formatters/BasicFormatter.php
+++ b/formatters/BasicFormatter.php
@@ -191,6 +191,10 @@
if ( !isset( $iconInfo['path'] ) || !$iconInfo['path']
) {
// Fallback in case icon is not configured;
mainly intended for 'site'
$iconInfo =
$wgEchoNotificationIcons['placeholder'];
+ } else {
+ if ( is_callable( $iconInfo['path'] ) ) {
+ $iconInfo['path'] = call_user_func(
$iconInfo['path'] );
+ }
}
$iconUrl = "$wgExtensionAssetsPath/{$iconInfo['path']}";
}
diff --git a/includes/EmailFormatter.php b/includes/EmailFormatter.php
index 61b23e3..fcfba2c 100644
--- a/includes/EmailFormatter.php
+++ b/includes/EmailFormatter.php
@@ -177,6 +177,10 @@
} else {
if ( !isset( $iconInfo['path'] ) || !$iconInfo['path']
) {
$iconInfo =
$wgEchoNotificationIcons['placeholder'];
+ } else {
+ if ( is_callable( $iconInfo['path'] ) ) {
+ $iconInfo['path'] = call_user_func(
$iconInfo['path'] );
+ }
}
$iconUrl = "$wgExtensionAssetsPath/{$iconInfo['path']}";
}
--
To view, visit https://gerrit.wikimedia.org/r/102783
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits