Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -332,6 +332,10 @@ |
333 | 333 | &$pcache: whether to try the parser cache or not |
334 | 334 | &$outputDone: whether the output for this page finished or not |
335 | 335 | |
| 336 | +'ArticleUpdateBeforeRedirect': After a page is updated (usually on save), before the user is redirected back to the page |
| 337 | +&$article: the article |
| 338 | +&$extraq: Extra query parameters which can be added via hooked functions |
| 339 | + |
336 | 340 | 'AuthPluginSetup': update or replace authentication plugin object ($wgAuth) |
337 | 341 | Gives a chance for an extension to set it programattically to a variable class. |
338 | 342 | &$auth: the $wgAuth object, probably a stub |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1250,7 +1250,10 @@ |
1251 | 1251 | } |
1252 | 1252 | } |
1253 | 1253 | |
1254 | | - $this->doRedirect( $this->isRedirect( $text ), $sectionanchor ); |
| 1254 | + $extraq = ''; // Give extensions a chance to modify URL query on update |
| 1255 | + wfRunHooks( 'ArticleUpdateBeforeRedirect', array($this,&$extraq) ); |
| 1256 | + |
| 1257 | + $this->doRedirect( $this->isRedirect( $text ), $sectionanchor, $extraq ); |
1255 | 1258 | } |
1256 | 1259 | return $good; |
1257 | 1260 | } |
— | — | @@ -1486,12 +1489,14 @@ |
1487 | 1490 | * @param boolean $noRedir Add redirect=no |
1488 | 1491 | * @param string $sectionAnchor section to redirect to, including "#" |
1489 | 1492 | */ |
1490 | | - function doRedirect( $noRedir = false, $sectionAnchor = '' ) { |
| 1493 | + function doRedirect( $noRedir = false, $sectionAnchor = '', $extraq = '' ) { |
1491 | 1494 | global $wgOut; |
1492 | 1495 | if ( $noRedir ) { |
1493 | 1496 | $query = 'redirect=no'; |
| 1497 | + if( $extraq ) |
| 1498 | + $query .= "&$query"; |
1494 | 1499 | } else { |
1495 | | - $query = ''; |
| 1500 | + $query = $extraq; |
1496 | 1501 | } |
1497 | 1502 | $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $sectionAnchor ); |
1498 | 1503 | } |