* the file for a given filename, or the page for a given revision id.
*
* @ingroup SpecialPage
+ * @since 1.22
*/
class SpecialRedirect extends FormSpecialPage {
*/
function dispatch() {
// the various namespaces supported by Special:Redirect
- switch( $this->mType ) {
+ switch ( $this->mType ) {
case 'user':
$url = $this->dispatchUser();
break;
}
if ( !is_null( $this->mValue ) ) {
$this->getOutput()->setStatusCode( 404 );
+ // Message: redirect-not-exists
$msg = $this->getMessagePrefix() . '-not-exists';
return Status::newFatal( $msg );
}
$mp = $this->getMessagePrefix();
$ns = array(
// subpage => message
+ // Messages: redirect-user, redirect-revision, redirect-file
'user' => $mp . '-user',
'revision' => $mp . '-revision',
'file' => $mp . '-file',
$a = array();
$a['type'] = array(
'type' => 'select',
- 'label-message' => $mp . '-lookup',
+ 'label-message' => $mp . '-lookup', // Message: redirect-lookup
'options' => array(),
'default' => current( array_keys( $ns ) ),
);
- foreach( $ns as $n => $m ) {
+ foreach ( $ns as $n => $m ) {
$m = $this->msg( $m )->text();
$a['type']['options'][$m] = $n;
}
$a['value'] = array(
'type' => 'text',
- 'label-message' => $mp . '-value'
+ 'label-message' => $mp . '-value' // Message: redirect-value
);
// set the defaults according to the parsed subpage path
if ( !empty( $this->mType ) ) {
protected function alterForm( HTMLForm $form ) {
/* display summary at top of page */
$this->outputHeader();
- /* tweak label on submit button */
+ // tweak label on submit button
+ // Message: redirect-submit
$form->setSubmitTextMsg( $this->getMessagePrefix() . '-submit' );
/* submit form every time */
$form->setMethod( 'get' );