Index: trunk/phase3/includes/Article.php |
— | — | @@ -883,9 +883,9 @@ |
884 | 884 | } |
885 | 885 | # Fetch content and check for errors |
886 | 886 | if( !$outputDone ) { |
887 | | - # If the article does not exist and was deleted, show the log |
| 887 | + # If the article does not exist and was deleted/moved, show the log |
888 | 888 | if( $this->getID() == 0 ) { |
889 | | - $this->showDeletionLog(); |
| 889 | + $this->showLogs(); |
890 | 890 | } |
891 | 891 | $text = $this->getContent(); |
892 | 892 | // For now, check also for ID until getContent actually returns |
— | — | @@ -1062,14 +1062,14 @@ |
1063 | 1063 | wfProfileOut( __METHOD__ ); |
1064 | 1064 | } |
1065 | 1065 | |
1066 | | - protected function showDeletionLog() { |
| 1066 | + protected function showLogs() { |
1067 | 1067 | global $wgUser, $wgOut; |
1068 | 1068 | $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut ); |
1069 | | - $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() ); |
| 1069 | + $pager = new LogPager( $loglist, array('move', 'delete'), false, $this->mTitle->getPrefixedText() ); |
1070 | 1070 | if( $pager->getNumRows() > 0 ) { |
1071 | 1071 | $pager->mLimit = 10; |
1072 | 1072 | $wgOut->addHTML( '<div class="mw-warning-with-logexcerpt">' ); |
1073 | | - $wgOut->addWikiMsg( 'deleted-notice' ); |
| 1073 | + $wgOut->addWikiMsg( 'moveddeleted-notice' ); |
1074 | 1074 | $wgOut->addHTML( |
1075 | 1075 | $loglist->beginLogEventsList() . |
1076 | 1076 | $pager->getBody() . |
— | — | @@ -1078,9 +1078,9 @@ |
1079 | 1079 | if( $pager->getNumRows() > 10 ) { |
1080 | 1080 | $wgOut->addHTML( $wgUser->getSkin()->link( |
1081 | 1081 | SpecialPage::getTitleFor( 'Log' ), |
1082 | | - wfMsgHtml( 'deletelog-fulllog' ), |
| 1082 | + wfMsgHtml( 'log-fulllog' ), |
1083 | 1083 | array(), |
1084 | | - array( 'type' => 'delete', 'page' => $this->mTitle->getPrefixedText() ) |
| 1084 | + array( 'page' => $this->mTitle->getPrefixedText() ) |
1085 | 1085 | ) ); |
1086 | 1086 | } |
1087 | 1087 | $wgOut->addHTML( '</div>' ); |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -707,9 +707,9 @@ |
708 | 708 | $wgOut->wrapWikiMsg( '<div class="mw-newarticletextanon">$1</div>', 'newarticletextanon' ); |
709 | 709 | } |
710 | 710 | } |
711 | | - # Give a notice if the user is editing a deleted page... |
| 711 | + # Give a notice if the user is editing a deleted/moved page... |
712 | 712 | if ( !$this->mTitle->exists() ) { |
713 | | - $this->showDeletionLog( $wgOut ); |
| 713 | + $this->showLogs( $wgOut ); |
714 | 714 | } |
715 | 715 | } |
716 | 716 | |
— | — | @@ -2435,20 +2435,20 @@ |
2436 | 2436 | } |
2437 | 2437 | |
2438 | 2438 | /** |
2439 | | - * If there are rows in the deletion log for this page, show them, |
| 2439 | + * If there are rows in the deletion/move log for this page, show them, |
2440 | 2440 | * along with a nice little note for the user |
2441 | 2441 | * |
2442 | 2442 | * @param OutputPage $out |
2443 | 2443 | */ |
2444 | | - protected function showDeletionLog( $out ) { |
| 2444 | + protected function showLogs( $out ) { |
2445 | 2445 | global $wgUser; |
2446 | 2446 | $loglist = new LogEventsList( $wgUser->getSkin(), $out ); |
2447 | | - $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() ); |
| 2447 | + $pager = new LogPager( $loglist, array('move', 'delete'), false, $this->mTitle->getPrefixedText() ); |
2448 | 2448 | $count = $pager->getNumRows(); |
2449 | 2449 | if ( $count > 0 ) { |
2450 | 2450 | $pager->mLimit = 10; |
2451 | 2451 | $out->addHTML( '<div class="mw-warning-with-logexcerpt">' ); |
2452 | | - $out->addWikiMsg( 'recreate-deleted-warn' ); |
| 2452 | + $out->addWikiMsg( 'recreate-moveddeleted-warn' ); |
2453 | 2453 | $out->addHTML( |
2454 | 2454 | $loglist->beginLogEventsList() . |
2455 | 2455 | $pager->getBody() . |
— | — | @@ -2457,11 +2457,9 @@ |
2458 | 2458 | if($count > 10){ |
2459 | 2459 | $out->addHTML( $wgUser->getSkin()->link( |
2460 | 2460 | SpecialPage::getTitleFor( 'Log' ), |
2461 | | - wfMsgHtml( 'deletelog-fulllog' ), |
| 2461 | + wfMsgHtml( 'log-fulllog' ), |
2462 | 2462 | array(), |
2463 | | - array( |
2464 | | - 'type' => 'delete', |
2465 | | - 'page' => $this->mTitle->getPrefixedText() ) ) ); |
| 2463 | + array( 'page' => $this->mTitle->getPrefixedText() ) ) ); |
2466 | 2464 | } |
2467 | 2465 | $out->addHTML( '</div>' ); |
2468 | 2466 | return true; |
Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -541,24 +541,28 @@ |
542 | 542 | /** |
543 | 543 | * Set the log reader to return only entries of the given type. |
544 | 544 | * Type restrictions enforced here |
545 | | - * @param $type String: A log type ('upload', 'delete', etc) |
| 545 | + * @param $type String or array: Log types ('upload', 'delete', etc) |
546 | 546 | */ |
547 | | - private function limitType( $type ) { |
| 547 | + private function limitType( $types ) { |
548 | 548 | global $wgLogRestrictions, $wgUser; |
| 549 | + // If $types is not an array, make it an array |
| 550 | + $types = (array)$types; |
549 | 551 | // Don't even show header for private logs; don't recognize it... |
550 | | - if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { |
551 | | - $type = ''; |
| 552 | + foreach ( $types as $type ) { |
| 553 | + if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { |
| 554 | + $types = array_diff( $types, array( $type ) ); |
| 555 | + } |
552 | 556 | } |
553 | | - // Don't show private logs to unpriviledged users. |
| 557 | + // Don't show private logs to unprivileged users. |
554 | 558 | // Also, only show them upon specific request to avoid suprises. |
555 | | - $audience = $type ? 'user' : 'public'; |
| 559 | + $audience = $types ? 'user' : 'public'; |
556 | 560 | $hideLogs = LogEventsList::getExcludeClause( $this->mDb, $audience ); |
557 | 561 | if( $hideLogs !== false ) { |
558 | 562 | $this->mConds[] = $hideLogs; |
559 | 563 | } |
560 | | - if( $type ) { |
561 | | - $this->type = $type; |
562 | | - $this->mConds['log_type'] = $type; |
| 564 | + if( $types ) { |
| 565 | + $this->type = $types; |
| 566 | + $this->mConds['log_type'] = $types; |
563 | 567 | } |
564 | 568 | } |
565 | 569 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1213,13 +1213,13 @@ |
1214 | 1214 | 'permissionserrors' => 'Permissions Errors', |
1215 | 1215 | 'permissionserrorstext' => 'You do not have permission to do that, for the following {{PLURAL:$1|reason|reasons}}:', |
1216 | 1216 | 'permissionserrorstext-withaction' => 'You do not have permission to $2, for the following {{PLURAL:$1|reason|reasons}}:', |
1217 | | -'recreate-deleted-warn' => "'''Warning: You are recreating a page that was previously deleted.''' |
| 1217 | +'recreate-moveddeleted-warn' => "'''Warning: You are recreating a page that was previously deleted.''' |
1218 | 1218 | |
1219 | 1219 | You should consider whether it is appropriate to continue editing this page. |
1220 | | -The deletion log for this page is provided here for convenience:", |
1221 | | -'deleted-notice' => 'This page has been deleted. |
1222 | | -The deletion log for the page is provided below for reference.', |
1223 | | -'deletelog-fulllog' => 'View full log', |
| 1220 | +The deletion and move log for this page are provided here for convenience:", |
| 1221 | +'moveddeleted-notice' => 'This page has been deleted. |
| 1222 | +The deletion and move log for the page are provided below for reference.', |
| 1223 | +'log-fulllog' => 'View full log', |
1224 | 1224 | 'edit-hook-aborted' => 'Edit aborted by hook. |
1225 | 1225 | It gave no explanation.', |
1226 | 1226 | 'edit-gone-missing' => 'Could not update the page. |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -171,6 +171,7 @@ |
172 | 172 | to Special:Version |
173 | 173 | * Added $wgExtPGAlteredFields to allow extensions to easily alter the data |
174 | 174 | type of columns when using the Postgres backend. |
| 175 | +* (bug 16950) Show move log when viewing/creating a deleted page |
175 | 176 | |
176 | 177 | |
177 | 178 | === Bug fixes in 1.15 === |