/**
*
* @package MediaWiki
+ * @subpackage Skins
*/
/**
# See skin.doc
require_once( 'Image.php' );
-# These are the INTERNAL names, which get mapped directly to class names and
-# file names in ./skins/. For display purposes, the Language class has
-# internationalized names
-#
-/*
-$wgValidSkinNames = array(
- 'standard' => 'Standard',
- 'nostalgia' => 'Nostalgia',
- 'cologneblue' => 'CologneBlue'
-);
-if( $wgUsePHPTal ) {
- #$wgValidSkinNames[] = 'PHPTal';
- #$wgValidSkinNames['davinci'] = 'DaVinci';
- #$wgValidSkinNames['mono'] = 'Mono';
- #$wgValidSkinNames['monobookminimal'] = 'MonoBookMinimal';
- $wgValidSkinNames['monobook'] = 'MonoBook';
- $wgValidSkinNames['myskin'] = 'MySkin';
- $wgValidSkinNames['chick'] = 'Chick';
-}
-*/
-
# Get a list of all skins available in /skins/
# Build using the regular expression '^(.*).php$'
# Array keys are all lower case, array value keep the case used by filename
var $rc_cache ; # Cache for Enhanced Recent Changes
var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle
var $rcMoveIndex;
- var $postParseLinkColour = true;
+ var $postParseLinkColour = false;
/**#@-*/
function Skin() {
- global $wgUseOldExistenceCheck;
- $postParseLinkColour = !$wgUseOldExistenceCheck;
$this->linktrail = wfMsg('linktrail');
}
}
else $a = array( 'bgcolor' => '#FFFFFF' );
if($wgOut->isArticle() && $wgUser->getOption('editondblclick') &&
- (!$wgTitle->isProtected() || $wgUser->isSysop()) ) {
+ (!$wgTitle->isProtected() || $wgUser->isAllowed('protect')) ) {
$t = wfMsg( 'editthispage' );
$oid = $red = '';
- if ( !empty($redirect) ) {
+ if ( !empty($redirect) && $redirect == 'no' ) {
$red = "&redirect={$redirect}";
}
if ( !empty($oldid) && ! isset( $diff ) ) {
- $oid = "&oldid={$oldid}";
+ $oid = "&oldid=" . IntVal( $oldid );
}
$s = $wgTitle->getFullURL( "action=edit{$oid}{$red}" );
$s = 'document.location = "' .$s .'";';
return $s;
}
+
function getCategoryLinks () {
global $wgOut, $wgTitle, $wgUser, $wgParser;
global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
$s .= '<br/><hr/>';
# get a big array of the parents tree
- $parenttree = $wgTitle->getCategorieBrowser();
+ $parenttree = $wgTitle->getParentCategoryTree();
# Render the array as a serie of links
function walkThrough ($tree) {
# add our current element to the list
$eltitle = Title::NewFromText($element);
# FIXME : should be makeLink() [AV]
- $return .= $sk->makeKnownLink($element, $eltitle->getText()).' > ';
+ $return .= $sk->makeLink($element, $eltitle->getText()).' > ';
}
return $return;
}
$action = $wgRequest->getText( 'action' );
$s = $this->printableLink();
- if ( wfMsgForContent ( 'disclaimers' ) != '-' )
- $s .= ' | ' . $this->makeKnownLink(
- wfMsgForContent( 'disclaimerpage' ),
- wfMsgForContent( 'disclaimers' ) ) ;
+ $disclaimer = $this->disclaimerLink(); # may be empty
+ if( $disclaimer ) {
+ $s .= ' | ' . $disclaimer;
+ }
if ( $wgOut->isArticleRelated() ) {
if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
$s.= ' | <strong>'. wfMsg( 'newmessages', $tl ) . '</strong>';
# disable caching
$wgOut->setSquidMaxage(0);
+ $wgOut->enableClientCache(false);
}
}
function getUndeleteLink() {
global $wgUser, $wgTitle, $wgContLang, $action;
- if( $wgUser->isSysop() &&
+ if( $wgUser->isAllowed('rollback') &&
(($wgTitle->getArticleId() == 0) || ($action == "history")) &&
($n = $wgTitle->isDeleted() ) ) {
return wfMsg( 'thisisdeleted',
global $wgOut, $wgTitle, $wgUser;
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
- if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
+ if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript($wgTitle, 0,$s);}
return $s;
}
}
}
}
- if ( $wgUser->isSysop() && $wgTitle->getArticleId() ) {
- $s .= "\n<br />" . $this->deleteThisPage() .
- $sep . $this->protectThisPage() .
- $sep . $this->moveThisPage();
+ if ( $wgTitle->getArticleId() ) {
+ $s .= "\n<br />";
+ if($wgUser->isAllowed('delete')) { $s .= $this->deleteThisPage(); }
+ if($wgUser->isAllowed('protect')) { $s .= $sep . $this->protectThisPage(); }
+ if($wgUser->isAllowed('move')) { $s .= $sep . $this->moveThisPage(); }
}
$s .= "<br />\n" . $this->otherLanguages();
}
return $s;
}
+ /**
+ * show a drop-down box of special pages
+ * @TODO crash bug913. Need to be rewrote completly.
+ */
function specialPagesList() {
global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript;
require_once('SpecialPage.php');
function disclaimerLink() {
- $s = $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
- wfMsg( 'disclaimers' ) );
- return $s;
+ $disclaimers = wfMsg( 'disclaimers' );
+ if ($disclaimers == '-') {
+ return "";
+ } else {
+ return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
+ $disclaimers );
+ }
}
function editThisPage() {
global $wgUser, $wgOut, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
- if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
+ if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
$n = $wgTitle->getPrefixedText();
$t = wfMsg( 'deletethispage' );
global $wgUser, $wgOut, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
- if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isSysop() ) {
+ if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('protect') ) {
$n = $wgTitle->getPrefixedText();
if ( $wgTitle->isProtected() ) {
function makeImage( $url, $alt = '' ) {
global $wgOut;
-
if ( '' == $alt ) {
$alt = $this->fnamePart( $url );
}
$align = '';
$prefix = $postfix = '';
- if ( $wgUseImageResize ) {
- # Check if the alt text is of the form "options|alt text"
- # Options are:
- # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang
- # * left no resizing, just left align. label is used for alt= only
- # * right same, but right aligned
- # * none same, but not aligned
- # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox
- # * center center the image
- # * framed Keep original image size, no magnify-button.
-
- $part = explode( '|', $alt);
-
- $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL );
- $mwLeft =& MagicWord::get( MAG_IMG_LEFT );
- $mwRight =& MagicWord::get( MAG_IMG_RIGHT );
- $mwNone =& MagicWord::get( MAG_IMG_NONE );
- $mwWidth =& MagicWord::get( MAG_IMG_WIDTH );
- $mwCenter =& MagicWord::get( MAG_IMG_CENTER );
- $mwFramed =& MagicWord::get( MAG_IMG_FRAMED );
- $alt = $part[count($part)-1];
-
- $height = $framed = $thumb = false;
- $manual_thumb = "" ;
-
- foreach( $part as $key => $val ) {
- $val_parts = explode ( "=" , $val , 2 ) ;
- $left_part = array_shift ( $val_parts ) ;
- if ( ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) {
- $thumb=true;
- } elseif ( count ( $val_parts ) == 1 && ! is_null( $mwThumb->matchVariableStartToEnd($left_part) ) ) {
- # use manually specified thumbnail
- $thumb=true;
- $manual_thumb = array_shift ( $val_parts ) ;
- } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) {
- # remember to set an alignment, don't render immediately
- $align = 'right';
- } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) {
- # remember to set an alignment, don't render immediately
- $align = 'left';
- } elseif ( ! is_null( $mwCenter->matchVariableStartToEnd($val) ) ) {
- # remember to set an alignment, don't render immediately
- $align = 'center';
- } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) {
- # remember to set an alignment, don't render immediately
- $align = 'none';
- } elseif ( ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) {
- # $match is the image width in pixels
- if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) {
- $width = intval( $m[1] );
- $height = intval( $m[2] );
- } else {
- $width = intval($match);
- }
- } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) {
- $framed=true;
+ # Check if the alt text is of the form "options|alt text"
+ # Options are:
+ # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang
+ # * left no resizing, just left align. label is used for alt= only
+ # * right same, but right aligned
+ # * none same, but not aligned
+ # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox
+ # * center center the image
+ # * framed Keep original image size, no magnify-button.
+
+ $part = explode( '|', $alt);
+
+ $mwThumb =& MagicWord::get( MAG_IMG_THUMBNAIL );
+ $mwLeft =& MagicWord::get( MAG_IMG_LEFT );
+ $mwRight =& MagicWord::get( MAG_IMG_RIGHT );
+ $mwNone =& MagicWord::get( MAG_IMG_NONE );
+ $mwWidth =& MagicWord::get( MAG_IMG_WIDTH );
+ $mwCenter =& MagicWord::get( MAG_IMG_CENTER );
+ $mwFramed =& MagicWord::get( MAG_IMG_FRAMED );
+ $alt = '';
+
+ $height = $framed = $thumb = false;
+ $manual_thumb = "" ;
+
+ foreach( $part as $key => $val ) {
+ $val_parts = explode ( "=" , $val , 2 ) ;
+ $left_part = array_shift ( $val_parts ) ;
+ if ( $wgUseImageResize && ! is_null( $mwThumb->matchVariableStartToEnd($val) ) ) {
+ $thumb=true;
+ } elseif ( $wgUseImageResize && count ( $val_parts ) == 1 && ! is_null( $mwThumb->matchVariableStartToEnd($left_part) ) ) {
+ # use manually specified thumbnail
+ $thumb=true;
+ $manual_thumb = array_shift ( $val_parts ) ;
+ } elseif ( ! is_null( $mwRight->matchVariableStartToEnd($val) ) ) {
+ # remember to set an alignment, don't render immediately
+ $align = 'right';
+ } elseif ( ! is_null( $mwLeft->matchVariableStartToEnd($val) ) ) {
+ # remember to set an alignment, don't render immediately
+ $align = 'left';
+ } elseif ( ! is_null( $mwCenter->matchVariableStartToEnd($val) ) ) {
+ # remember to set an alignment, don't render immediately
+ $align = 'center';
+ } elseif ( ! is_null( $mwNone->matchVariableStartToEnd($val) ) ) {
+ # remember to set an alignment, don't render immediately
+ $align = 'none';
+ } elseif ( $wgUseImageResize && ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) {
+ # $match is the image width in pixels
+ if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) {
+ $width = intval( $m[1] );
+ $height = intval( $m[2] );
+ } else {
+ $width = intval($match);
}
+ } elseif ( ! is_null( $mwFramed->matchVariableStartToEnd($val) ) ) {
+ $framed=true;
+ } else {
+ $alt = $val;
}
- if ( 'center' == $align )
- {
- $prefix = '<span style="text-align: center">';
- $postfix = '</span>';
- $align = 'none';
- }
-
- if ( $thumb || $framed ) {
-
- # Create a thumbnail. Alignment depends on language
- # writing direction, # right aligned for left-to-right-
- # languages ("Western languages"), left-aligned
- # for right-to-left-languages ("Semitic languages")
- #
- # If thumbnail width has not been provided, it is set
- # here to 180 pixels
- if ( $align == '' ) {
- $align = $wgContLang->isRTL() ? 'left' : 'right';
- }
- if ( ! isset($width) ) {
- $width = 180;
- }
- return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
+ }
+ if ( 'center' == $align )
+ {
+ $prefix = '<div class="center">';
+ $postfix = '</div>';
+ $align = 'none';
+ }
+
+ if ( $thumb || $framed ) {
+
+ # Create a thumbnail. Alignment depends on language
+ # writing direction, # right aligned for left-to-right-
+ # languages ("Western languages"), left-aligned
+ # for right-to-left-languages ("Semitic languages")
+ #
+ # If thumbnail width has not been provided, it is set
+ # here to 180 pixels
+ if ( $align == '' ) {
+ $align = $wgContLang->isRTL() ? 'left' : 'right';
+ }
+ if ( ! isset($width) ) {
+ $width = 180;
+ }
+ return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
- } elseif ( isset($width) ) {
+ } elseif ( isset($width) ) {
- # Create a resized image, without the additional thumbnail
- # features
+ # Create a resized image, without the additional thumbnail
+ # features
- if ( ( ! $height === false )
- && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) {
- print "height=$height<br>\nimg->getHeight() = ".$img->getHeight()."<br>\n";
- print 'rescaling by factor '. $height / $img->getHeight() . "<br>\n";
- $width = $img->getWidth() * $height / $img->getHeight();
- }
- if ( '' == $manual_thumb ) $url = $img->createThumb( $width );
+ if ( ( ! $height === false )
+ && ( $img->getHeight() * $width / $img->getWidth() > $height ) ) {
+ $width = $img->getWidth() * $height / $img->getHeight();
}
- } # endif $wgUseImageResize
-
- if ( empty( $alt ) ) {
- $alt = preg_replace( '/\.(.+?)^/', '', $img->getName() );
+ if ( '' == $manual_thumb ) $url = $img->createThumb( $width );
}
+
$alt = preg_replace( '/<[^>]*>/', '', $alt );
$alt = preg_replace('/&(?!:amp;|#[Xx][0-9A-fa-f]+;|#[0-9]+;|[a-zA-Z0-9]+;)/', '&', $alt);
$alt = str_replace( array('<', '>', '"'), array('<', '>', '"'), $alt );
$u = $nt->escapeLocalURL();
- if ( $url == '' )
- {
+ if ( $url == '' ) {
$s = wfMsg( 'missingimage', $img->getName() );
$s .= "<br>{$alt}<br>{$url}<br>\n";
} else {
$s = '<a href="'.$u.'" class="image" title="'.$alt.'">' .
- '<img src="'.$url.'" alt="'.$alt.'" /></a>';
+ '<img src="'.$url.'" alt="'.$alt.'" longdesc="'.$u.'" /></a>';
}
if ( '' != $align ) {
$s = "<div class=\"float{$align}\"><span>{$s}</span></div>";
} else {
$s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'.
'<img src="'.$thumbUrl.'" alt="'.$alt.'" ' .
- 'width="'.$boxwidth.'" height="'.$boxheight.'" /></a>';
+ 'width="'.$boxwidth.'" height="'.$boxheight.'" ' .
+ 'longdesc="'.$u.'" /></a>';
if ( $framed ) {
$zoomicon="";
} else {
}
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 = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
+ $s = "<a href=\"{$u}\" class='internal' title=\"{$alt}\">{$alt}</a>";
}
return $s;
}
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$r .= ' ';
} else {
- # M & N (minor & new)
+ # M, N and !
$M = wfMsg( 'minoreditletter' );
$N = wfMsg( 'newpageletter' );
} else {
$r .= ' ' ;
}
+ if ( $rcObj->unpatrolled ) {
+ $r .= '!';
+ } else {
+ $r .= ' ';
+ }
}
# Timestamp
# Collate list of users
$isnew = false ;
+ $unpatrolled = false;
$userlinks = array () ;
foreach ( $block AS $rcObj ) {
$oldid = $rcObj->mAttribs['rc_last_oldid'];
- if ( $rcObj->mAttribs['rc_new'] ) $isnew = true ;
+ if ( $rcObj->mAttribs['rc_new'] ) {
+ $isnew = true ;
+ }
$u = $rcObj->userlink ;
- if ( !isset ( $userlinks[$u] ) ) $userlinks[$u] = 0 ;
+ if ( !isset ( $userlinks[$u] ) ) {
+ $userlinks[$u] = 0 ;
+ }
+ if ( $rcObj->unpatrolled ) {
+ $unpatrolled = true;
+ }
$userlinks[$u]++ ;
}
$rcm = 'RCM'.$this->rcCacheIndex ;
$toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
$arrowdir = $wgContLang->isRTL() ? 'l' : 'r';
- $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" /></a></span>' ;
- $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_d.png" width="12" height="12" /></a></span>' ;
+ $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" alt="+" /></a></span>' ;
+ $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_d.png" width="12" height="12" alt="-" /></a></span>' ;
$r .= $tl ;
# Main line
if ( $isnew ) $r .= $N ;
else $r .= ' ' ;
$r .= ' ' ; # Minor
+ if ( $unpatrolled ) {
+ $r .= "!";
+ } else {
+ $r .= " ";
+ }
# Timestamp
$r .= ' '.$block[0]->timestamp.' ' ;
$r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
$r .= '<tt> ' ;
- if ( $rc_new ) $r .= $N ;
- else $r .= ' ' ;
- if ( $rc_minor ) $r .= $M ;
- else $r .= ' ' ;
- $r .= '</tt>' ;
+ if ( $rc_new ) {
+ $r .= $N ;
+ } else {
+ $r .= ' ' ;
+ }
+
+ if ( $rc_minor ) {
+ $r .= $M ;
+ } else {
+ $r .= ' ' ;
+ }
+
+ if ( $rcObj->unpatrolled ) {
+ $r .= "!";
+ } else {
+ $r .= " ";
+ }
+
+ $r .= ' </tt>' ;
$o = '' ;
if ( $rc_last_oldid != 0 ) {
extract( $rc->mAttribs );
$curIdEq = 'curid=' . $rc_cur_id;
+ # Should patrol-related stuff be shown?
+ $unpatrolled = $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
+
# Make date header if necessary
$date = $wgContLang->date( $rc_timestamp, true);
$uidate = $wgLang->date( $rc_timestamp, true);
$s = '';
if ( $date != $this->lastdate ) {
if ( '' != $this->lastdate ) { $s .= "</ul>\n"; }
- $s .= "<h4>{$uidate}</h4>\n<ul class='special'>";
+ $s .= "<h4>{$uidate}</h4>\n<ul class=\"special\">";
$this->lastdate = $date;
$this->rclistOpen = true;
}
- # If this edit has not yet been patrolled, make it stick out
- $s .= ( ! $wgUseRCPatrol || $rc_patrolled ) ? '<li> ' : '<li class="not_patrolled"> ';
+ $s .= '<li>';
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Diff
if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
$diffLink = wfMsg( 'diff' );
} else {
- if ( $wgUseRCPatrol && $rc_patrolled == 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
+ if ( $unpatrolled )
$rcidparam = "&rcid={$rc_id}";
else
$rcidparam = "";
$s .= $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
$s .= ') . . ';
- # M and N (minor and new)
+ # M, N and ! (minor, new and unpatrolled)
if ( $rc_minor ) { $s .= ' <span class="minor">'.wfMsg( "minoreditletter" ).'</span>'; }
if ( $rc_type == RC_NEW ) { $s .= '<span class="newpage">'.wfMsg( "newpageletter" ).'</span>'; }
+ if ( !$rc_patrolled ) { $s .= ' <span class="unpatrolled">!</span>'; }
# 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 ) )
+ if ( $unpatrolled && $rc_type == RC_NEW )
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
else
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '' );
}
# Block link
$blockLink='';
- if ( ( 0 == $rc_user ) && $wgUser->isSysop() ) {
+ if ( ( 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
$blockLink = $this->makeKnownLink( $wgContLang->specialPage(
'Blockip' ), wfMsg( 'blocklink' ), 'ip='.$rc_user_text );
function recentChangesLineNew( &$baseRC, $watched = false ) {
global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgRCSeconds;
-
+ global $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
+
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC ) ;
$ret .= "<h4>{$uidate}</h4>\n";
$this->lastdate = $date;
}
-
+
+ # Should patrol-related stuff be shown?
+ if ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') )) {
+ $rc->unpatrolled = !$rc_patrolled;
+ } else {
+ $rc->unpatrolled = false;
+ }
+
# Make article link
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
$logtype = $matches[1];
$logname = LogPage::logName( $logtype );
$clink = '(' . $this->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
+ } elseif ( $rc->unpatrolled && $rc_type == RC_NEW ) {
+ # Unpatrolled new page, give rc_id in query
+ $clink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
} else {
$clink = $this->makeKnownLinkObj( $rc->getTitle(), '' ) ;
}
# Make "last" link
$titleObj = $rc->getTitle();
+ if ( $rc->unpatrolled ) {
+ $rcIdQuery = "&rcid={$rc_id}";
+ } else {
+ $rcIdQuery = '';
+ }
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 );
+ $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
}
# Make user link (or user contributions for unregistered users)
$userTalkLink= $this->makeLink($utns . ':'.$rc_user_text, $talkname );
global $wgDisableAnonTalk;
- if ( ( 0 == $rc_user ) && $wgUser->isSysop() ) {
+ if ( ( 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
$blockLink = $this->makeKnownLink( $wgContLang->specialPage(
'Blockip' ), wfMsg( 'blocklink' ), 'ip='.$rc_user_text );
if( $wgDisableAnonTalk )
if ( $iscur ) {
$url = Image::wfImageUrl( $img );
$rlink = $cur;
- if ( $wgUser->isSysop() ) {
+ if ( $wgUser->isAllowed('delete') ) {
$link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
'&action=delete' );
$style = $this->getInternalLinkAttributes( $link, $delall );
$hideline = ' <script type="text/javascript">showTocToggle("' . addslashes( wfMsg('showtoc') ) . '","' . addslashes( wfMsg('hidetoc') ) . '")</script>';
return
'<table border="0" id="toc"><tr id="toctitle"><td align="center">'."\n".
- '<b>'.wfMsg('toc').'</b>' .
+ '<b>'.wfMsgForContent('toc').'</b>' .
$hideline .
'</td></tr><tr id="tocinside"><td>'."\n".
$toc."</td></tr></table>\n";
return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
}
- 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 '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
}
function editSectionLinkForOther( $title, $section ) {
global $wgRequest;
- global $wgUser, $wgContLang;
+ global $wgContLang;
$title = Title::newFromText($title);
$editurl = '§ion='.$section;
}
- function editSectionLink( $section ) {
+ function editSectionLink( $nt, $section ) {
global $wgRequest;
- global $wgTitle, $wgUser, $wgContLang;
+ global $wgContLang;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
# Section edit links would be out of sync on an old page.
}
$editurl = '§ion='.$section;
- $url = $this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
+ $url = $this->makeKnownLink($nt->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
if( $wgContLang->isRTL() ) {
$farside = 'left';