maintenance/interwiki.*: Replace Wikimedia Foundation wiki URL
[lhc/web/wiklou.git] / includes / Linker.php
index 89a6a10..f160fd6 100644 (file)
@@ -904,7 +904,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).
-        * @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(
@@ -966,7 +966,7 @@ class Linker {
         * @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 ) {
@@ -1496,7 +1496,7 @@ class Linker {
         * @return string
         */
        public static function tocIndent() {
-               return "\n<ul>";
+               return "\n<ul>\n";
        }
 
        /**
@@ -1527,9 +1527,9 @@ class Linker {
                        $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>
-               return "\n" . Html::openElement( 'li', [ 'class' => $classes ] )
+               return Html::openElement( 'li', [ 'class' => $classes ] )
                        . Html::rawElement( 'a',
                                [ 'href' => "#$anchor" ],
                                Html::element( 'span', [ 'class' => 'tocnumber' ], $tocnumber )
@@ -1562,12 +1562,25 @@ class Linker {
                $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(),
                        ] )
-                       . '<h2>' . $title . "</h2></div>\n"
+                       . "<h2>$title</h2>"
+                       . '<span class="toctogglespan">'
+                       . Html::label( '', 'toctogglecheckbox', [
+                               'class' => 'toctogglelabel',
+                       ] )
+                       . '</span>'
+                       . "</div>\n"
                        . $toc
                        . "</ul>\n</div>\n";
        }
@@ -1678,7 +1691,7 @@ class Linker {
         * @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
         */