Merge "Miscellaneous profiling fixes"
[lhc/web/wiklou.git] / includes / Linker.php
index d1a1ac0..6b0d444 100644 (file)
@@ -1858,13 +1858,19 @@ class Linker {
        /**
         * Returns HTML for the "templates used on this page" list.
         *
+        * Make an HTML list of templates, and then add a "More..." link at
+        * the bottom. If $more is null, do not add a "More..." link. If $more
+        * is a Title, make a link to that title and use it. If $more is a string,
+        * directly paste it in as the link.
+        *
         * @param $templates Array of templates from Article::getUsedTemplate
         * or similar
-        * @param $preview Boolean: whether this is for a preview
-        * @param $section Boolean: whether this is for a section edit
+        * @param bool $preview Whether this is for a preview
+        * @param bool $section Whether this is for a section edit
+        * @param Title|string|null $more A link for "More..." of the templates
         * @return String: HTML output
         */
-       public static function formatTemplates( $templates, $preview = false, $section = false ) {
+       public static function formatTemplates( $templates, $preview = false, $section = false, $more = null ) {
                wfProfileIn( __METHOD__ );
 
                $outText = '';
@@ -1921,6 +1927,13 @@ class Linker {
                                        . wfMessage( 'word-separator' )->escaped()
                                        . $protected . '</li>';
                        }
+
+                       if ( $more instanceof Title ) {
+                               $outText .= '<li>' . self::link( $more, wfMessage( 'moredotdotdot' ) ) . '</li>';
+                       } elseif ( $more ) {
+                               $outText .= "<li>$more</li>";
+                       }
+
                        $outText .= '</ul>';
                }
                wfProfileOut( __METHOD__ );