'UnwatchArticle': before a watch is removed from an article
$user: user watching
-$article: article object to be removed
-
-'UnwatchArticle': after a watch is removed from an article
-$user: user that was watching
-$article: article object removed
+$page: WikiPage object to be removed
'UnwatchArticleComplete': after a watch is removed from an article
$user: user that watched
-$article: article object that was watched
+$page: WikiPage object that was watched
'UploadForm:initial': before the upload form is generated
$form: UploadForm object
'WatchArticle': before a watch is added to an article
$user: user that will watch
-$article: article object to be watched
+$page: WikiPage object to be watched
'WatchArticleComplete': after a watch is added to an article
$user: user that watched
-$article: article object watched
+$page: WikiPage object watched
'WatchlistEditorBuildRemoveLine': when building remove lines in
Special:Watchlist/edit
}
public static function doWatch( Title $title, User $user ) {
- $page = new Article( $title, 0 );
+ $page = WikiPage::factory( $title );
if ( wfRunHooks( 'WatchArticle', array( &$user, &$page ) ) ) {
$user->addWatch( $title );
}
public static function doUnwatch( Title $title, User $user ) {
- $page = new Article( $title, 0 );
+ $page = WikiPage::factory( $title );
if ( wfRunHooks( 'UnwatchArticle', array( &$user, &$page ) ) ) {
$user->removeWatch( $title );
),
__METHOD__
);
- $article = new Article( $title, 0 );
- wfRunHooks( 'UnwatchArticleComplete', array( $this->getUser(), &$article ) );
+ $page = WikiPage::factory( $title );
+ wfRunHooks( 'UnwatchArticleComplete', array( $this->getUser(), &$page ) );
}
}
}