to Special:Version
* Added $wgExtPGAlteredFields to allow extensions to easily alter the data
type of columns when using the Postgres backend.
+* (bug 16950) Show move log when viewing/creating a deleted page
=== Bug fixes in 1.15 ===
}
# Fetch content and check for errors
if( !$outputDone ) {
- # If the article does not exist and was deleted, show the log
+ # If the article does not exist and was deleted/moved, show the log
if( $this->getID() == 0 ) {
- $this->showDeletionLog();
+ $this->showLogs();
}
$text = $this->getContent();
// For now, check also for ID until getContent actually returns
wfProfileOut( __METHOD__ );
}
- protected function showDeletionLog() {
+ protected function showLogs() {
global $wgUser, $wgOut;
$loglist = new LogEventsList( $wgUser->getSkin(), $wgOut );
- $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() );
+ $pager = new LogPager( $loglist, array('move', 'delete'), false, $this->mTitle->getPrefixedText() );
if( $pager->getNumRows() > 0 ) {
$pager->mLimit = 10;
$wgOut->addHTML( '<div class="mw-warning-with-logexcerpt">' );
- $wgOut->addWikiMsg( 'deleted-notice' );
+ $wgOut->addWikiMsg( 'moveddeleted-notice' );
$wgOut->addHTML(
$loglist->beginLogEventsList() .
$pager->getBody() .
if( $pager->getNumRows() > 10 ) {
$wgOut->addHTML( $wgUser->getSkin()->link(
SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'deletelog-fulllog' ),
+ wfMsgHtml( 'log-fulllog' ),
array(),
- array( 'type' => 'delete', 'page' => $this->mTitle->getPrefixedText() )
+ array( 'page' => $this->mTitle->getPrefixedText() )
) );
}
$wgOut->addHTML( '</div>' );
$wgOut->wrapWikiMsg( '<div class="mw-newarticletextanon">$1</div>', 'newarticletextanon' );
}
}
- # Give a notice if the user is editing a deleted page...
+ # Give a notice if the user is editing a deleted/moved page...
if ( !$this->mTitle->exists() ) {
- $this->showDeletionLog( $wgOut );
+ $this->showLogs( $wgOut );
}
}
}
/**
- * If there are rows in the deletion log for this page, show them,
+ * If there are rows in the deletion/move log for this page, show them,
* along with a nice little note for the user
*
* @param OutputPage $out
*/
- protected function showDeletionLog( $out ) {
+ protected function showLogs( $out ) {
global $wgUser;
$loglist = new LogEventsList( $wgUser->getSkin(), $out );
- $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() );
+ $pager = new LogPager( $loglist, array('move', 'delete'), false, $this->mTitle->getPrefixedText() );
$count = $pager->getNumRows();
if ( $count > 0 ) {
$pager->mLimit = 10;
$out->addHTML( '<div class="mw-warning-with-logexcerpt">' );
- $out->addWikiMsg( 'recreate-deleted-warn' );
+ $out->addWikiMsg( 'recreate-moveddeleted-warn' );
$out->addHTML(
$loglist->beginLogEventsList() .
$pager->getBody() .
if($count > 10){
$out->addHTML( $wgUser->getSkin()->link(
SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'deletelog-fulllog' ),
+ wfMsgHtml( 'log-fulllog' ),
array(),
- array(
- 'type' => 'delete',
- 'page' => $this->mTitle->getPrefixedText() ) ) );
+ array( 'page' => $this->mTitle->getPrefixedText() ) ) );
}
$out->addHTML( '</div>' );
return true;
/**
* Set the log reader to return only entries of the given type.
* Type restrictions enforced here
- * @param $type String: A log type ('upload', 'delete', etc)
+ * @param $type String or array: Log types ('upload', 'delete', etc)
*/
- private function limitType( $type ) {
+ private function limitType( $types ) {
global $wgLogRestrictions, $wgUser;
+ // If $types is not an array, make it an array
+ $types = (array)$types;
// Don't even show header for private logs; don't recognize it...
- if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
- $type = '';
+ foreach ( $types as $type ) {
+ if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
+ $types = array_diff( $types, array( $type ) );
+ }
}
- // Don't show private logs to unpriviledged users.
+ // Don't show private logs to unprivileged users.
// Also, only show them upon specific request to avoid suprises.
- $audience = $type ? 'user' : 'public';
+ $audience = $types ? 'user' : 'public';
$hideLogs = LogEventsList::getExcludeClause( $this->mDb, $audience );
if( $hideLogs !== false ) {
$this->mConds[] = $hideLogs;
}
- if( $type ) {
- $this->type = $type;
- $this->mConds['log_type'] = $type;
+ if( $types ) {
+ $this->type = $types;
+ $this->mConds['log_type'] = $types;
}
}
'permissionserrors' => 'Permissions Errors',
'permissionserrorstext' => 'You do not have permission to do that, for the following {{PLURAL:$1|reason|reasons}}:',
'permissionserrorstext-withaction' => 'You do not have permission to $2, for the following {{PLURAL:$1|reason|reasons}}:',
-'recreate-deleted-warn' => "'''Warning: You are recreating a page that was previously deleted.'''
+'recreate-moveddeleted-warn' => "'''Warning: You are recreating a page that was previously deleted.'''
You should consider whether it is appropriate to continue editing this page.
-The deletion log for this page is provided here for convenience:",
-'deleted-notice' => 'This page has been deleted.
-The deletion log for the page is provided below for reference.',
-'deletelog-fulllog' => 'View full log',
+The deletion and move log for this page are provided here for convenience:",
+'moveddeleted-notice' => 'This page has been deleted.
+The deletion and move log for the page are provided below for reference.',
+'log-fulllog' => 'View full log',
'edit-hook-aborted' => 'Edit aborted by hook.
It gave no explanation.',
'edit-gone-missing' => 'Could not update the page.