Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/52619
Change subject: Do not show export tab if exports are disabled
......................................................................
Do not show export tab if exports are disabled
Bug: 40923
Change-Id: I45bacb384632be651331c738b9e83cc9c1383661
---
M specials/SpecialTranslate.php
1 file changed, 17 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/19/52619/1
diff --git a/specials/SpecialTranslate.php b/specials/SpecialTranslate.php
index 84d353c..e19f2d1 100644
--- a/specials/SpecialTranslate.php
+++ b/specials/SpecialTranslate.php
@@ -819,11 +819,23 @@
'href' => $messagegroupstats->getLocalUrl( $params ),
'class' => $alias === 'MessageGroupStats' ? 'selected'
: '',
);
- $tabs['views']['export'] = array(
- 'text' => wfMessage( 'translate-taction-export'
)->text(),
- 'href' => $translate->getLocalUrl( array( 'taction' =>
'export' ) + $params ),
- 'class' => $alias === 'Translate' && $taction ===
'export' ? 'selected' : '',
- );
+
+ // Kind of hackish, but works for now
+ global $wgTranslateTasks;
+ foreach ( array_keys( $wgTranslateTasks ) as $taskname ) {
+ if ( !preg_match( '/^export-/', $taskname ) ) {
+ continue;
+ }
+
+ $tabs['views']['export'] = array(
+ 'text' => wfMessage( 'translate-taction-export'
)->text(),
+ 'href' => $translate->getLocalUrl( array(
'taction' => 'export' ) + $params ),
+ 'class' => $alias === 'Translate' && $taction
=== 'export' ? 'selected' : '',
+ );
+
+ // We only need the tab to apper once ;)
+ break;
+ }
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/52619
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I45bacb384632be651331c738b9e83cc9c1383661
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits