return;
}
- if ( !isset( $subPage ) || $subPage === '' ) {
+ if ( $subPage === null || $subPage === '' ) {
return $this->showUploads();
+ } else {
+ return $this->showUpload( $subPage );
}
-
- return $this->showUpload( $subPage );
}
* @param $key String: the key of a particular requested file
*/
public function showUpload( $key ) {
- global $wgOut;
-
// prevent callers from doing standard HTML output -- we'll take it from here
- $wgOut->disable();
+ $this->getOutput()->disable();
try {
$params = $this->parseKey( $key );
* @param Status : $status - the result of processRequest
*/
private function showUploads( $status = null ) {
- global $wgOut;
if ( $status === null ) {
$status = Status::newGood();
}
'default' => true,
'name' => 'clear',
)
- ), 'clearStashedUploads' );
+ ), $this->getContext(), 'clearStashedUploads' );
$form->setSubmitCallback( array( __CLASS__ , 'tryClearStashedUploads' ) );
$form->setTitle( $this->getTitle() );
$form->setSubmitText( wfMsg( 'uploadstash-clear' ) );
$this->getTitle( "file/$file" )->getLocalURL() ), $file )
);
}
- $wgOut->addHtml( Html::rawElement( 'ul', array(), $fileListItemsHtml ) );
+ $this->getOutput()->addHtml( Html::rawElement( 'ul', array(), $fileListItemsHtml ) );
$form->displayForm( $formResult );
- $wgOut->addHtml( Html::rawElement( 'p', array(), $refreshHtml ) );
+ $this->getOutput()->addHtml( Html::rawElement( 'p', array(), $refreshHtml ) );
} else {
- $wgOut->addHtml( Html::rawElement( 'p', array(),
+ $this->getOutput()->addHtml( Html::rawElement( 'p', array(),
Html::element( 'span', array(), wfMsg( 'uploadstash-nofiles' ) )
. ' '
. $refreshHtml