if ( $t->isRedirect() ) {
# Page is a redirect
$colour = 'mw-redirect';
- } elseif ( $threshold > 0 &&
+ } elseif ( $threshold > 0 &&
$t->exists() && $t->getLength() < $threshold &&
MWNamespace::isContent( $t->getNamespace() ) ) {
# Page is a stub
}
}
- /**
+ /**
* Returns the filename part of an url.
* Used as alternative text for external images.
*/
return $basename;
}
- /**
+ /**
* Return the code for images which were added via external links,
* via Parser::maybeMakeExternalImage().
*/
# So we don't need to pass it here in $query. However, the URL for the
# zoom icon still needs it, so we make a unique query for it. See bug 14771
$url = $title->getLocalURL( $query );
- if( $page ) {
+ if( $page ) {
$url = wfAppendQuery( $url, 'page=' . urlencode( $page ) );
}
}
list( $inside, $trail ) = self::splitTrail( $trail );
-
+
wfProfileOut( __METHOD__ );
return Html::element( 'a', array(
'href' => $href,
}
}
- /**
+ /**
* Make a link to a special page given its name and, optionally,
- * a message key from the link text.
+ * a message key from the link text.
* Usage example: $skin->specialLink( 'recentchanges' )
*/
function specialLink( $name, $key = '' ) {
* @param boolean $escape Do we escape the link text?
* @param String $linktype Type of external link. Gets added to the classes
* @param array $attribs Array of extra attributes to <a>
- *
- * @todo FIXME: This is a really crappy implementation. $linktype and
+ *
+ * @todo FIXME: This is a really crappy implementation. $linktype and
* 'external' are mashed into the class attrib for the link (which is made
- * into a string). Then, if we've got additional params in $attribs, we
+ * into a string). Then, if we've got additional params in $attribs, we
* add to it. People using this might want to change the classes (or other
- * default link attributes), but passing $attribsText is just messy. Would
- * make a lot more sense to make put the classes into $attribs, let the
- * hook play with them, *then* expand it all at once.
+ * default link attributes), but passing $attribsText is just messy. Would
+ * make a lot more sense to make put the classes into $attribs, let the
+ * hook play with them, *then* expand it all at once.
*/
function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
if ( isset( $attribs[ 'class' ] ) ) $class = $attribs[ 'class' ]; # yet another hack :(
if( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
$link = wfMsgHtml( 'rev-deleted-user' );
} else if( $rev->userCan( Revision::DELETED_USER ) ) {
- $link = $this->userLink( $rev->getUser( Revision::FOR_THIS_USER ),
+ $link = $this->userLink( $rev->getUser( Revision::FOR_THIS_USER ),
$rev->getUserText( Revision::FOR_THIS_USER ) );
} else {
$link = wfMsgHtml( 'rev-deleted-user' );
$link = wfMsgHtml( 'rev-deleted-user' );
} else if( $rev->userCan( Revision::DELETED_USER ) ) {
$userId = $rev->getUser( Revision::FOR_THIS_USER );
- $userText = $rev->getUserText( Revision::FOR_THIS_USER );
+ $userText = $rev->getUserText( Revision::FOR_THIS_USER );
$link = $this->userLink( $userId, $userText ) .
' ' . $this->userToolLinks( $userId, $userText );
} else {
unset( $this->autocommentLocal );
return $comment;
}
-
+
private function formatAutocommentsCallback( $match ) {
$title = $this->autocommentTitle;
$local = $this->autocommentLocal;
-
+
$pre=$match[1];
$auto=$match[2];
$post=$match[3];
if ( $local ) {
$sectionTitle = Title::newFromText( '#' . $section );
} else {
- $sectionTitle = Title::makeTitleSafe( $title->getNamespace(),
+ $sectionTitle = Title::makeTitleSafe( $title->getNamespace(),
$title->getDBkey(), $section );
}
if ( $sectionTitle ) {
if (isset($match[1][0]) && $match[1][0] == ':')
$match[1] = substr($match[1], 1);
list( $inside, $trail ) = Linker::splitTrail( $trail );
-
+
$linkText = $text;
$linkTarget = Linker::normalizeSubpageLink( $this->commentContextTitle,
$match[1], $linkText );
-
+
$target = Title::newFromText( $linkTarget );
if( $target ) {
if( $target->getText() == '' && !$this->commentLocal && $this->commentContextTitle ) {
return $comment;
}
-
+
static function normalizeSubpageLink( $contextTitle, $target, &$text ) {
# Valid link forms:
# Foobar -- normal
/**
* End a Table Of Contents line.
- * tocUnindent() will be used instead if we're ending a line below
+ * tocUnindent() will be used instead if we're ending a line below
* the new level.
*/
function tocLineEnd() {
return "</li>\n";
}
- /**
+ /**
* Wraps the TOC in a table and provides the hide/collapse javascript.
* @param string $toc html of the Table Of Contents
* @return string Full html of the TOC
. ' } ' )
. "\n";
}
-
+
/**
* Generate a table of contents from a section tree
* Currently unused.
$lastLevel - $section['toclevel'] );
else
$toc .= $this->tocLineEnd();
-
+
$toc .= $this->tocLine( $section['anchor'],
$section['line'], $section['number'],
$section['toclevel'], $section['index'] );
* @return string HTML to use for edit link
*/
public function doEditSectionLink( Title $nt, $section, $tooltip = null ) {
+ // HTML generated here should probably have userlangattributes
+ // added to it for LTR text on RTL pages
$attribs = array();
if( !is_null( $tooltip ) ) {
$attribs['title'] = wfMsg( 'editsectionhint', $tooltip );
wfProfileOut( __METHOD__ );
return false;
}
-
+
/**
* Creates a (show/hide) link for deleting revisions/log entries
*
$link = $this->link( $sp, $text, array(), $query, array( 'known', 'noclasses' ) );
return Xml::tags( $tag, array( 'class' => 'mw-revdelundel-link' ), "($link)" );
}
-
+
/**
* Creates a dead (show/hide) link for deleting revisions/log entries
*
/**
* Returns the attributes for the tooltip and access key
*/
- public function tooltipAndAccesskeyAttribs( $name ) {
+ public function tooltipAndAccesskeyAttribs( $name ) {
global $wgEnableTooltipsAndAccesskeys;
if ( !$wgEnableTooltipsAndAccesskeys )
return '';
* @deprecated Returns raw bits of HTML, use titleAttrib() and accesskey()
*/
public function tooltipAndAccesskey( $name ) {
- return Xml::expandAttributes( $this->tooltipAndAccesskeyAttribs( $name ) );
+ return Xml::expandAttributes( $this->tooltipAndAccesskeyAttribs( $name ) );
}
-
+
/** @deprecated Returns raw bits of HTML, use titleAttrib() */
public function tooltip( $name, $options = null ) {
$tpl->setRef( 'userpage', $this->userpage );
$tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
$tpl->set( 'userlang', $wgLang->getCode() );
- $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '"' );
+ $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '" dir="' . $wgLang->getDir() . '"');
+ if($this->mTitle->isSpecialPage()) {
+ $tpl->set( 'specialpageattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '" dir="' . $wgLang->getDir() . '"');
+ }
$newtalks = $wgUser->getNewMessageLinks();
'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ),
'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ),
'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ),
- 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ),
- 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
- 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
- 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
- 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
+ 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ),
+ 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
+ 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
+ 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
+ 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ),
'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ),
- 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
+ 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ),
- 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
+ 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ),
'Wantedfiles' => array( 'SpecialPage', 'Wantedfiles' ),
'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ),
'Wantedtemplates' => array( 'SpecialPage', 'Wantedtemplates' ),
# List of pages
- 'Allpages' => 'SpecialAllpages',
- 'Prefixindex' => 'SpecialPrefixindex',
+ 'Allpages' => 'SpecialAllpages',
+ 'Prefixindex' => 'SpecialPrefixindex',
'Categories' => array( 'SpecialPage', 'Categories' ),
'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ),
- 'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
+ 'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
# Login/create account
- 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
+ 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ),
# Users and rights
'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ),
'Resetpass' => 'SpecialResetpass',
'DeletedContributions' => 'DeletedContributionsPage',
- 'Preferences' => 'SpecialPreferences',
- 'Contributions' => 'SpecialContributions',
+ 'Preferences' => 'SpecialPreferences',
+ 'Contributions' => 'SpecialContributions',
'Listgrouprights' => 'SpecialListGroupRights',
'Listusers' => array( 'SpecialPage', 'Listusers' ),
'Activeusers' => 'SpecialActiveUsers',
'Userrights' => 'UserrightsPage',
# Recent changes and logs
- 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
+ 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
'Log' => array( 'SpecialPage', 'Log' ),
'Watchlist' => array( 'SpecialPage', 'Watchlist' ),
'Newpages' => 'SpecialNewpages',
'Import' => 'SpecialImport',
'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ),
'Whatlinkshere' => 'SpecialWhatlinkshere',
- 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
-
+ 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
+
# Other
'Booksources' => 'SpecialBookSources',
-
+
# Unlisted / redirects
'Blankpage' => 'SpecialBlankpage',
- 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
+ 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ),
'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
* Outputs a summary message on top of special pages
* Per default the message key is the canonical name of the special page
* May be overriden, i.e. by extensions to stick with the naming conventions
- * for message keys: 'extensionname-xxx'
+ * for message keys: 'extensionname-xxx'
*
* @param string message key of the summary
*/
if( !File::checkExtensionCompatibility( $file, $nt->getDBkey() ) ) {
$errors[] = array('imagetypemismatch');
}
- }
+ }
$destfile = wfLocalFile( $nt );
if( !$wgUser->isAllowed( 'reupload-shared' ) && !$destfile->exists() && wfFindFile( $nt ) ) {
$errors[] = array( 'file-exists-sharedrepo' );
}
-
+
}
if ( $auth ) {
return $prepend . $namespaceKey;
}
+ /**
+ * Returns true if this is a special page.
+ */
+ public function isSpecialPage( ) {
+ return $this->getNamespace() == NS_SPECIAL;
+ }
+
/**
* Returns true if this title resolves to the named special page
* @param $name \type{\string} The special page name
$template = 'ModernTemplate', $useHeadElement = true;
/*
- * We don't like the default getPoweredBy, the icon clashes with the
+ * We don't like the default getPoweredBy, the icon clashes with the
* skin L&F.
*/
function getPoweredBy() {
<!-- contentholder does nothing by default, but it allows users to style the text inside
the content area without affecting the meaning of 'em' in #mw_content, which is used
for the margins -->
- <div id="mw_contentholder">
+ <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
<div class='mw-topboxes'>
- <div id="mw-js-message" style="display:none;"></div>
+ <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes')?>></div>
<div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
<?php if($this->data['newtalk'] ) {
?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
<?php } ?>
</div>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
+ <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
<?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
<?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#mw_portlets"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
</div><!-- mw_content -->
</div><!-- mw_contentwrapper -->
- <div id="mw_portlets">
+ <div id="mw_portlets" <?php $this->html("userlangattributes") ?>>
<!-- portlets -->
- <?php
- $sidebar = $this->data['sidebar'];
+ <?php
+ $sidebar = $this->data['sidebar'];
if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
</div>
- <!-- footer -->
- <div id="footer">
+ <!-- footer -->
+ <div id="footer" <?php $this->html('userlangattributes') ?>>
<ul id="f-list">
<?php
$footerlinks = array(
<?php } else {
# allow raw HTML block to be defined by extensions
print $cont;
- }
+ }
?>
</div>
</div>
class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
<div id="globalWrapper">
<div id="column-content">
- <div id="content">
+ <div id="content" <?php $this->html("specialpageattributes") ?>>
<a id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
<h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
<div id="bodyContent">
<h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
+ <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
<?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
<?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
<?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
</div>
</div>
</div>
- <div id="column-one">
+ <div id="column-one" <?php $this->html('userlangattributes') ?>>
<div id="p-cactions" class="portlet">
<h5><?php $this->msg('views') ?></h5>
<div class="pBody">
- <ul <?php $this->html('userlangattributes') ?>>
+ <ul>
<?php foreach($this->data['content_actions'] as $key => $tab) {
echo '
<li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
?>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
- <div id="footer">
+ <div id="footer" <?php $this->html('userlangattributes') ?>>
<?php
if($this->data['poweredbyico']) { ?>
<div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
global $wgUseTwoButtonsSearchForm;
?>
<div id="p-search" class="portlet">
- <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg('search') ?></label></h5>
+ <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
<form action="<?php $this->text('wgScript') ?>" id="searchform">
<input type='hidden' name="title" value="<?php $this->text('searchtitle') ?>"/>
function toolbox() {
?>
<div class="portlet" id="p-tb">
- <h5 <?php $this->html('userlangattributes')?>><?php $this->msg('toolbox') ?></h5>
+ <h5><?php $this->msg('toolbox') ?></h5>
<div class="pBody">
<ul>
<?php
function customBox( $bar, $cont ) {
?>
<div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>>
- <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
+ <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo htmlspecialchars($bar); else echo htmlspecialchars($out); ?></h5>
<div class='pBody'>
<?php if ( is_array( $cont ) ) { ?>
<ul>
<div id="page-base" class="noprint"></div>
<div id="head-base" class="noprint"></div>
<!-- content -->
- <div id="content">
+ <div id="content" <?php $this->html('specialpageattributes') ?>>
<a id="top"></a>
- <div id="mw-js-message" style="display:none;"></div>
+ <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes') ?>></div>
<?php if ( $this->data['sitenotice'] ): ?>
<!-- sitenotice -->
<div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
<h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3>
<!-- /tagline -->
<!-- subtitle -->
- <div id="contentSub"><?php $this->html( 'subtitle' ) ?></div>
+ <div id="contentSub" <?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
<!-- /subtitle -->
<?php if ( $this->data['undelete'] ): ?>
<!-- undelete -->
</div>
<!-- /panel -->
<!-- footer -->
- <div id="footer">
+ <div id="footer" <?php $this->html('userlangattributes') ?>>
<?php foreach( $validFooterLinks as $category => $links ): ?>
<?php if ( count( $links ) > 0 ): ?>
<ul id="footer-<?php echo $category ?>">