$sk = $wgUser->getSkin();
$isConflict = false;
// css / js subpages of user pages get a special treatment
- $isCssJsSubpage = (Namespace::getUser() == $wgTitle->getNamespace() and preg_match("/\\.(css|js)$/", $wgTitle->getText() ));
+ $isCssJsSubpage = $wgTitle->isCssJsSubpage();
+
if(!$this->mTitle->getArticleID()) { # new article
$wgOut->addWikiText(wfmsg('newarticletext'));
}
- if( Namespace::isTalk( $this->mTitle->getNamespace() ) ) {
+ if( $this->mTitle->isTalkPage() ) {
$wgOut->addWikiText(wfmsg('talkpagetext'));
}
} else {
$name = $id;
}
- $link = '[[' . $wgContLang->getNsText( Namespace::getUser() ) .
+ $link = '[[' . $wgContLang->getNsText( NS_USER ) .
":{$name}|{$name}]]";
$wgOut->addWikiText( wfMsg( 'blockedtext', $link, $reason, $ip, $name ) );
// available in doDelete etc.
function view() {
- if ( Namespace::getImage() == $this->mTitle->getNamespace() ) {
+ if( $this->mTitle->getNamespace() == NS_IMAGE ) {
$this->openShowImage();
}
# follow it with the history list and link list for the image
# it describes.
- if ( Namespace::getImage() == $this->mTitle->getNamespace() ) {
+ if( $this->mTitle->getNamespace() == NS_IMAGE ) {
$this->closeShowImage();
$this->imageHistory();
$this->imageLinks();
# Image itself is now gone, and database is cleaned.
# Now we remove the image description page.
- $nt = Title::newFromText( $wgContLang->getNsText( Namespace::getImage() ) . ":" . $image );
+ $nt = Title::makeTitleSafe( NS_IMAGE, $image );
$article = new Article( $nt );
$article->doDeleteArticle( $reason ); # ignore errors
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$sk = $wgUser->getSkin();
- $loglink = $sk->makeKnownLink( $wgContLang->getNsText(
- Namespace::getWikipedia() ) .
- ':' . wfMsg( 'dellogpage' ), wfMsg( 'deletionlog' ) );
+ $loglink = $sk->makeKnownLinkObj(
+ Title::makeTitle( NS_SPECIAL, 'Delete/log' ),
+ wfMsg( 'deletionlog' ) );
$text = wfMsg( 'deletedtext', $deleted, $loglink );
if ( 0 == $user ) {
$userlink = $usertext;
} else {
- $userlink = $this->skin->makeLink( $wgContLang->getNsText( Namespace::getUser() ) .
- ':'.$usertext, $usertext );
+ $userlink = $this->skin->makeLinkObj(
+ Title::makeTitle( NS_USER, $usertext ),
+ $usertext );
}
$nbytes = wfMsg( 'nbytes', $size );
$style = $this->skin->getInternalLinkAttributes( $url, $datetime );
$s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a>"
. " . . {$userlink} ({$nbytes})";
- if ( '' != $description && '*' != $description ) {
- $sk=$wgUser->getSkin();
- $s .= $wgContLang->emphasize(' (' . $sk->formatComment($description,$wgTitle) . ')');
- }
+ $s .= $this->skin->commentBlock( $description, $wgTitle );
$s .= "</li>\n";
return $s;
}
# format regular and media links - all other wiki formatting
# is ignored
- $medians = $wgContLang->getNsText(Namespace::getMedia()).':';
+ $medians = $wgContLang->getNsText( NS_MEDIA ) . ':';
while(preg_match('/\[\[(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) {
# Handle link renaming [[foo|text]] will show link as "text"
if( "" != $match[3] ) {
wfProfileOut( $fname );
return $comment;
}
+
+ /**
+ * Wrap a comment in standard punctuation and formatting if
+ * it's non-empty, otherwise return empty string.
+ *
+ * @param string $comment
+ * @param Title $title
+ * @return string
+ * @access public
+ */
+ function commentBlock( $comment, $title = NULL ) {
+ if( $comment == '' ) {
+ return '';
+ } else {
+ $formatted = $this->formatComment( $comment, $title );
+ return " <em>($formatted)</em>";
+ }
+ }
/** @todo document */
function tocIndent() {
# Do the insertion
$sql = '';
- $image = Namespace::getImage();
+ $image = NS_IMAGE;
if ( 0 != count ( $add ) ) {
$arr = array();
foreach ($add as $iname => $val ) {
function getHeadScripts() {
global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs;
$r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
- if( $wgAllowUserJs && $wgUser->getID() != 0 ) { # logged in
- $userpage = $wgContLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
- $userjs = htmlspecialchars($this->makeUrl($userpage.'/'.$this->getSkinName().'.js', 'action=raw&ctype=text/javascript'));
+ if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
+ $userpage = $wgUser->getUserPage();
+ $userjs = htmlspecialchars( $this->makeUrl(
+ $userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
+ 'action=raw&ctype=text/javascript'));
$r .= '<script type="text/javascript" src="'.$userjs."\"></script>\n";
}
return $r;
$action = $wgRequest->getText('action');
$s = "@import \"$wgStylePath/$sheet\";\n";
if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
- if( $wgAllowUserCss && $wgUser->getID() != 0 ) { # logged in
+ if( $wgAllowUserCss && $wgUser->isLoggedIn() ) { # logged in
if($wgTitle->isCssSubpage() && $this->userCanPreview( $action ) ) {
$s .= $wgRequest->getText('wpTextbox1');
} else {
- $userpage = $wgContLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
- $s.= '@import "'.$this->makeUrl($userpage.'/'.$this->getSkinName().'.css', 'action=raw&ctype=text/css').'";'."\n";
+ $userpage = $wgUser->getUserPage();
+ $s.= '@import "'.$this->makeUrl(
+ $userpage->getPrefixedText().'/'.$this->getSkinName().'.css',
+ 'action=raw&ctype=text/css').'";'."\n";
}
}
$s .= $this->doGetUserStyles();
* two functions to make it easier to subclass.
*/
function beforeContent() {
- global $wgUser, $wgOut;
-
return $this->doBeforeContent();
}
function doBeforeContent() {
- global $wgUser, $wgOut, $wgTitle, $wgContLang, $wgSiteNotice;
+ global $wgOut, $wgTitle, $wgContLang, $wgSiteNotice;
$fname = 'Skin::doBeforeContent';
wfProfileIn( $fname );
function getCategoryLinks () {
- global $wgOut, $wgTitle, $wgUser, $wgParser;
+ global $wgOut, $wgTitle, $wgParser;
global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
if( !$wgUseCategoryMagic ) return '' ;
# Render the array as a serie of links
function walkThrough ($tree) {
- global $wgUser;
- $sk = $wgUser->getSkin();
$return = '';
foreach($tree as $element => $parent) {
if(empty($parent)) {
# add our current element to the list
$eltitle = Title::NewFromText($element);
# FIXME : should be makeLink() [AV]
- $return .= $sk->makeLink($element, $eltitle->getText()).' > ';
+ $return .= $this->makeLinkObj( $eltitle, $eltitle->getText() ) . ' > ';
}
return $return;
}
# This gets called immediately before the </body> tag.
#
function afterContent() {
- global $wgUser, $wgOut, $wgServer;
- global $wgTitle, $wgLang;
-
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
return $printfooter . $this->doAfterContent();
}
}
if ( $wgOut->isArticleRelated() ) {
- if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
+ if ( $wgTitle->getNamespace() == NS_IMAGE ) {
$name = $wgTitle->getDBkey();
$image = new Image( $wgTitle->getDBkey() );
if( $image->exists() ) {
# do not show "You have new messages" text when we are viewing our
# own talk page
- if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 &&
- $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) {
+ if( $wgTitle->equals( $wgUser->getTalkPage() ) ) {
$tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
wfMsg('newmessageslink') );
$s.= ' | <strong>'. wfMsg( 'newmessages', $tl ) . '</strong>';
$lo = $wgContLang->specialPage( 'Userlogout' );
$s = '';
- if ( 0 == $wgUser->getID() ) {
- if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) {
+ if ( $wgUser->isAnon() ) {
+ if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) {
$n = $wgIP;
$tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
$s = '';
if ( $wgOut->isArticleRelated() ) {
$s .= '<strong>' . $this->editThisPage() . '</strong>';
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->watchThisPage();
}
$s .= $sep . $this->talkLink()
. $sep . $this->whatLinksHere()
. $sep . $this->watchPageLinksLink();
- if ( $wgTitle->getNamespace() == Namespace::getUser()
- || $wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser()) )
+ if ( $wgTitle->getNamespace() == NS_USER
+ || $wgTitle->getNamespace() == NS_USER_TALK )
{
$id=User::idFromName($wgTitle->getText());
global $wgEnableEmail, $wgEnableUserEmail, $wgUser;
return $wgEnableEmail &&
$wgEnableUserEmail &&
- 0 != $wgUser->getID() && # show only to signed in users
+ $wgUser->isLoggedIn() && # show only to signed in users
0 != $id; # we can only email to non-anons ..
# '' != $id->getEmail() && # who must have an email address stored ..
# 0 != $id->getEmailauthenticationtimestamp() && # .. which is authenticated
wfProfileIn( "$fname-stuff" );
$this->thispage = $this->mTitle->getPrefixedDbKey();
$this->thisurl = $this->mTitle->getPrefixedURL();
- $this->loggedin = $wgUser->getID() != 0;
- $this->iscontent = ($this->mTitle->getNamespace() != Namespace::getSpecial() );
+ $this->loggedin = $wgUser->isLoggedIn();
+ $this->iscontent = ($this->mTitle->getNamespace() != NS_SPECIAL );
$this->iseditable = ($this->iscontent and !($action == 'edit' or $action == 'submit'));
$this->username = $wgUser->getName();
- $this->userpage = $wgContLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
+ $userPage = $wgUser->getUserPage();
+ $this->userpage = $userPage->getPrefixedText();
$this->userpageUrlDetails = $this->makeUrlDetails($this->userpage);
$this->usercss = $this->userjs = $this->userjsprev = false;
'href' => $this->mTitle->getLocalUrl( 'action=delete' )
);
}
- if ( $wgUser->getID() != 0 ) {
+ if ( $wgUser->isLoggedIn() ) {
if ( $this->mTitle->userCanMove()) {
$content_actions['move'] = array(
- 'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == Namespace::getSpecial()) ? 'selected' : false,
+ 'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false,
'text' => wfMsg('move'),
'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage ) )
);
}
wfProfileOut( "$fname-live" );
- if ( $wgUser->getID() != 0 and $action != 'submit' ) {
+ if ( $wgUser->isLoggedIn() and $action != 'submit' ) {
if( !$this->mTitle->userIsWatching()) {
$content_actions['watch'] = array(
'class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
global $wgUser;
$s = "/* generated user stylesheet */\n";
- if($wgUser->getID() != 0) {
- if ( 1 == $wgUser->getOption( "underline" ) ) {
+ if( $wgUser->isLoggedIn() ) {
+ if ( $wgUser->getOption( "underline" ) ) {
$s .= "a { text-decoration: underline; }\n";
} else {
$s .= "a { text-decoration: none; }\n";
}
}
- if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
+ if ( !$wgUser->getOption( "highlightbroken" ) ) {
$s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
}
- if ( 1 == $wgUser->getOption( "justify" ) ) {
+ if ( $wgUser->getOption( "justify" ) ) {
$s .= "#bodyContent { text-align: justify; }\n";
}
wfProfileOut( $fname );
$fname = 'SkinTemplate::getUserJs';
wfProfileIn( $fname );
- global $wgUser, $wgStylePath;
+ global $wgStylePath;
$s = '/* generated javascript */';
$s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
$s .= '/* MediaWiki:'.ucfirst($this->skinname)." */\n";
}
$talk = $nt->getTalkPage();
if( $talk ) {
- $ul .= ' (' . $sk->makeLinkObj( $talk, $wgLang->getNsText(Namespace::getTalk(0)) ) . ')';
+ $ul .= ' (' . $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) ) . ')';
}
htmlspecialchars( $wpIlMatch ) . "\" /> " .
"<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
$nums = array( 50, 100, 250, 500 );
- $here = $wgContLang->specialPage( "Imagelist" );
+ $here = Title::makeTitle( NS_SPECIAL, 'Imagelist' );
$fill = "";
$first = true;
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=byname&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $byname );
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=bysize&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $bysize );
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=bydate&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $bydate );
while ( $s = $dbr->fetchObject( $res ) ) {
$name = $s->img_name;
$ut = $s->img_user_text;
- if ( 0 == $s->img_user ) { $ul = $ut; }
- else { $ul = $sk->makeLink( $wgContLang->getNsText(
- Namespace::getUser() ) . ":{$ut}", $ut ); }
+ if ( 0 == $s->img_user ) {
+ $ul = $ut;
+ } else {
+ $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
+ }
$ilink = "<a href=\"" . htmlspecialchars( Image::wfImageUrl( $name ) ) .
"\">" . htmlspecialchars( $name ) . "</a>";
$nb = wfMsg( "nbytes", $wgLang->formatNum( $s->img_size ) );
$l = "(" .
- $sk->makeKnownLink( $wgContLang->getNsText(
- Namespace::getImage() ) . ":{$name}", wfMsg( "imgdesc" ) ) .
+ $sk->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
+ wfMsg( "imgdesc" ) ) .
") {$ilink} . . {$nb} . . {$ul} . . " .
$wgLang->timeanddate( $s->img_timestamp, true );
- if ( "" != $s->img_description ) {
- $l .= ' <i>(' . $sk->formatComment( $s->img_description ) . ')</i>';
- }
+ $l .= $sk->commentBlock( $s->img_description );
$wgOut->addHTML( "{$l}<br />\n" );
}
$wgOut->addHTML( "</p>" );
$addr = $block->mAuto ? "#{$block->mId}" : $block->mAddress;
$name = User::whoIs( $block->mBy );
- $ulink = $sk->makeKnownLink( $wgContLang->getNsText( Namespace::getUser() ). ":{$name}", $name );
+ $ulink = $sk->makeKnownLinkObj( Title::makeTitle( NS_USER, $name ), $name );
$formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
if ( $block->mExpiry === "" ) {
$group = $dbr->tableName( 'group' );
$user_groups = $dbr->tableName( 'user_groups' );
- $userspace = Namespace::getUser();
+ $userspace = NS_USER;
$sql = "SELECT group_name as type, $userspace AS namespace, user_name AS title, user_name as value " .
"FROM $user ".
"LEFT JOIN $user_groups ON user_id =ug_user " .
* constructor
*/
function wfSpecialListusers() {
- global $wgUser, $wgOut, $wgLang, $wgRequest;
+ global $wgRequest;
list( $limit, $offset ) = wfCheckLimits();
global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove;
# check rights. We don't want newbies to move pages to prevents possible attack
- if ( 0 == $wgUser->getID() or $wgUser->isBlocked() or ($wgOnlySysopMayMove and $wgUser->isNewbie())) {
+ if ( $wgUser->isAnon() or $wgUser->isBlocked() or ($wgOnlySysopMayMove and $wgUser->isNewbie())) {
$wgOut->errorpage( "movenologin", "movenologintext" );
return;
}
}
$wgOut->addWikiText( wfMsg( 'movepagetext' ) );
- if ( ! Namespace::isTalk( $ot->getNamespace() ) ) {
+ if ( !$ot->isTalkPage() ) {
$wgOut->addWikiText( wfMsg( 'movepagetalktext' ) );
}
</td>
</tr>" );
- if ( ! Namespace::isTalk( $ot->getNamespace() ) ) {
+ if ( ! $ot->isTalkPage() ) {
$wgOut->addHTML( "
<tr>
<td align='right'>
}
function showSuccess() {
- global $wgOut, $wgUser, $wgRequest, $wgRawHtml;
+ global $wgOut, $wgRequest, $wgRawHtml;
$wgOut->setPagetitle( wfMsg( 'movepage' ) );
$wgOut->setSubtitle( wfMsg( 'pagemovedsub' ) );
$wgOut->addHTML( "\n<p><strong>" . wfMsg( 'talkexists' ) . "</strong></p>\n" );
} else {
$ot = Title::newFromURL( $oldtitle );
- if ( ! Namespace::isTalk( $ot->getNamespace() ) ) {
+ if ( ! $ot->isTalkPage() ) {
$wgOut->addHTML( "\n<p>" . wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) . "</p>\n" );
}
}
$nt = Title::newFromText( $name, NS_IMAGE );
$img = Image::newFromTitle( $nt );
- $ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
+ $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
$gallery->add( $img, $ul.'<br /><i>'.$wgLang->timeanddate( $s->img_timestamp, true ).'</i><br />' );
}
/** Various rights checks */
- if( ( $wgUser->getID() == 0 )
+ if( ( $wgUser->isAnon() )
OR $wgUser->isBlocked() ) {
$wgOut->errorpage( 'uploadnologin', 'uploadnologintext' );
return;
$sk = $wgUser->getSkin();
$ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::wfImageUrl( $this->mUploadSaveName ) );
- $dname = $wgContLang->getNsText( Namespace::getImage() ) . ':'.$this->mUploadSaveName;
+ $dname = $wgContLang->getNsText( NS_IMAGE ) . ':'.$this->mUploadSaveName;
$dlink = $sk->makeKnownLink( $dname, $dname );
$wgOut->addHTML( '<h2>' . wfMsg( 'successfulupload' ) . "</h2>\n" );
$this->invalidateCache();
}
+ /**
+ * A more legible check for non-anonymousness.
+ * Returns true if the user is not an anonymous visitor.
+ *
+ * @return bool
+ */
+ function isLoggedIn() {
+ return( $this->getID() != 0 );
+ }
+
+ /**
+ * A more legible check for anonymousness.
+ * Returns true if the user is an anonymous visitor.
+ *
+ * @return bool
+ */
+ function isAnon() {
+ return !$this->isLoggedIn();
+ }
+
/**
* Check if a user is sysop
* Die with backtrace. Use User:isAllowed() instead.
$this->mTimestamp = $timestamp;
# If namespace isn't User_talk:, do nothing.
- if ( $this->mNamespace != Namespace::getTalk(Namespace::getUser() ) ) {
+ if ( $this->mNamespace != NS_USER_TALK ) {
return;
}
return false;
}
- function specialPage( $name ) {
- return $this->getNsText( Namespace::getSpecial() ) . ":" . $name;
- }
-
function getQuickbarSettings() {
global $wgQuickbarSettingsFi;
return $wgQuickbarSettingsFi;
. $sep . $this->whatLinksHere()
. $sep . $this->watchPageLinksLink();
- if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
+ if( $tns == NS_USER || $tns == NS_USER_TALK ) {
$id=User::idFromName($wgTitle->getText());
if ($id != 0) {
$s .= $sep . $this->userContribsLink();
$s .= $this->menuHead( "qbmyoptions" );
if ( 0 != $wgUser->getID() ) {
$name = $wgUser->getName();
- $tl = $this->makeKnownLink( $wgContLang->getNsText(
- Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
- wfMsg( "mytalk" ) );
- if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
+ wfMsg( 'mytalk' ) );
+ if ( $wgUser->getNewtalk() ) {
+ $tl .= " *";
+ }
- $s .= $this->makeKnownLink( $wgContLang->getNsText(
- Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
+ $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
+ wfMsg( "mypage" ) )
. $sep . $tl
. $sep . $this->specialLink( "watchlist" )
- . $sep . $this->makeKnownLink( $wgContLang->specialPage( "Contributions" ),
+ . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ),
wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
. $sep . $this->specialLink( "preferences" )
. $sep . $this->specialLink( "userlogout" );
. $sep . $this->specialLink( "imagelist" )
. $sep . $this->specialLink( "statistics" )
. $sep . $this->bugReportsLink();
- if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
+ if ( $wgUser->isLoggedIn() && !$wgDisableUploads ) {
$s .= $sep . $this->specialLink( "upload" );
}
global $wgSiteSupportPage;
.wfMsg( "sitesupport" )."</a>";
}
- $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
+ $s .= $sep . $this->makeKnownLinkObj(
+ Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+ wfMsg( 'moredotdotdot' ) );
$s .= $sep . "\n</div>\n";
return $s;
}
- if ($wgUser->getID()) {
+ if( $wgUser->isLoggedIn() ) {
$s.= $this->specialLink( 'watchlist' ) ;
$s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) );
}
$s .= $this->makeLink( $link, $text );
- } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
+ } elseif( $wgTitle->getNamespace() != NS_SPECIAL ) {
# we just throw in a "New page" text to tell the user that he's in edit mode,
# and to avoid messing with the separator that is prepended to the next item
$s .= '<strong>' . wfMsg('newpage') . '</strong>';
article with "Watch this article" checkbox disabled, the article is transparently
unwatched. Therefore we do not show the "Watch this page" link in edit mode
*/
- if ( 0 != $wgUser->getID() && $articleExists) {
+ if ( $wgUser->isLoggedIn() && $articleExists) {
if($action!='edit' && $action != 'submit' )
{
$s .= $sep . $this->watchThisPage();
$s .= $sep . $this->watchPageLinksLink();
}
- if ( Namespace::getUser() == $wgTitle->getNamespace()
- || $wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
- ) {
+ if ( NS_USER == $wgTitle->getNamespace()
+ || $wgTitle->getNamespace() == NS_USER_TALK ) {
$id=User::idFromName($wgTitle->getText());
$ip=User::isIP($wgTitle->getText());
$s .= "\n<br /><hr class='sep' />";
}
- if ( 0 != $wgUser->getID() && ( !$wgDisableUploads || $wgRemoteUploads ) ) {
+ if ( $wgUser->isLoggedIn() && ( !$wgDisableUploads || $wgRemoteUploads ) ) {
$s .= $this->specialLink( 'upload' ) . $sep;
}
$s .= $this->specialLink( 'specialpages' )