dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Swap SET and WHERE statements in ChangeTags::undefineTag
[lhc/web/wiklou.git]
/
includes
/
Linker.php
diff --git
a/includes/Linker.php
b/includes/Linker.php
index
89a6a10
..
56e377d
100644
(file)
--- a/
includes/Linker.php
+++ b/
includes/Linker.php
@@
-184,14
+184,13
@@
class Linker {
* @return string
*/
public static function getInvalidTitleDescription( IContextSource $context, $namespace, $title ) {
* @return string
*/
public static function getInvalidTitleDescription( IContextSource $context, $namespace, $title ) {
- global $wgContLang;
-
// First we check whether the namespace exists or not.
if ( MWNamespace::exists( $namespace ) ) {
if ( $namespace == NS_MAIN ) {
$name = $context->msg( 'blanknamespace' )->text();
} else {
// First we check whether the namespace exists or not.
if ( MWNamespace::exists( $namespace ) ) {
if ( $namespace == NS_MAIN ) {
$name = $context->msg( 'blanknamespace' )->text();
} else {
- $name = $wgContLang->getFormattedNsText( $namespace );
+ $name = MediaWikiServices::getInstance()->getContentLanguage()->
+ getFormattedNsText( $namespace );
}
return $context->msg( 'invalidtitle-knownnamespace', $namespace, $name, $title )->text();
} else {
}
return $context->msg( 'invalidtitle-knownnamespace', $namespace, $name, $title )->text();
} else {
@@
-904,7
+903,7
@@
class Linker {
* red if the user has no edits?
* @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
* and Linker::TOOL_LINKS_EMAIL).
* red if the user has no edits?
* @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
* and Linker::TOOL_LINKS_EMAIL).
- * @param int $edits User edit count (optional, for performance)
+ * @param int
|null
$edits User edit count (optional, for performance)
* @return string HTML fragment
*/
public static function userToolLinks(
* @return string HTML fragment
*/
public static function userToolLinks(
@@
-966,7
+965,7
@@
class Linker {
* @since 1.16.3
* @param int $userId User identifier
* @param string $userText User name or IP address
* @since 1.16.3
* @param int $userId User identifier
* @param string $userText User name or IP address
- * @param int $edits User edit count (optional, for performance)
+ * @param int
|null
$edits User edit count (optional, for performance)
* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
@@
-1227,10
+1226,11
@@
class Linker {
([^[]*) # 3. link trail (the text up until the next link)
/x',
function ( $match ) use ( $title, $local, $wikiId ) {
([^[]*) # 3. link trail (the text up until the next link)
/x',
function ( $match ) use ( $title, $local, $wikiId ) {
- global $wgContLang;
-
$medians = '(?:' . preg_quote( MWNamespace::getCanonicalName( NS_MEDIA ), '/' ) . '|';
$medians = '(?:' . preg_quote( MWNamespace::getCanonicalName( NS_MEDIA ), '/' ) . '|';
- $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):';
+ $medians .= preg_quote(
+ MediaWikiServices::getInstance()->getContentLanguage()->getNsText( NS_MEDIA ),
+ '/'
+ ) . '):';
$comment = $match[0];
$comment = $match[0];
@@
-1264,7
+1264,11
@@
class Linker {
$match[1] = substr( $match[1], 1 );
}
if ( $match[1] !== false && $match[1] !== '' ) {
$match[1] = substr( $match[1], 1 );
}
if ( $match[1] !== false && $match[1] !== '' ) {
- if ( preg_match( $wgContLang->linkTrail(), $match[3], $submatch ) ) {
+ if ( preg_match(
+ MediaWikiServices::getInstance()->getContentLanguage()->linkTrail(),
+ $match[3],
+ $submatch
+ ) ) {
$trail = $submatch[1];
} else {
$trail = "";
$trail = $submatch[1];
} else {
$trail = "";
@@
-1496,7
+1500,7
@@
class Linker {
* @return string
*/
public static function tocIndent() {
* @return string
*/
public static function tocIndent() {
- return "\n<ul>";
+ return "\n<ul>
\n
";
}
/**
}
/**
@@
-1527,9
+1531,9
@@
class Linker {
$classes .= " tocsection-$sectionIndex";
}
$classes .= " tocsection-$sectionIndex";
}
- //
\n
<li class="$classes"><a href="#$anchor"><span class="tocnumber">
+ // <li class="$classes"><a href="#$anchor"><span class="tocnumber">
// $tocnumber</span> <span class="toctext">$tocline</span></a>
// $tocnumber</span> <span class="toctext">$tocline</span></a>
- return
"\n" .
Html::openElement( 'li', [ 'class' => $classes ] )
+ return Html::openElement( 'li', [ 'class' => $classes ] )
. Html::rawElement( 'a',
[ 'href' => "#$anchor" ],
Html::element( 'span', [ 'class' => 'tocnumber' ], $tocnumber )
. Html::rawElement( 'a',
[ 'href' => "#$anchor" ],
Html::element( 'span', [ 'class' => 'tocnumber' ], $tocnumber )
@@
-1562,12
+1566,25
@@
class Linker {
$title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
return '<div id="toc" class="toc">'
$title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
return '<div id="toc" class="toc">'
+ . Html::element( 'input', [
+ 'type' => 'checkbox',
+ 'role' => 'button',
+ 'id' => 'toctogglecheckbox',
+ 'class' => 'toctogglecheckbox',
+ 'style' => 'display:none',
+ ] )
. Html::openElement( 'div', [
'class' => 'toctitle',
'lang' => $lang->getHtmlCode(),
'dir' => $lang->getDir(),
] )
. Html::openElement( 'div', [
'class' => 'toctitle',
'lang' => $lang->getHtmlCode(),
'dir' => $lang->getDir(),
] )
- . '<h2>' . $title . "</h2></div>\n"
+ . "<h2>$title</h2>"
+ . '<span class="toctogglespan">'
+ . Html::label( '', 'toctogglecheckbox', [
+ 'class' => 'toctogglelabel',
+ ] )
+ . '</span>'
+ . "</div>\n"
. $toc
. "</ul>\n</div>\n";
}
. $toc
. "</ul>\n</div>\n";
}
@@
-1642,8
+1659,7
@@
class Linker {
* @return array
*/
static function splitTrail( $trail ) {
* @return array
*/
static function splitTrail( $trail ) {
- global $wgContLang;
- $regex = $wgContLang->linkTrail();
+ $regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail();
$inside = '';
if ( $trail !== '' ) {
$m = [];
$inside = '';
if ( $trail !== '' ) {
$m = [];
@@
-1678,7
+1694,7
@@
class Linker {
* @since 1.16.3. $context added in 1.20. $options added in 1.21
*
* @param Revision $rev
* @since 1.16.3. $context added in 1.20. $options added in 1.21
*
* @param Revision $rev
- * @param IContextSource $context Context to use or null for the main context.
+ * @param IContextSource
|null
$context Context to use or null for the main context.
* @param array $options
* @return string
*/
* @param array $options
* @return string
*/