Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -694,6 +694,10 @@ |
695 | 695 | $title: title of page being edited |
696 | 696 | &$msg: localization message name, overridable. Default is either 'copyrightwarning' or 'copyrightwarning2' |
697 | 697 | |
| 698 | +'EditPageNoSuchSection': When a section edit request is given for an non-existent section |
| 699 | +&$editpage: The current EditPage object |
| 700 | +&$res: the HTML of the error text |
| 701 | + |
698 | 702 | 'EditPageTosSummary': Give a chance for site and per-namespace customizations |
699 | 703 | of terms of service summary link that might exist separately from the copyright |
700 | 704 | notice. |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2056,7 +2056,10 @@ |
2057 | 2057 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
2058 | 2058 | $wgOut->setArticleRelated( false ); |
2059 | 2059 | |
2060 | | - $wgOut->addWikiMsg( 'nosuchsectiontext', $this->section ); |
| 2060 | + $res = wfMsgExt( 'nosuchsectiontext', 'parse', $this->section ); |
| 2061 | + wfRunHooks( 'EditPageNoSuchSection', array( &$this, &$res ) ); |
| 2062 | + $wgOut->addHTML( $res ); |
| 2063 | + |
2061 | 2064 | $wgOut->returnToMain( false, $this->mTitle ); |
2062 | 2065 | } |
2063 | 2066 | |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -430,6 +430,8 @@ |
431 | 431 | $wgHooks['SkinTemplateNavigation'][] = 'FlaggedRevsHooks::setNavigation'; |
432 | 432 | # Add notice tags to edit view |
433 | 433 | $wgHooks['EditPage::showEditForm:initial'][] = 'FlaggedRevsHooks::addToEditView'; |
| 434 | +# Add draft link to section edit error |
| 435 | +$wgHooks['EditPageNoSuchSection'][] = 'FlaggedRevsHooks::onNoSuchSection'; |
434 | 436 | # Add notice tags to history |
435 | 437 | $wgHooks['PageHistoryBeforeList'][] = 'FlaggedRevsHooks::addToHistView'; |
436 | 438 | # Add review form and visiblity settings link |
— | — | @@ -452,6 +454,7 @@ |
453 | 455 | $wgHooks['ContributionsLineEnding'][] = 'FlaggedRevsHooks::addToContribsLine'; |
454 | 456 | # Page review on edit |
455 | 457 | $wgHooks['ArticleUpdateBeforeRedirect'][] = 'FlaggedRevsHooks::injectReviewDiffURLParams'; |
| 458 | +# Diff-to-stable |
456 | 459 | $wgHooks['DiffViewHeader'][] = 'FlaggedRevsHooks::onDiffViewHeader'; |
457 | 460 | # Autoreview stuff |
458 | 461 | $wgHooks['EditPage::showEditForm:fields'][] = 'FlaggedRevsHooks::addRevisionIDField'; |
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | 'revreview-edited' => '\'\'\'Changes will be [[{{MediaWiki:Validationpage}}|published]] once an authorised user [[{{MediaWiki:Validationpage}}|reviews]] them.\'\'\' |
102 | 102 | The \'\'draft\'\', shown below, contains [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 pending {{PLURAL:$2|change|changes}}].', |
103 | 103 | 'revreview-flag' => 'Review this revision', |
104 | | - 'revreview-reflag' => 'Re-review/unreview this revision', |
| 104 | + 'revreview-reflag' => 'Re-review this revision', |
105 | 105 | 'revreview-invalid' => '\'\'\'Invalid target:\'\'\' no [[{{MediaWiki:Validationpage}}|reviewed]] revision corresponds to the given ID.', |
106 | 106 | 'revreview-legend' => 'Rate revision content', |
107 | 107 | 'revreview-log' => 'Comment:', |
— | — | @@ -119,6 +119,8 @@ |
120 | 120 | [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}].', |
121 | 121 | 'revreview-pending-quality' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. The [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft] contains |
122 | 122 | [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}].', |
| 123 | + 'revreview-pending-nosection' => 'Try viewing the [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} draft], which includes |
| 124 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $2 pending {{PLURAL:$2|change|changes}}], to see if the section was moved or deleted.', |
123 | 125 | 'revreview-noflagged' => 'There are no reviewed revisions of this page, so it may \'\'\'not\'\'\' have been [[{{MediaWiki:Validationpage}}|checked]] for quality.', |
124 | 126 | 'revreview-note' => '[[User:$1|$1]] made the following notes [[{{MediaWiki:Validationpage}}|reviewing]] this revision:', |
125 | 127 | 'revreview-notes' => 'Observations or notes to display:', |
— | — | @@ -186,7 +188,6 @@ |
187 | 189 | 'revreview-visibility3' => '\'\'\'This page does not have a [[{{MediaWiki:Validationpage}}|stable version]]; page stability settings can be [{{fullurl:{{#Special:Stabilization}}|page={{FULLPAGENAMEE}}}} configured].\'\'\'', |
188 | 190 | 'revreview-revnotfound' => 'The old revision of the page you asked for could not be found. |
189 | 191 | Please check the URL you used to access this page.', |
190 | | - #'right-autopatrol' => 'Automatically mark revisions in non-main namespaces patrolled', |
191 | 192 | 'right-autoreview' => 'Automatically mark revisions as sighted', |
192 | 193 | 'right-movestable' => 'Move stable pages', |
193 | 194 | 'right-review' => 'Mark revisions as sighted', |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsXML.php |
— | — | @@ -441,7 +441,7 @@ |
442 | 442 | * @param FlaggedRevision $frev |
443 | 443 | * @param int $revsSince |
444 | 444 | * @returns string |
445 | | - * Creates "there are x pending edits" message in a div |
| 445 | + * Creates "stable rev reviewed on"/"x pending edits" message |
446 | 446 | */ |
447 | 447 | public static function pendingEditNotice( $flaggedArticle, $frev, $revsSince ) { |
448 | 448 | global $wgLang; |
— | — | @@ -449,10 +449,9 @@ |
450 | 450 | return ''; // only for pending edits |
451 | 451 | } |
452 | 452 | $flags = $frev->getTags(); |
453 | | - $quality = FlaggedRevs::isQuality( $flags ); |
454 | 453 | $time = $wgLang->date( $frev->getTimestamp(), true ); |
455 | 454 | # Add message text for pending edits |
456 | | - $msg = $quality |
| 455 | + $msg = FlaggedRevs::isQuality( $flags ) |
457 | 456 | ? 'revreview-pending-quality' |
458 | 457 | : 'revreview-pending-basic'; |
459 | 458 | $tag = wfMsgExt( $msg, array( 'parseinline' ), $frev->getRevId(), $time, $revsSince ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1605,6 +1605,12 @@ |
1606 | 1606 | return true; |
1607 | 1607 | } |
1608 | 1608 | |
| 1609 | + public static function onNoSuchSection( &$editPage, &$s ) { |
| 1610 | + $view = FlaggedArticleView::singleton(); |
| 1611 | + $view->addToNoSuchSection( $editPage, $s ); |
| 1612 | + return true; |
| 1613 | + } |
| 1614 | + |
1609 | 1615 | public static function addToHistView( &$article ) { |
1610 | 1616 | $view = FlaggedArticleView::singleton(); |
1611 | 1617 | $view->addToHistView(); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -842,6 +842,21 @@ |
843 | 843 | } |
844 | 844 | return $s; |
845 | 845 | } |
| 846 | + |
| 847 | + public function addToNoSuchSection( $editPage, &$s ) { |
| 848 | + $this->load(); |
| 849 | + if( !$this->article->isReviewable() ) { |
| 850 | + return true; // nothing to do |
| 851 | + } |
| 852 | + $frev = $this->article->getStableRev(); |
| 853 | + if( $frev ) { |
| 854 | + $revsSince = FlaggedRevs::getRevCountSince( $this->article, $frev->getRevId() ); |
| 855 | + $s .= "<div class='flaggedrevs_editnotice plainlinks'>" . |
| 856 | + wfMsgExt( 'revreview-pending-nosection', array( 'parseinline' ), |
| 857 | + $frev->getRevId(), $revsSince ) . "</div>"; |
| 858 | + } |
| 859 | + return true; |
| 860 | + } |
846 | 861 | |
847 | 862 | /** |
848 | 863 | * Add unreviewed pages links |