From: Pavel Selitskas
Date: Thu, 10 Jan 2013 01:20:38 +0000 (+0300)
Subject: Includes $query in SkinTemplate::tabAction() if $title doesn't exist
X-Git-Tag: 1.31.0-rc.0~21068
X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=13cecf96e9c4577c8ee8f711cff4d1bf57fd64ab;p=lhc%2Fweb%2Fwiklou.git
Includes $query in SkinTemplate::tabAction() if $title doesn't exist
Required by https://www.mediawiki.org/wiki/Extension:NamespaceRelations
* added PHPDoc for SkinTemplate::tabAction()
Change-Id: Ia9d3838d2adf3b8afbd5b142bb7a1ea3e1c31371
---
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php
index 5b7f168329..58d443a92d 100644
--- a/includes/SkinTemplate.php
+++ b/includes/SkinTemplate.php
@@ -690,12 +690,14 @@ class SkinTemplate extends Skin {
}
/**
- * TODO document
- * @param $title Title
- * @param $message String message key
- * @param $selected Bool
- * @param $query String
- * @param $checkEdit Bool
+ * Builds an array with tab definition
+ *
+ * @param Title $title page where the tab links to
+ * @param string|array $message message key or an array of message keys (will fall back)
+ * @param boolean $selected display the tab as selected
+ * @param string $query query string attached to tab URL
+ * @param boolean $checkEdit check if $title exists and mark with .new if one doesn't
+ *
* @return array
*/
function tabAction( $title, $message, $selected, $query = '', $checkEdit = false ) {
@@ -705,7 +707,11 @@ class SkinTemplate extends Skin {
}
if( $checkEdit && !$title->isKnown() ) {
$classes[] = 'new';
- $query = 'action=edit&redlink=1';
+ if ( $query !== '' ) {
+ $query = 'action=edit&redlink=1&' . $query;
+ } else {
+ $query = 'action=edit&redlink=1';
+ }
}
// wfMessageFallback will nicely accept $message as an array of fallbacks