Switch some HTMLForms in special pages to OOUI
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 8390feb..6b0bf41 100644 (file)
@@ -160,7 +160,7 @@ class SpecialUpload extends SpecialPage {
                        throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
                }
 
-               $this->getOutput()->addHelpLink( 'Help:Managing files' );
+               $this->addHelpLink( 'Help:Managing files' );
 
                # Check permissions
                $user = $this->getUser();
@@ -787,7 +787,10 @@ class UploadForm extends HTMLForm {
        protected $mMaxUploadSize = array();
 
        public function __construct( array $options = array(), IContextSource $context = null ) {
-               $this->setContext( $context );
+               if ( $context instanceof IContextSource ) {
+                       $this->setContext( $context );
+               }
+
                $this->mWatch = !empty( $options['watch'] );
                $this->mForReUpload = !empty( $options['forreupload'] );
                $this->mSessionKey = isset( $options['sessionkey'] ) ? $options['sessionkey'] : '';
@@ -814,8 +817,8 @@ class UploadForm extends HTMLForm {
 
                # Add a link to edit MediaWik:Licenses
                if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-                       $licensesLink = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ),
+                       $licensesLink = Linker::linkKnown(
+                               $this->msg( 'licenses' )->inContentLanguage()->getTitle(),
                                $this->msg( 'licenses-edit' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )