";
if ( $thumbUrl == '' ) {
@@ -2025,7 +1864,8 @@ class Skin {
} else {
$s .= '
'.
'!['.$alt.']('.$thumbUrl.')
';
+ 'width="'.$boxwidth.'" height="'.$boxheight.'" ' .
+ 'longdesc="'.$u.'" />';
if ( $framed ) {
$zoomicon="";
} else {
@@ -2040,34 +1880,39 @@ class Skin {
}
function makeMediaLink( $name, $url, $alt = '' ) {
- $nt = Title::makeTitleSafe( Namespace::getMedia(), $name );
+ $nt = Title::makeTitleSafe( NS_IMAGE, $name );
return $this->makeMediaLinkObj( $nt, $alt );
}
- function makeMediaLinkObj( $nt, $alt = '' ) {
+ function makeMediaLinkObj( $nt, $alt = '', $nourl=false ) {
if ( ! isset( $nt ) )
{
### HOTFIX. Instead of breaking, return empty string.
$s = $alt;
} else {
- $name = $nt->getDBKey();
- $url = Image::wfImageUrl( $name );
+ $name = $nt->getDBKey();
+ $img = Image::newFromTitle( $nt );
+ $url = $img->getURL();
+ # $nourl can be set by the parser
+ # this is a hack to mask absolute URLs, so the parser doesn't
+ # linkify them (it is currently not context-aware)
+ # 2004-10-25
+ if ($nourl) { $url=str_replace("http://","http-noparse://",$url) ; }
if ( empty( $alt ) ) {
$alt = preg_replace( '/\.(.+?)^/', '', $name );
}
-
$u = htmlspecialchars( $url );
- $s = "
{$alt}";
+ $s = "
{$alt}";
}
return $s;
}
function specialLink( $name, $key = '' ) {
- global $wgLang;
+ global $wgContLang;
if ( '' == $key ) { $key = strtolower( $name ); }
- $pn = $wgLang->ucfirst( $name );
- return $this->makeKnownLink( $wgLang->specialPage( $pn ),
+ $pn = $wgContLang->ucfirst( $name );
+ return $this->makeKnownLink( $wgContLang->specialPage( $pn ),
wfMsg( $key ) );
}
@@ -2080,487 +1925,6 @@ class Skin {
return '
'.$text.'';
}
- # Called by history lists and recent changes
- #
-
- # Returns text for the start of the tabular part of RC
- function beginRecentChangesList() {
- $this->rc_cache = array() ;
- $this->rcMoveIndex = 0;
- $this->rcCacheIndex = 0 ;
- $this->lastdate = '';
- $this->rclistOpen = false;
- return '';
- }
-
- function beginImageHistoryList() {
- $s = "\n
" . wfMsg( 'imghistory' ) . "
\n" .
- "
" . wfMsg( 'imghistlegend' ) . "
\n".'
';
- return $s;
- }
-
- /**
- * Returns text for the end of RC
- * If enhanced RC is in use, returns pretty much all the text
- */
- function endRecentChangesList() {
- $s = $this->recentChangesBlock() ;
- if( $this->rclistOpen ) {
- $s .= "
\n";
- }
- return $s;
- }
-
- /**
- * Enhanced RC ungrouped line
- */
- function recentChangesBlockLine ( $rcObj ) {
- global $wgStylePath, $wgLang ;
-
- # Get rc_xxxx variables
- extract( $rcObj->mAttribs ) ;
- $curIdEq = 'curid='.$rc_cur_id;
-
- # Spacer image
- $r = '' ;
-
- $r .= '
![]('.$wgStylePath.'/common/images/Arr_.png)
' ;
- $r .= '
' ;
-
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $r .= ' ';
- } else {
- # M & N (minor & new)
- $M = wfMsg( 'minoreditletter' );
- $N = wfMsg( 'newpageletter' );
-
- if ( $rc_type == RC_NEW ) {
- $r .= $N ;
- } else {
- $r .= ' ' ;
- }
- if ( $rc_minor ) {
- $r .= $M ;
- } else {
- $r .= ' ' ;
- }
- }
-
- # Timestamp
- $r .= ' '.$rcObj->timestamp.' ' ;
- $r .= '' ;
-
- # Article link
- $link = $rcObj->link ;
- if ( $rcObj->watched ) $link = '
'.$link.'' ;
- $r .= $link ;
-
- # Diff
- $r .= ' (' ;
- $r .= $rcObj->difflink ;
- $r .= '; ' ;
-
- # Hist
- $r .= $this->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
-
- # User/talk
- $r .= ') . . '.$rcObj->userlink ;
- $r .= $rcObj->usertalklink ;
-
- # Comment
- if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
- $rc_comment=$this->formatComment($rc_comment, $rcObj->getTitle());
- $r .= $wgLang->emphasize( ' ('.$rc_comment.')' );
- }
-
- $r .= "
\n" ;
- return $r ;
- }
-
- /**
- * Enhanced RC group
- */
- function recentChangesBlockGroup ( $block ) {
- global $wgStylePath, $wgLang ;
-
- $r = '' ;
- $M = wfMsg( 'minoreditletter' );
- $N = wfMsg( 'newpageletter' );
-
- # Collate list of users
- $isnew = false ;
- $userlinks = array () ;
- foreach ( $block AS $rcObj ) {
- $oldid = $rcObj->mAttribs['rc_last_oldid'];
- if ( $rcObj->mAttribs['rc_new'] ) $isnew = true ;
- $u = $rcObj->userlink ;
- if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
- $userlinks[$u]++ ;
- }
-
- # Sort the list and convert to text
- krsort ( $userlinks ) ;
- asort ( $userlinks ) ;
- $users = array () ;
- foreach ( $userlinks as $userlink => $count) {
- $text = $userlink ;
- if ( $count > 1 ) $text .= " ({$count}×)" ;
- array_push ( $users , $text ) ;
- }
- $users = '
['.implode('; ',$users).']' ;
-
- # Arrow
- $rci = 'RCI'.$this->rcCacheIndex ;
- $rcl = 'RCL'.$this->rcCacheIndex ;
- $rcm = 'RCM'.$this->rcCacheIndex ;
- $toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
- $arrowdir = $wgLang->isRTL() ? 'l' : 'r';
- $tl = '
![]('.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png)
' ;
- $tl .= '
![]('.$wgStylePath.'/common/images/Arr_d.png)
' ;
- $r .= $tl ;
-
- # Main line
- # M/N
- $r .= '
' ;
- if ( $isnew ) $r .= $N ;
- else $r .= ' ' ;
- $r .= ' ' ; # Minor
-
- # Timestamp
- $r .= ' '.$block[0]->timestamp.' ' ;
- $r .= '' ;
-
- # Article link
- $link = $block[0]->link ;
- if ( $block[0]->watched ) $link = '
'.$link.'' ;
- $r .= $link ;
-
- $curIdEq = 'curid=' . $block[0]->mAttribs['rc_cur_id'];
- if ( $block[0]->mAttribs['rc_type'] != RC_LOG ) {
- # Changes
- $r .= ' ('.count($block).' ' ;
- if ( $isnew ) $r .= wfMsg('changes');
- else $r .= $this->makeKnownLinkObj( $block[0]->getTitle() , wfMsg('changes') ,
- $curIdEq.'&diff=0&oldid='.$oldid ) ;
- $r .= '; ' ;
-
- # History
- $r .= $this->makeKnownLinkObj( $block[0]->getTitle(), wfMsg( 'history' ), $curIdEq.'&action=history' );
- $r .= ')' ;
- }
-
- $r .= $users ;
- $r .= "
\n" ;
-
- # Sub-entries
- $r .= '
' ;
- foreach ( $block AS $rcObj ) {
- # Get rc_xxxx variables
- extract( $rcObj->mAttribs );
-
- $r .= '
![]('.$wgStylePath.'/common/images/Arr_.png)
';
- $r .= '
' ;
- if ( $rc_new ) $r .= $N ;
- else $r .= ' ' ;
- if ( $rc_minor ) $r .= $M ;
- else $r .= ' ' ;
- $r .= '' ;
-
- $o = '' ;
- if ( $rc_last_oldid != 0 ) {
- $o = 'oldid='.$rc_last_oldid ;
- }
- if ( $rc_type == RC_LOG ) {
- $link = $rcObj->timestamp ;
- } else {
- $link = $this->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp , "{$curIdEq}&$o" ) ;
- }
- $link = '
'.$link.'' ;
-
- $r .= $link ;
- $r .= ' (' ;
- $r .= $rcObj->curlink ;
- $r .= '; ' ;
- $r .= $rcObj->lastlink ;
- $r .= ') . . '.$rcObj->userlink ;
- $r .= $rcObj->usertalklink ;
- if ( $rc_comment != '' ) {
- $rc_comment=$this->formatComment($rc_comment, $rcObj->getTitle());
- $r .= $wgLang->emphasize( ' ('.$rc_comment.')' ) ;
- }
- $r .= "
\n" ;
- }
- $r .= "
\n" ;
-
- $this->rcCacheIndex++ ;
- return $r ;
- }
-
- /**
- * If enhanced RC is in use, this function takes the previously cached
- * RC lines, arranges them, and outputs the HTML
- */
- function recentChangesBlock () {
- global $wgStylePath ;
- if ( count ( $this->rc_cache ) == 0 ) return '' ;
- $blockOut = '';
- foreach ( $this->rc_cache AS $secureName => $block ) {
- if ( count ( $block ) < 2 ) {
- $blockOut .= $this->recentChangesBlockLine ( array_shift ( $block ) ) ;
- } else {
- $blockOut .= $this->recentChangesBlockGroup ( $block ) ;
- }
- }
-
- return '
'.$blockOut.'
' ;
- }
-
- /**
- * Called in a loop over all displayed RC entries
- * Either returns the line, or caches it for later use
- */
- function recentChangesLine( &$rc, $watched = false ) {
- global $wgUser ;
- $usenew = $wgUser->getOption( 'usenewrc' );
- if ( $usenew )
- $line = $this->recentChangesLineNew ( $rc, $watched ) ;
- else
- $line = $this->recentChangesLineOld ( $rc, $watched ) ;
- return $line ;
- }
-
- function recentChangesLineOld( &$rc, $watched = false ) {
- global $wgTitle, $wgLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
-
- # Extract DB fields into local scope
- extract( $rc->mAttribs );
- $curIdEq = 'curid=' . $rc_cur_id;
-
- # Make date header if necessary
- $date = $wgLang->date( $rc_timestamp, true);
- $s = '';
- if ( $date != $this->lastdate ) {
- if ( '' != $this->lastdate ) { $s .= "\n"; }
- $s .= "
{$date}
\n
";
- $this->lastdate = $date;
- $this->rclistOpen = true;
- }
-
- # If this edit has not yet been patrolled, make it stick out
- $s .= ( ! $wgUseRCPatrol || $rc_patrolled ) ? '- ' : '
- ';
-
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- # Diff
- $s .= '(' . wfMsg( 'diff' ) . ') (';
- # Hist
- $s .= $this->makeKnownLinkObj( $rc->getMovedToTitle(), wfMsg( 'hist' ), 'action=history' ) .
- ') . . ';
-
- # "[[x]] moved to [[y]]"
- $msg = ( $rc_type == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
- $s .= wfMsg( $msg, $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
- $this->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
- # Log updates, etc
- $logtype = $matches[1];
- $logname = LogPage::logName( $logtype );
- $s .= '(' . $this->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
- } else {
- # Diff link
- if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
- $diffLink = wfMsg( 'diff' );
- } else {
- if ( $wgUseRCPatrol && $rc_patrolled == 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
- $rcidparam = "&rcid={$rc_id}";
- else
- $rcidparam = "";
- $diffLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'diff' ),
- "{$curIdEq}&diff={$rc_this_oldid}&oldid={$rc_last_oldid}{$rcidparam}",
- '', '', ' tabindex="'.$rc->counter.'"');
- }
- $s .= '('.$diffLink.') (';
-
- # History link
- $s .= $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
- $s .= ') . . ';
-
- # M and N (minor and new)
- if ( $rc_minor ) { $s .= ' '.wfMsg( "minoreditletter" ).''; }
- if ( $rc_type == RC_NEW ) { $s .= ''.wfMsg( "newpageletter" ).''; }
-
- # Article link
- # If it's a new article, there is no diff link, but if it hasn't been
- # patrolled yet, we need to give users a way to do so
- if ( $wgUseRCPatrol && $rc_type == RC_NEW && $rc_patrolled == 0 &&
- $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
- $articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
- else
- $articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '' );
-
- if ( $watched ) {
- $articleLink = ''.$articleLink.'';
- }
- $s .= ' '.$articleLink;
-
- }
-
- # Timestamp
- $s .= '; ' . $wgLang->time( $rc_timestamp, true, $wgRCSeconds ) . ' . . ';
-
- # User link (or contributions for unregistered users)
- if ( 0 == $rc_user ) {
- $userLink = $this->makeKnownLink( $wgLang->specialPage( 'Contributions' ),
- $rc_user_text, 'target=' . $rc_user_text );
- } else {
- $userLink = $this->makeLink( $wgLang->getNsText( NS_USER ) . ':'.$rc_user_text, $rc_user_text );
- }
- $s .= $userLink;
-
- # User talk link
- $talkname=$wgLang->getNsText(NS_TALK); # use the shorter name
- global $wgDisableAnonTalk;
- if( 0 == $rc_user && $wgDisableAnonTalk ) {
- $userTalkLink = '';
- } else {
- $utns=$wgLang->getNsText(NS_USER_TALK);
- $userTalkLink= $this->makeLink($utns . ':'.$rc_user_text, $talkname );
- }
- # Block link
- $blockLink='';
- if ( ( 0 == $rc_user ) && $wgUser->isSysop() ) {
- $blockLink = $this->makeKnownLink( $wgLang->specialPage(
- 'Blockip' ), wfMsg( 'blocklink' ), 'ip='.$rc_user_text );
-
- }
- if($blockLink) {
- if($userTalkLink) $userTalkLink .= ' | ';
- $userTalkLink .= $blockLink;
- }
- if($userTalkLink) $s.=' ('.$userTalkLink.')';
-
- # Add comment
- if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
- $rc_comment=$this->formatComment($rc_comment,$rc->getTitle());
- $s .= $wgLang->emphasize(' (' . $rc_comment . ')');
- }
- $s .= "
\n";
-
- return $s;
- }
-
- function recentChangesLineNew( &$baseRC, $watched = false ) {
- global $wgTitle, $wgLang, $wgUser, $wgRCSeconds;
-
- # Create a specialised object
- $rc = RCCacheEntry::newFromParent( $baseRC ) ;
-
- # Extract fields from DB into the function scope (rc_xxxx variables)
- extract( $rc->mAttribs );
- $curIdEq = 'curid=' . $rc_cur_id;
-
- # If it's a new day, add the headline and flush the cache
- $date = $wgLang->date( $rc_timestamp, true);
- $ret = '';
- if ( $date != $this->lastdate ) {
- # Process current cache
- $ret = $this->recentChangesBlock () ;
- $this->rc_cache = array() ;
- $ret .= "{$date}
\n";
- $this->lastdate = $date;
- }
-
- # Make article link
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
- $clink = wfMsg( $msg, $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
- $this->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
- } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
- # Log updates, etc
- $logtype = $matches[1];
- $logname = LogPage::logName( $logtype );
- $clink = '(' . $this->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
- } else {
- $clink = $this->makeKnownLinkObj( $rc->getTitle(), '' ) ;
- }
-
- $time = $wgLang->time( $rc_timestamp, true, $wgRCSeconds );
- $rc->watched = $watched ;
- $rc->link = $clink ;
- $rc->timestamp = $time;
-
- # Make "cur" and "diff" links
- if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $curLink = wfMsg( 'cur' );
- $diffLink = wfMsg( 'diff' );
- } else {
- $query = $curIdEq.'&diff=0&oldid='.$rc_this_oldid;
- $aprops = ' tabindex="'.$baseRC->counter.'"';
- $curLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'cur' ), $query, '' ,'' , $aprops );
- $diffLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'diff'), $query, '' ,'' , $aprops );
- }
-
- # Make "last" link
- $titleObj = $rc->getTitle();
- if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- $lastLink = wfMsg( 'last' );
- } else {
- $lastLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'last' ),
- $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid );
- }
-
- # Make user link (or user contributions for unregistered users)
- if ( $rc_user == 0 ) {
- $userLink = $this->makeKnownLink( $wgLang->specialPage( 'Contributions' ),
- $rc_user_text, 'target=' . $rc_user_text );
- } else {
- $userLink = $this->makeLink( $wgLang->getNsText(
- Namespace::getUser() ) . ':'.$rc_user_text, $rc_user_text );
- }
-
- $rc->userlink = $userLink;
- $rc->lastlink = $lastLink;
- $rc->curlink = $curLink;
- $rc->difflink = $diffLink;
-
- # Make user talk link
- $utns=$wgLang->getNsText(NS_USER_TALK);
- $talkname=$wgLang->getNsText(NS_TALK); # use the shorter name
- $userTalkLink= $this->makeLink($utns . ':'.$rc_user_text, $talkname );
-
- global $wgDisableAnonTalk;
- if ( ( 0 == $rc_user ) && $wgUser->isSysop() ) {
- $blockLink = $this->makeKnownLink( $wgLang->specialPage(
- 'Blockip' ), wfMsg( 'blocklink' ), 'ip='.$rc_user_text );
- if( $wgDisableAnonTalk )
- $rc->usertalklink = ' ('.$blockLink.')';
- else
- $rc->usertalklink = ' ('.$userTalkLink.' | '.$blockLink.')';
- } else {
- if( $wgDisableAnonTalk && ($rc_user == 0) )
- $rc->usertalklink = '';
- else
- $rc->usertalklink = ' ('.$userTalkLink.')';
- }
-
- # Put accumulated information into the cache, for later display
- # Page moves go on their own line
- $title = $rc->getTitle();
- $secureName = $title->getPrefixedDBkey();
- if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
- # Use an @ character to prevent collision with page names
- $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
- } else {
- if ( !isset ( $this->rc_cache[$secureName] ) ) $this->rc_cache[$secureName] = array() ;
- array_push ( $this->rc_cache[$secureName] , $rc ) ;
- }
- return $ret;
- }
-
- function endImageHistoryList() {
- $s = "
\n";
- return $s;
- }
/**
* This function is called by all recent changes variants, by the page history,
@@ -2577,7 +1941,10 @@ class Skin {
* temporarily to a value pass. Should be adjusted further. --brion
*/
function formatComment($comment, $title = NULL) {
- global $wgLang;
+ $fname = 'Skin::formatComment';
+ wfProfileIn( $fname );
+
+ global $wgContLang;
$comment = htmlspecialchars( $comment );
# The pattern for autogen comments is / * foo * /, which makes for
@@ -2608,7 +1975,7 @@ class Skin {
# format regular and media links - all other wiki formatting
# is ignored
- $medians = $wgLang->getNsText(Namespace::getMedia()).':';
+ $medians = $wgContLang->getNsText(Namespace::getMedia()).':';
while(preg_match('/\[\[(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) {
# Handle link renaming [[foo|text]] will show link as "text"
if( "" != $match[3] ) {
@@ -2622,7 +1989,7 @@ class Skin {
$thelink = $this->makeMediaLink( $submatch[1], "", $text );
} else {
# Other kind of link
- if( preg_match( wfMsg( "linktrail" ), $match[4], $submatch ) ) {
+ if( preg_match( wfMsgForContent( "linktrail" ), $match[4], $submatch ) ) {
$trail = $submatch[1];
} else {
$trail = "";
@@ -2634,65 +2001,10 @@ class Skin {
}
$comment = preg_replace( $linkRegexp, $thelink, $comment, 1 );
}
+ wfProfileOut( $fname );
return $comment;
}
-
- function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description ) {
- global $wgUser, $wgLang, $wgTitle;
-
- $datetime = $wgLang->timeanddate( $timestamp, true );
- $del = wfMsg( 'deleteimg' );
- $delall = wfMsg( 'deleteimgcompletely' );
- $cur = wfMsg( 'cur' );
-
- if ( $iscur ) {
- $url = Image::wfImageUrl( $img );
- $rlink = $cur;
- if ( $wgUser->isSysop() ) {
- $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
- '&action=delete' );
- $style = $this->getInternalLinkAttributes( $link, $delall );
-
- $dlink = '
'.$delall.'';
- } else {
- $dlink = $del;
- }
- } else {
- $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
- if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
- $rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
- wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
- urlencode( $img ) );
- $dlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
- $del, 'action=delete&oldimage=' . urlencode( $img ) );
- } else {
- # Having live active links for non-logged in users
- # means that bots and spiders crawling our site can
- # inadvertently change content. Baaaad idea.
- $rlink = wfMsg( 'revertimg' );
- $dlink = $del;
- }
- }
- if ( 0 == $user ) {
- $userlink = $usertext;
- } else {
- $userlink = $this->makeLink( $wgLang->getNsText( Namespace::getUser() ) .
- ':'.$usertext, $usertext );
- }
- $nbytes = wfMsg( 'nbytes', $size );
- $style = $this->getInternalLinkAttributes( $url, $datetime );
-
- $s = "
({$dlink}) ({$rlink}) {$datetime}"
- . " . . {$userlink} ({$nbytes})";
-
- if ( '' != $description && '*' != $description ) {
- $sk=$wgUser->getSkin();
- $s .= $wgLang->emphasize(' (' . $sk->formatComment($description,$wgTitle) . ')');
- }
- $s .= "\n";
- return $s;
- }
-
+
function tocIndent($level) {
return str_repeat( '
'."\n", $level>0 ? $level : 0 );
}
@@ -2720,7 +2032,7 @@ class Skin {
$hideline = ' ';
return
'
'."\n".
- ''.wfMsg('toc').'' .
+ ''.wfMsgForContent('toc').'' .
$hideline .
' |
'."\n".
$toc." |
\n";
@@ -2736,24 +2048,24 @@ class Skin {
return '
'.$head.'';
}
- function editSectionScript( $section, $head ) {
- global $wgTitle, $wgRequest;
+ function editSectionScript( $nt, $section, $head ) {
+ global $wgRequest;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
return $head;
}
- $url = $wgTitle->escapeLocalURL( 'action=edit§ion='.$section );
+ $url = $nt->escapeLocalURL( 'action=edit§ion='.$section );
return '
'.$head.'';
}
function editSectionLinkForOther( $title, $section ) {
global $wgRequest;
- global $wgUser, $wgLang;
+ global $wgContLang;
$title = Title::newFromText($title);
$editurl = '§ion='.$section;
$url = $this->makeKnownLink($title->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
- if( $wgLang->isRTL() ) {
+ if( $wgContLang->isRTL() ) {
$farside = 'left';
$nearside = 'right';
} else {
@@ -2764,9 +2076,9 @@ class Skin {
}
- function editSectionLink( $section ) {
+ function editSectionLink( $nt, $section ) {
global $wgRequest;
- global $wgTitle, $wgUser, $wgLang;
+ global $wgContLang;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
# Section edit links would be out of sync on an old page.
@@ -2776,9 +2088,9 @@ class Skin {
}
$editurl = '§ion='.$section;
- $url = $this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
+ $url = $this->makeKnownLink($nt->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
- if( $wgLang->isRTL() ) {
+ if( $wgContLang->isRTL() ) {
$farside = 'left';
$nearside = 'right';
} else {
@@ -2789,133 +2101,6 @@ class Skin {
}
- /**
- * This function is called by EditPage.php and shows a bulletin board style
- * toolbar for common editing functions. It can be disabled in the user
- * preferences.
- * The necessary JavaScript code can be found in style/wikibits.js.
- */
- function getEditToolbar() {
- global $wgStylePath, $wgLang, $wgMimeType;
-
- /**
- * toolarray an array of arrays which each include the filename of
- * the button image (without path), the opening tag, the closing tag,
- * and optionally a sample text that is inserted between the two when no
- * selection is highlighted.
- * The tip text is shown when the user moves the mouse over the button.
- *
- * Already here are accesskeys (key), which are not used yet until someone
- * can figure out a way to make them work in IE. However, we should make
- * sure these keys are not defined on the edit page.
- */
- $toolarray=array(
- array( 'image'=>'button_bold.png',
- 'open' => "\'\'\'",
- 'close' => "\'\'\'",
- 'sample'=> wfMsg('bold_sample'),
- 'tip' => wfMsg('bold_tip'),
- 'key' => 'B'
- ),
- array( 'image'=>'button_italic.png',
- 'open' => "\'\'",
- 'close' => "\'\'",
- 'sample'=> wfMsg('italic_sample'),
- 'tip' => wfMsg('italic_tip'),
- 'key' => 'I'
- ),
- array( 'image'=>'button_link.png',
- 'open' => '[[',
- 'close' => ']]',
- 'sample'=> wfMsg('link_sample'),
- 'tip' => wfMsg('link_tip'),
- 'key' => 'L'
- ),
- array( 'image'=>'button_extlink.png',
- 'open' => '[',
- 'close' => ']',
- 'sample'=> wfMsg('extlink_sample'),
- 'tip' => wfMsg('extlink_tip'),
- 'key' => 'X'
- ),
- array( 'image'=>'button_headline.png',
- 'open' => "\\n== ",
- 'close' => " ==\\n",
- 'sample'=> wfMsg('headline_sample'),
- 'tip' => wfMsg('headline_tip'),
- 'key' => 'H'
- ),
- array( 'image'=>'button_image.png',
- 'open' => '[['.$wgLang->getNsText(NS_IMAGE).":",
- 'close' => ']]',
- 'sample'=> wfMsg('image_sample'),
- 'tip' => wfMsg('image_tip'),
- 'key' => 'D'
- ),
- array( 'image' => 'button_media.png',
- 'open' => '[['.$wgLang->getNsText(NS_MEDIA).':',
- 'close' => ']]',
- 'sample'=> wfMsg('media_sample'),
- 'tip' => wfMsg('media_tip'),
- 'key' => 'M'
- ),
- array( 'image' => 'button_math.png',
- 'open' => "\\
",
- 'sample'=> wfMsg('math_sample'),
- 'tip' => wfMsg('math_tip'),
- 'key' => 'C'
- ),
- array( 'image' => 'button_nowiki.png',
- 'open' => "\\
",
- 'close' => "\\",
- 'sample'=> wfMsg('nowiki_sample'),
- 'tip' => wfMsg('nowiki_tip'),
- 'key' => 'N'
- ),
- array( 'image' => 'button_sig.png',
- 'open' => '--~~~~',
- 'close' => '',
- 'sample'=> '',
- 'tip' => wfMsg('sig_tip'),
- 'key' => 'Y'
- ),
- array( 'image' => 'button_hr.png',
- 'open' => "\\n----\\n",
- 'close' => '',
- 'sample'=> '',
- 'tip' => wfMsg('hr_tip'),
- 'key' => 'R'
- )
- );
- $toolbar ="";
- return $toolbar;
- }
-
/**
* @access public
*/