* Use Xml:: and so
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 10 May 2008 11:56:02 +0000 (11:56 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 10 May 2008 11:56:02 +0000 (11:56 +0000)
includes/ImagePage.php
languages/messages/MessagesEn.php

index fa063db..9b48d1b 100644 (file)
@@ -314,22 +314,30 @@ class ImagePage extends Article {
                                        }
 
                                        global $wgScript;
-                                       $select = '<form name="pageselector" action="' .
-                                               htmlspecialchars( $wgScript ) .
-                                               '" method="get" onchange="document.pageselector.submit();">' .
-                                               Xml::hidden( 'title', $this->getTitle()->getPrefixedDbKey() );
-                                       $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
-                                               ' <select id="pageselector" name="page">';
+
+                                       $formParams = array(
+                                               'name' => 'pageselector',
+                                               'action' => $wgScript,
+                                               'onchange' => 'document.pageselector.submit();',
+                                       );
+
+                                       $option = array();
                                        for ( $i=1; $i <= $count; $i++ ) {
-                                               $select .= Xml::option( $wgLang->formatNum( $i ), $i,
-                                                       $i == $page );
+                                               $options[] = Xml::option( $wgLang->formatNum($i), $i, $i == $page );
                                        }
-                                       $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
-                                               '<input type="submit" value="' .
-                                               htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
-
-                                       $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
-                                               "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
+                                       $select = Xml::tags( 'select',
+                                               array( 'id' => 'pageselector', 'name' => 'page' ),
+                                               implode( "\n", $options ) );
+
+                                       $wgOut->addHTML(
+                                               '</td><td><div class="multipageimagenavbox">' .
+                                               Xml::openElement( 'form', $formParams ) .
+                                               Xml::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) .
+                                               wfMsgExt( 'imgmultigoto', array( 'parseinline', 'replaceafter' ), $select ) .
+                                               Xml::submitButton( wfMsg( 'imgmultigo' ) ) .
+                                               Xml::closeElement( 'form' ) .
+                                               "<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>"
+                                       );
                                }
                        } else {
                                #if direct link is allowed but it's not a renderable image, show an icon.
index acca2e2..5cab668 100644 (file)
@@ -3181,8 +3181,7 @@ $1',
 'imgmultipageprev' => '← previous page',
 'imgmultipagenext' => 'next page →',
 'imgmultigo'       => 'Go!',
-'imgmultigotopre'  => 'Go to page',
-'imgmultigotopost' => '', # only translate this message to other languages if you have to change it
+'imgmultigoto'  => 'Go to page $1',
 
 # Table pager
 'ascending_abbrev'         => 'asc',