fix hardcoded limit on titles in Special:Export
[lhc/web/wiklou.git] / includes / specials / SpecialExport.php
index 642ea69..f9b5050 100644 (file)
@@ -65,7 +65,10 @@ class SpecialExport extends SpecialPage {
                                         */
                                        $catpages = $this->getPagesFromCategory( $t );
                                        if ( $catpages ) {
-                                               $page .= "\n" . implode( "\n", $catpages );
+                                               if ( $page !== '' ) {
+                                                       $page .= "\n";
+                                               }
+                                               $page .= implode( "\n", $catpages );
                                        }
                                }
                        }
@@ -232,8 +235,8 @@ class SpecialExport extends SpecialPage {
                        'textarea' => array(
                                'class' => 'HTMLTextAreaField',
                                'name' => 'pages',
+                               'label-message' => 'export-manual',
                                'nodata' => true,
-                               'cols' => 40,
                                'rows' => 10,
                                'default' => $page,
                        ),
@@ -298,7 +301,7 @@ class SpecialExport extends SpecialPage {
                        );
                }
 
-               $htmlForm = HTMLForm::factory( 'div', $formDescriptor, $this->getContext() );
+               $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
                $htmlForm->setSubmitTextMsg( 'export-submit' );
                $htmlForm->prepareForm()->displayForm( false );
                $this->addHelpLink( 'Help:Export' );
@@ -415,6 +418,8 @@ class SpecialExport extends SpecialPage {
        private function getPagesFromCategory( $title ) {
                global $wgContLang;
 
+               $maxPages = $this->getConfig()->get( 'ExportPagelistLimit' );
+
                $name = $title->getDBkey();
 
                $dbr = wfGetDB( DB_SLAVE );
@@ -423,7 +428,7 @@ class SpecialExport extends SpecialPage {
                        array( 'page_namespace', 'page_title' ),
                        array( 'cl_from=page_id', 'cl_to' => $name ),
                        __METHOD__,
-                       array( 'LIMIT' => '5000' )
+                       array( 'LIMIT' => $maxPages )
                );
 
                $pages = array();
@@ -448,13 +453,15 @@ class SpecialExport extends SpecialPage {
        private function getPagesFromNamespace( $nsindex ) {
                global $wgContLang;
 
+               $maxPages = $this->getConfig()->get( 'ExportPagelistLimit' );
+
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select(
                        'page',
                        array( 'page_namespace', 'page_title' ),
                        array( 'page_namespace' => $nsindex ),
                        __METHOD__,
-                       array( 'LIMIT' => '5000' )
+                       array( 'LIMIT' => $maxPages )
                );
 
                $pages = array();