$this->loggedin = $user->isLoggedIn();
$this->username = $user->getName();
- if ( $this->loggedin || $this->showIPinHeader() ) {
+ if ( $this->loggedin ) {
$this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
} else {
# This won't be used in the standard skins, but we define it to preserve the interface
'active' => $title->isSpecial( 'Userlogin' ) && $is_signup,
);
- if ( $this->showIPinHeader() ) {
- $href = &$this->userpageUrlDetails['href'];
+ // No need to show Talk and Contributions to anons if they can't contribute!
+ if ( User::groupHasPermission( '*', 'edit' ) ) {
+ // Show the text "Not logged in"
$personal_urls['anonuserpage'] = array(
- 'text' => $this->username,
- 'href' => $href,
- 'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
- 'active' => ( $pageurl == $href )
+ 'text' => $this->msg( 'notloggedin' )->text()
);
- $usertalkUrlDetails = $this->makeTalkUrlDetails( $this->userpage );
- $href = &$usertalkUrlDetails['href'];
+
+ // Because of caching, we can't link directly to the IP talk and
+ // contributions pages. Instead we use the special page shortcuts
+ // (which work correctly regardless of caching). This means we can't
+ // determine whether these links are active or not, but since major
+ // skins (MonoBook, Vector) don't use this information, it's not a
+ // huge loss.
$personal_urls['anontalk'] = array(
'text' => $this->msg( 'anontalk' )->text(),
- 'href' => $href,
- 'class' => $usertalkUrlDetails['exists'] ? false : 'new',
- 'active' => ( $pageurl == $href )
+ 'href' => self::makeSpecialUrlSubpage( 'Mytalk', false ),
+ 'active' => false
+ );
+ $personal_urls['anoncontribs'] = array(
+ 'text' => $this->msg( 'anoncontribs' )->text(),
+ 'href' => self::makeSpecialUrlSubpage( 'Mycontributions', false ),
+ 'active' => false
);
}
* the global versions.
*/
$mode = $user->isWatched( $title ) ? 'unwatch' : 'watch';
- $token = WatchAction::getWatchToken( $title, $user, $mode );
$content_navigation['actions'][$mode] = array(
- 'class' => $onPage && ( $action == 'watch' || $action == 'unwatch' ) ? 'selected' : false,
+ 'class' => 'mw-watchlink ' . (
+ $onPage && ( $action == 'watch' || $action == 'unwatch' ) ? 'selected' : ''
+ ),
// uses 'watch' or 'unwatch' message
'text' => $this->msg( $mode )->text(),
- 'href' => $title->getLocalURL( array( 'action' => $mode, 'token' => $token ) )
+ 'href' => $title->getLocalURL( array( 'action' => $mode ) )
);
}
}
$nav_urls['print'] = array(
'text' => $this->msg( 'printableversion' )->text(),
'href' => $this->getTitle()->getLocalURL(
- $request->appendQueryValue( 'printable', 'yes', true ) )
+ $request->appendQueryValue( 'printable', 'yes' ) )
);
}