merging latest master
[lhc/web/wiklou.git] / includes / specials / SpecialExport.php
index 3951f06..b4294b3 100644 (file)
@@ -93,6 +93,13 @@ class SpecialExport extends SpecialPage {
                elseif( $request->getCheck( 'exportall' ) && $wgExportAllowAll ) {
                        $this->doExport = true;
                        $exportall = true;
+
+                       /* Although $page and $history are not used later on, we
+                       nevertheless set them to avoid that PHP notices about using
+                       undefined variables foul up our XML output (see call to
+                       doExport(...) further down) */
+                       $page = '';
+                       $history = '';
                }
                elseif( $request->wasPosted() && $par == '' ) {
                        $page = $request->getText( 'pages' );
@@ -185,7 +192,16 @@ class SpecialExport extends SpecialPage {
                $form .= Xml::submitButton( $this->msg( 'export-addcat' )->text(), array( 'name' => 'addcat' ) ) . '<br />';
 
                if ( $wgExportFromNamespaces ) {
-                       $form .= Xml::namespaceSelector( $nsindex, null, 'nsindex', $this->msg( 'export-addnstext' )->text() ) . '&#160;';
+                       $form .= Html::namespaceSelector(
+                               array(
+                                       'selected' => $nsindex,
+                                       'label' => $this->msg( 'export-addnstext' )->text()
+                               ), array(
+                                       'name'  => 'nsindex',
+                                       'id'    => 'namespace',
+                                       'class' => 'namespaceselector',
+                               )
+                       ) . '&#160;';
                        $form .= Xml::submitButton( $this->msg( 'export-addns' )->text(), array( 'name' => 'addns' ) ) . '<br />';
                }
 
@@ -439,7 +455,7 @@ class SpecialExport extends SpecialPage {
        private function getTemplates( $inputPages, $pageSet ) {
                return $this->getLinks( $inputPages, $pageSet,
                        'templatelinks',
-                       array( 'tl_namespace AS namespace', 'tl_title AS title' ),
+                       array( 'namespace' => 'tl_namespace', 'title' => 'tl_title' ),
                        array( 'page_id=tl_from' )
                );
        }
@@ -481,7 +497,7 @@ class SpecialExport extends SpecialPage {
                for( ; $depth > 0; --$depth ) {
                        $pageSet = $this->getLinks(
                                $inputPages, $pageSet, 'pagelinks',
-                               array( 'pl_namespace AS namespace', 'pl_title AS title' ),
+                               array( 'namespace' => 'pl_namespace', 'title' => 'pl_title' ),
                                array( 'page_id=pl_from' )
                        );
                        $inputPages = array_keys( $pageSet );
@@ -503,7 +519,7 @@ class SpecialExport extends SpecialPage {
                        $inputPages,
                        $pageSet,
                        'imagelinks',
-                       array( NS_FILE . ' AS namespace', 'il_to AS title' ),
+                       array( 'namespace' => NS_FILE, 'title' => 'il_to' ),
                        array( 'page_id=il_from' )
                );
        }