Index: trunk/extensions/Translate/SpecialTranslations.php |
— | — | @@ -68,9 +68,14 @@ |
69 | 69 | * @param string $from dbKey we are starting listing at. |
70 | 70 | */ |
71 | 71 | function namespaceMessageForm( $namespace = NS_MAIN, $message = '' ) { |
72 | | - global $wgScript; |
| 72 | + global $wgContLang, $wgScript, $wgTranslateMessageNamespaces; |
73 | 73 | $t = $this->getTitle(); |
74 | 74 | |
| 75 | + $namespaces = new XmlSelect( 'namespace' ); |
| 76 | + foreach ($wgTranslateMessageNamespaces as $ns ) { |
| 77 | + $namespaces->addOption( $wgContLang->getFormattedNsText( $ns ), $ns ); |
| 78 | + } |
| 79 | + |
75 | 80 | $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
76 | 81 | $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
77 | 82 | $out .= Xml::hidden( 'title', $t->getPrefixedText() ); |
— | — | @@ -90,7 +95,7 @@ |
91 | 96 | Xml::label( wfMsg( 'namespace' ), 'namespace' ) . |
92 | 97 | "</td> |
93 | 98 | <td class='mw-input'>" . |
94 | | - Xml::namespaceSelector( $namespace, null ) . ' ' . |
| 99 | + $namespaces->getHTML() . ' ' . |
95 | 100 | Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
96 | 101 | "</td> |
97 | 102 | </tr>"; |
— | — | @@ -141,15 +146,15 @@ |
142 | 147 | ) |
143 | 148 | ); |
144 | 149 | |
145 | | - # FIXME: there probably is some smart way to get everything needed |
146 | | - # using TranslateUtils::getContents() only once. |
| 150 | + if( $res->numRows() ) { |
| 151 | + $titles = array(); |
| 152 | + foreach ( $res as $s ) { $titles[] = $s->page_title; } |
| 153 | + $pageInfo = TranslateUtils::getContents( $titles, $namespace ); |
147 | 154 | |
148 | | - $n = 0; |
149 | | - if( $res->numRows() > 0 ) { |
150 | 155 | // Adapted version of TranslateUtils:makeListing() by Nikerabbit |
151 | 156 | $out = TranslateUtils::tableHeader(); |
152 | 157 | |
153 | | - while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { |
| 158 | + foreach ( $res as $s ) { |
154 | 159 | $key = $s->page_title; |
155 | 160 | $t = Title::makeTitle( $s->page_namespace, $key ); |
156 | 161 | |
— | — | @@ -167,7 +172,6 @@ |
168 | 173 | $extra = ''; |
169 | 174 | |
170 | 175 | $leftColumn = $anchor . $tools['edit'] . $extra; |
171 | | - $pageInfo = TranslateUtils::getContents( array( $key ), $namespace ); |
172 | 176 | $out .= Xml::tags( 'tr', array( 'class' => 'def' ), |
173 | 177 | Xml::tags( 'td', null, $leftColumn ) . |
174 | 178 | Xml::tags( 'td', null, TranslateUtils::convertWhiteSpaceToHTML( $pageInfo[$key][0] ) ) |