42 return $this->
msg(
'addwatch' )->escaped();
57 parent::checkCanExecute( $user );
66 return $this->
msg(
'confirm-watch-top' )->parse();
70 $this->
getOutput()->addWikiMsg(
'addedwatchtext', $this->
getTitle()->getPrefixedText() );
92 return self::doUnwatch( $title, $user );
113 if ( $checkRights && !$user->
isAllowed(
'editmywatchlist' ) ) {
122 $user->
addWatch( $title, $checkRights );
137 if ( !$user->
isAllowed(
'editmywatchlist' ) ) {
163 if ( $action !=
'unwatch' ) {
180 return self::getWatchToken( $title, $user, $action );
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
getOutput()
Get the OutputPage being used for this instance.
getTitle()
Shortcut to get the Title object from the page.
alterForm(HTMLForm $form)
getUser()
Shortcut to get the User being used for this instance.
isLoggedIn()
Get whether the user is logged in.
Represents a title within MediaWiki.
static newFatal($message)
Factory function for fatal errors.
Redirect a user to the login page.
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
checkCanExecute(User $user)
isAllowed($action= '')
Internal mechanics of testing a permission.
isAnon()
Get whether the user is anonymous.
static doWatch(Title $title, User $user, $checkRights=User::CHECK_USER_RIGHTS)
Watch a page.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
isWatched($title, $checkRights=self::CHECK_USER_RIGHTS)
Check the watched status of an article.
$page
Page on which we're performing the action.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
static getWatchToken(Title $title, User $user, $action= 'watch')
Get token to watch (or unwatch) a page for a user.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
removeWatch($title, $checkRights=self::CHECK_USER_RIGHTS)
Stop watching an article.
Page addition to a user's watchlist.
static getUnwatchToken(Title $title, User $user, $action= 'unwatch')
Get token to unwatch (or watch) a page for a user.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
getEditToken($salt= '', $request=null)
Initialize (if necessary) and return a session token value which can be used in edit forms to show th...
static newFatalPermissionDeniedStatus($permission)
Factory function for fatal permission-denied errors.
addWatch($title, $checkRights=self::CHECK_USER_RIGHTS)
Watch an article.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
static doWatchOrUnwatch($watch, Title $title, User $user)
Watch or unwatch a page.
static newGood($value=null)
Factory function for good results.
static doUnwatch(Title $title, User $user)
Unwatch a page.