3 function wfSpecialFilepath( $par ) {
4 global $wgRequest, $wgOut;
6 $file = isset( $par ) ?
$par : $wgRequest->getText( 'file' );
8 $title = Title
::newFromText( $file, NS_IMAGE
);
10 if ( ! $title instanceof Title ||
$title->getNamespace() != NS_IMAGE
) {
11 $cform = new FilepathForm( $title );
14 $file = wfFindFile( $title );
15 if ( $file && $file->exists() ) {
16 $wgOut->redirect( $file->getURL() );
18 $wgOut->setStatusCode( 404 );
19 $cform = new FilepathForm( $title );
28 function FilepathForm( &$title ) {
29 $this->mTitle
=& $title;
33 global $wgOut, $wgTitle, $wgScript;
38 'id' => 'specialfilepath',
40 'action' => $wgScript,
44 wfHidden( 'title', $wgTitle->getPrefixedText() ) .
45 wfOpenElement( 'label' ) .
46 wfMsgHtml( 'filepath-page' ) .
53 'value' => is_object( $this->mTitle
) ?
$this->mTitle
->getText() : ''
61 'value' => wfMsgHtml( 'filepath-submit' )
65 wfCloseElement( 'label' ) .
66 wfCloseElement( 'form' )