* Add form to RCLinked and add to sp:specialpages
[lhc/web/wiklou.git] / includes / SpecialImport.php
index 1d1bc63..5557b0a 100644 (file)
@@ -104,7 +104,7 @@ function wfSpecialImport( $page = '' ) {
                        Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action ) ) .
                        Xml::hidden( 'action', 'submit' ) .
                        Xml::hidden( 'source', 'upload' ) .
-                       "<input type='file' name='xmlimport' value='' size='30' />" . // No Xml function for type=file? Todo?
+                       Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' .
                        Xml::submitButton( wfMsg( 'uploadbtn' ) ) . 
                        Xml::closeElement( 'form' ) .
                        Xml::closeElement( 'fieldset' )
@@ -123,15 +123,14 @@ function wfSpecialImport( $page = '' ) {
                        wfMsgExt( 'import-interwiki-text', array( 'parse' ) ) .
                        Xml::hidden( 'action', 'submit' ) .
                        Xml::hidden( 'source', 'interwiki' ) .
-                       Xml::openElement( 'table' ) .
+                       Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) .
                        "<tr>
                                <td>" .
                                        Xml::openElement( 'select', array( 'name' => 'interwiki' ) )
                );
                foreach( $wgImportSources as $prefix ) {
-                       $iw = htmlspecialchars( $prefix );
-                       $selected = ($interwiki === $prefix) ? ' selected="selected"' : '';
-                       $wgOut->addHTML( Xml::option( $iw, $iw, $selected ) );
+                       $selected = ( $interwiki === $prefix ) ? ' selected="selected"' : '';
+                       $wgOut->addHTML( Xml::option( $prefix, $prefix, $selected ) );
                }
                $wgOut->addHTML(
                                        Xml::closeElement( 'select' ) .
@@ -359,7 +358,7 @@ class WikiRevision {
                }
 
                // avoid memory leak...?
-               $linkCache =& LinkCache::singleton();
+               $linkCache = LinkCache::singleton();
                $linkCache->clear();
 
                $article = new Article( $this->title );
@@ -451,7 +450,7 @@ class WikiRevision {
                // it may also create a page without our desire, also wrong potentially.
                // and, it will record a *current* upload, but we might want an archive version here
                
-               $file = wfFindFile( $this->getTitle() );
+               $file = wfLocalFile( $this->getTitle() );
                if( !$file ) {
                        var_dump( $file );
                        wfDebug( "IMPORT: Bad file. :(\n" );