From: Alexandre Emsenhuber Date: Thu, 15 Sep 2011 15:55:13 +0000 (+0000) Subject: * Factorise calls to get the User object X-Git-Tag: 1.31.0-rc.0~27638 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=aa053aad40a69a0cec649cb1c4c902eeff021a47;p=lhc%2Fweb%2Fwiklou.git * Factorise calls to get the User object * Call Linker method statically --- diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 6e8febc586..d77a930614 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -86,9 +86,10 @@ class NostalgiaTemplate extends LegacyTemplate { $s .= $sep . Linker::specialLink( 'Userlogin' ); } else { /* show user page and user talk links */ - $s .= $sep . Linker::link( $this->getSkin()->getUser()->getUserPage(), wfMsgHtml( 'mypage' ) ); - $s .= $sep . Linker::link( $this->getSkin()->getUser()->getTalkPage(), wfMsgHtml( 'mytalk' ) ); - if ( $this->getSkin()->getUser()->getNewtalk() ) { + $user = $this->getSkin()->getUser(); + $s .= $sep . Linker::link( $user->getUserPage(), wfMsgHtml( 'mypage' ) ); + $s .= $sep . Linker::link( $user->getTalkPage(), wfMsgHtml( 'mytalk' ) ); + if ( $user->getNewtalk() ) { $s .= ' *'; } /* show watchlist link */ @@ -100,12 +101,12 @@ class NostalgiaTemplate extends LegacyTemplate { /* show my preferences link */ $s .= $sep . Linker::specialLink( 'Preferences' ); /* show upload file link */ - if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) { + if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) { $s .= $sep . $this->getUploadLink(); } /* show log out link */ - $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' ); + $s .= $sep . Linker::specialLink( 'Userlogout' ); } $s .= $sep . $this->specialPagesList();