&& !count( array_diff( array_keys( $this->context->request->getValues() ), array( 'action', 'title' ) ) ) )
{
if ( $this->context->title->getNamespace() == NS_SPECIAL ) {
- list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $this->context->title->getDBkey() );
+ list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $this->context->title->getDBkey() );
if ( $name ) {
$this->context->title = SpecialPage::getTitleFor( $name, $subpage );
}
// Special pages
} else if ( NS_SPECIAL == $this->context->title->getNamespace() ) {
// actions that need to be made when we have a special pages
- SpecialPage::executePath( $this->context->title, $this->context );
+ SpecialPageFactory::executePath( $this->context->title, $this->context );
} else {
// No match to special cases
wfProfileOut( __METHOD__ );
switch( $title->getNamespace() ) {
case NS_FILE:
$page = new ImagePage( $title );
+ break;
case NS_CATEGORY:
$page = new CategoryPage( $title );
+ break;
default:
$page = new Article( $title );
}
return;
}
- $action = $this->getAction();
+ $act = $this->getAction();
+
+ $action = Action::factory( $this->getAction(), $article );
+ if( $action instanceof Action ){
+ $action->show();
+ wfProfileOut( __METHOD__ );
+ return;
+ }
- switch( $action ) {
+ switch( $act ) {
case 'view':
$this->context->output->setSquidMaxage( $this->getVal( 'SquidMaxage' ) );
$article->view();
$raw->view();
wfProfileOut( __METHOD__ . '-raw' );
break;
- case 'watch':
- case 'unwatch':
case 'delete':
case 'revert':
case 'rollback':
case 'markpatrolled':
case 'render':
case 'deletetrackback':
- case 'purge':
- $article->$action();
- break;
- case 'print':
- $article->view();
+ $article->$act();
break;
case 'dublincore':
if ( !$this->getVal( 'EnableDublinCoreRdf' ) ) {
$rdf->show();
}
break;
- case 'credits':
- Credits::showPage( $article );
- break;
case 'submit':
if ( session_id() == '' ) {
// Send a cookie so anons get talk message notifications
$external = $this->context->request->getVal( 'externaledit' );
$section = $this->context->request->getVal( 'section' );
$oldid = $this->context->request->getVal( 'oldid' );
- if ( !$this->getVal( 'UseExternalEditor' ) || $action == 'submit' || $internal ||
+ if ( !$this->getVal( 'UseExternalEditor' ) || $act == 'submit' || $internal ||
$section || $oldid || ( !$this->context->user->getOption( 'externaleditor' ) && !$external ) ) {
$editor = new EditPage( $article );
$editor->submit();
break;
case 'revisiondelete':
// For show/hide submission from history page
- $special = SpecialPage::getPage( 'Revisiondelete' );
- $special->execute( '' );
- break;
- case 'revisionmove':
- // For revision move submission from history page
- $special = SpecialPage::getPage( 'RevisionMove' );
+ $special = SpecialPageFactory::getPage( 'Revisiondelete' );
$special->execute( '' );
break;
default:
- if ( wfRunHooks( 'UnknownAction', array( $action, $article ) ) ) {
+ if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) {
$this->context->output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
}