* (bug 6518) Replaced 'lastmodified' with 'lastmodifiedat' and 'lastmodifiedby' with 'lastmodifiedatby'
with seperated parameters for date and time to allow better localisation. Updated all message files
to display the old format for compatibility.
+* (bug 7357) Make supposedly static methods of Skin actually static
== Languages updated ==
$cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(),
wfMsgExt('cancel', array('parseinline')) );
- $edithelpurl = $sk->makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
+ $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
$edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
htmlspecialchars( wfMsg( 'edithelp' ) ).'</a> '.
htmlspecialchars( wfMsg( 'newwindow' ) );
$out->out( "\n</body></html>" );
}
- /*static*/ function makeGlobalVariablesScript( $data ) {
+ static function makeGlobalVariablesScript( $data ) {
$r = '<script type= "' . $data['jsmimetype'] . '">
var skin = "' . Xml::escapeJsString( $data['skinname'] ) . '";
var stylepath = "' . Xml::escapeJsString( $data['stylepath'] ) . '";
'lang' => $wgContLang->getCode(),
);
- $r = Skin::makeGlobalVariablesScript( $vars );
-
+ $r = self::makeGlobalVariablesScript( $vars );
+
$r .= "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
- $userjs = htmlspecialchars( $this->makeUrl(
+ $userjs = htmlspecialchars( self::makeUrl(
$userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
'action=raw&ctype='.$wgJsMimeType));
$r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n";
if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
$query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
- $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
- '@import "'.$this->makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n";
+ $s .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
+ '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n";
$s .= $this->doGetUserStyles();
return $s."\n";
$s .= $wgRequest->getText('wpTextbox1');
} else {
$userpage = $wgUser->getUserPage();
- $s.= '@import "'.$this->makeUrl(
+ $s.= '@import "'.self::makeUrl(
$userpage->getPrefixedText().'/'.$this->getSkinName().'.css',
'action=raw&ctype=text/css').'";'."\n";
}
}
/* these are used extensively in SkinTemplate, but also some other places */
- /*static*/ function makeSpecialUrl( $name, $urlaction='' ) {
+ static function makeSpecialUrl( $name, $urlaction = '' ) {
$title = Title::makeTitle( NS_SPECIAL, $name );
return $title->getLocalURL( $urlaction );
}
- /*static*/ function makeI18nUrl ( $name, $urlaction='' ) {
- $title = Title::newFromText( wfMsgForContent($name) );
- $this->checkTitle($title, $name);
+ static function makeI18nUrl( $name, $urlaction = '' ) {
+ $title = Title::newFromText( wfMsgForContent( $name ) );
+ self::checkTitle( $title, $name );
return $title->getLocalURL( $urlaction );
}
- /*static*/ function makeUrl ( $name, $urlaction='' ) {
+ static function makeUrl( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
- $this->checkTitle($title, $name);
+ self::checkTitle( $title, $name );
return $title->getLocalURL( $urlaction );
}
# If url string starts with http, consider as external URL, else
# internal
- /*static*/ function makeInternalOrExternalUrl( $name ) {
+ static function makeInternalOrExternalUrl( $name ) {
if ( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $name ) ) {
return $name;
} else {
- return $this->makeUrl( $name );
+ return self::makeUrl( $name );
}
}
# this can be passed the NS number as defined in Language.php
- /*static*/ function makeNSUrl( $name, $urlaction='', $namespace=NS_MAIN ) {
+ static function makeNSUrl( $name, $urlaction = '', $namespace = NS_MAIN ) {
$title = Title::makeTitleSafe( $namespace, $name );
- $this->checkTitle($title, $name);
+ self::checkTitle( $title, $name );
return $title->getLocalURL( $urlaction );
}
/* these return an array with the 'href' and boolean 'exists' */
- /*static*/ function makeUrlDetails ( $name, $urlaction='' ) {
+ static function makeUrlDetails( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
- $this->checkTitle($title, $name);
+ self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0?true:false
+ 'exists' => $title->getArticleID() != 0 ? true : false
);
}
/**
* Make URL details where the article exists (or at least it's convenient to think so)
*/
- function makeKnownUrlDetails( $name, $urlaction='' ) {
+ static function makeKnownUrlDetails( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
- $this->checkTitle($title, $name);
+ self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
'exists' => true
}
# make sure we have some title to operate on
- /*static*/ function checkTitle ( &$title, &$name ) {
- if(!is_object($title)) {
+ static function checkTitle( &$title, &$name ) {
+ if( !is_object( $title ) ) {
$title = Title::newFromText( $name );
- if(!is_object($title)) {
+ if( !is_object( $title ) ) {
$title = Title::newFromText( '--error: link target missing--' );
}
}
$text = $line[1];
if (wfEmptyMsg($line[0], $link))
$link = $line[0];
- $href = $this->makeInternalOrExternalUrl( $link );
+ $href = self::makeInternalOrExternalUrl( $link );
$bar[$heading][] = array(
'text' => $text,
'href' => $href,
$this->userpage = $userPage->getPrefixedText();
if ( $wgUser->isLoggedIn() || $this->showIPinHeader() ) {
- $this->userpageUrlDetails = $this->makeUrlDetails($this->userpage);
+ $this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
} else {
# This won't be used in the standard skins, but we define it to preserve the interface
# To save time, we check for existence
- $this->userpageUrlDetails = $this->makeKnownUrlDetails($this->userpage);
+ $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
}
$this->usercss = $this->userjs = $this->userjsprev = false;
global $wgUseSiteJs;
if ($wgUseSiteJs) {
if($this->loggedin) {
- $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&smaxage=0&gen=js') );
+ $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&smaxage=0&gen=js') );
} else {
- $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&gen=js') );
+ $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&gen=js') );
}
} else {
$tpl->set('jsvarurl', false);
'class' => $usertalkUrlDetails['exists']?false:'new',
'active' => ( $usertalkUrlDetails['href'] == $pageurl )
);
- $href = $this->makeSpecialUrl('Preferences');
+ $href = self::makeSpecialUrl( 'Preferences' );
$personal_urls['preferences'] = array(
- 'text' => wfMsg('mypreferences'),
- 'href' => $this->makeSpecialUrl('Preferences'),
+ 'text' => wfMsg( 'mypreferences' ),
+ 'href' => self::makeSpecialUrl( 'Preferences' ),
'active' => ( $href == $pageurl )
);
- $href = $this->makeSpecialUrl('Watchlist');
+ $href = self::makeSpecialUrl( 'Watchlist' );
$personal_urls['watchlist'] = array(
- 'text' => wfMsg('watchlist'),
+ 'text' => wfMsg( 'watchlist' ),
'href' => $href,
'active' => ( $href == $pageurl )
);
- $href = $this->makeSpecialUrl("Contributions/$this->username");
+ $href = self::makeSpecialUrl( "Contributions/$this->username" );
$personal_urls['mycontris'] = array(
- 'text' => wfMsg('mycontris'),
+ 'text' => wfMsg( 'mycontris' ),
'href' => $href
# FIXME # 'active' => ( $href == $pageurl . '/' . $this->username )
);
$personal_urls['logout'] = array(
- 'text' => wfMsg('userlogout'),
- 'href' => $this->makeSpecialUrl( 'Userlogout',
+ 'text' => wfMsg( 'userlogout' ),
+ 'href' => self::makeSpecialUrl( 'Userlogout',
$wgTitle->getNamespace() === NS_SPECIAL && $wgTitle->getText() === 'Preferences' ? '' : "returnto={$this->thisurl}"
)
);
);
$personal_urls['anonlogin'] = array(
'text' => wfMsg('userlogin'),
- 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+ 'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
);
} else {
$personal_urls['login'] = array(
'text' => wfMsg('userlogin'),
- 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+ 'href' => self::makeSpecialUrl( 'Userlogin', 'returnto=' . $this->thisurl ),
'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
);
}
function makeTalkUrlDetails( $name, $urlaction='' ) {
$title = Title::newFromText( $name );
$title = $title->getTalkPage();
- $this->checkTitle($title, $name);
+ $this->checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
'exists' => $title->getArticleID() != 0?true:false
function makeArticleUrlDetails( $name, $urlaction='' ) {
$title = Title::newFromText( $name );
$title= $title->getSubjectPage();
- $this->checkTitle($title, $name);
+ self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
'exists' => $title->getArticleID() != 0?true:false
'class' => false,
'text' => wfMsgExt( 'undelete_short', array( 'parsemag' ), $n ),
'href' => $undelTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
- #'href' => $this->makeSpecialUrl("Undelete/$this->thispage")
+ #'href' => self::makeSpecialUrl( "Undelete/$this->thispage" )
);
}
}
$diff = $wgRequest->getVal( 'diff' );
$nav_urls = array();
- $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
+ $nav_urls['mainpage'] = array( 'href' => self::makeI18nUrl( 'mainpage') );
if( $wgEnableUploads ) {
if ($wgUploadNavigationUrl) {
- $nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
+ $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
} else {
- $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
+ $nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) );
}
} else {
if ($wgUploadNavigationUrl)
- $nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
+ $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
else
$nav_urls['upload'] = false;
}
- $nav_urls['specialpages'] = array('href' => $this->makeSpecialUrl('Specialpages'));
+ $nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ) );
// A print stylesheet is attached to all pages, but nobody ever
if($id || $ip) { # both anons and non-anons have contri list
$nav_urls['contributions'] = array(
- 'href' => $this->makeSpecialUrl('Contributions/' . $this->mTitle->getText() )
+ 'href' => self::makeSpecialUrl( 'Contributions/' . $this->mTitle->getText() )
);
if ( $wgUser->isAllowed( 'block' ) )
$nav_urls['blockip'] = array(
- 'href' => $this->makeSpecialUrl( 'Blockip/' . $this->mTitle->getText() )
+ 'href' => self::makeSpecialUrl( 'Blockip/' . $this->mTitle->getText() )
);
} else {
$nav_urls['contributions'] = false;
$nav_urls['emailuser'] = false;
if( $this->showEmailUser( $id ) ) {
$nav_urls['emailuser'] = array(
- 'href' => $this->makeSpecialUrl('Emailuser/' . $this->mTitle->getText() )
+ 'href' => self::makeSpecialUrl( 'Emailuser/' . $this->mTitle->getText() )
);
}
wfProfileOut( $fname );
$usercss = $wgRequest->getText('wpTextbox1');
} else {
$usercss = '@import "' .
- $this->makeUrl($this->userpage . '/'.$this->skinname.'.css',
+ self::makeUrl($this->userpage . '/'.$this->skinname.'.css',
'action=raw&ctype=text/css') . '";' ."\n";
}
# If we use the site's dynamic CSS, throw that in, too
if ( $wgUseSiteCss ) {
$query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
- $sitecss .= '@import "' . $this->makeNSUrl('Common.css', $query, NS_MEDIAWIKI) . '";' . "\n";
- $sitecss .= '@import "' . $this->makeNSUrl(ucfirst($this->skinname) . '.css', $query, NS_MEDIAWIKI) . '";' . "\n";
- $sitecss .= '@import "' . $this->makeUrl('-','action=raw&gen=css' . $siteargs) . '";' . "\n";
+ $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n";
+ $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n";
+ $sitecss .= '@import "' . self::makeUrl( '-', 'action=raw&gen=css' . $siteargs ) . '";' . "\n";
}
# If we use any dynamic CSS, make a little CDATA block out of it.
# XXX: additional security check/prompt?
$this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText('wpTextbox1') . ' /*]]>*/';
} else {
- $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
+ $this->userjs = self::makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
}
}
wfProfileOut( $fname );
$badMessages = array( 'recentchanges-url', 'randompage-url' );
$badUrls = array();
foreach ( $badMessages as $msg ) {
- $badUrls[] = $this->makeInternalOrExternalUrl( wfMsgForContent( $msg ) );
+ $badUrls[] = self::makeInternalOrExternalUrl( wfMsgForContent( $msg ) );
}
foreach ( $sections as $heading => $section ) {
if ( !$wgUseSiteJs ) return '';
if ( $wgUser->isLoggedIn() ) {
- $url = $this->makeUrl('-','action=raw&smaxage=0&gen=js');
+ $url = self::makeUrl( '-','action=raw&smaxage=0&gen=js' );
} else {
- $url = $this->makeUrl('-','action=raw&gen=js');
+ $url = self::makeUrl( '-','action=raw&gen=js' );
}
return cbt_value( $url, 'loggedin' );
}
global $wgRequest;
$usercss = $this->makeStylesheetCdata( $wgRequest->getText('wpTextbox1') );
} else {
- $usercss = $this->makeStylesheetLink( $this->makeUrl($this->getUserPageText() .
+ $usercss = $this->makeStylesheetLink( self::makeUrl($this->getUserPageText() .
'/'.$this->mStyleName.'.css', 'action=raw&ctype=text/css' ) );
}
$sitecss .= $this->makeStylesheetLink( $wgStylePath . '/' . $this->mStyleName . '/rtl.css' ) . "\n";
}
- $sitecss .= $this->makeStylesheetLink( $this->makeNSUrl('Common.css', $query, NS_MEDIAWIKI) ) . "\n";
- $sitecss .= $this->makeStylesheetLink( $this->makeNSUrl(
- ucfirst($this->mStyleName) . '.css', $query, NS_MEDIAWIKI) ) . "\n";
+ $sitecss .= $this->makeStylesheetLink( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) ) . "\n";
+ $sitecss .= $this->makeStylesheetLink( self::makeNSUrl( ucfirst( $this->mStyleName ) . '.css', $query, NS_MEDIAWIKI ) ) . "\n";
// No deps
return $sitecss;
$isTemplate = false;
}
- $link = $this->makeStylesheetLink( $this->makeUrl('-','action=raw&gen=css' . $siteargs) ) . "\n";
+ $link = $this->makeStylesheetLink( self::makeUrl('-','action=raw&gen=css' . $siteargs) ) . "\n";
if ( $wgAllowUserCss ) {
$deps = 'loggedin';
if ( $this->isJsPreview() ) {
$url = '';
} else {
- $url = $this->makeUrl($this->getUserPageText().'/'.$this->mStyleName.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
+ $url = self::makeUrl($this->getUserPageText().'/'.$this->mStyleName.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
}
return cbt_value( $url, array( 'nonview dynamic', 'user' ) );
}
}
function logopath() { return $GLOBALS['wgLogo']; }
- function mainpage() { return $this->makeI18nUrl( 'mainpage' ); }
+ function mainpage() { return self::makeI18nUrl( 'mainpage' ); }
function sidebar( $startSection, $endSection, $innerTpl ) {
$s = '';
$text = $line[1];
if (wfEmptyMsg($line[0], $link))
$link = $line[0];
- $href = $this->makeInternalOrExternalUrl( $link );
+ $href = self::makeInternalOrExternalUrl( $link );
$s .= strtr( $innerTpl,
array(
} elseif ( $wgUploadNavigationUrl ) {
return $wgUploadNavigationUrl;
} else {
- return $this->makeSpecialUrl('Upload');
+ return self::makeSpecialUrl('Upload');
}
}
function nav_specialpages() {
- return $this->makeSpecialUrl('Specialpages');
+ return self::makeSpecialUrl('Specialpages');
}
function nav_print() {
/** Make a link to a special page using a template */
function makeSpecialTemplateLink( $template, $key, $specialName, $text, $query = '' ) {
- $url = $this->makeSpecialUrl( $specialName, $query );
+ $url = self::makeSpecialUrl( $specialName, $query );
// Ignore the query when comparing
$active = ($this->mTitle->getNamespace() == NS_SPECIAL && $this->mTitle->getDBkey() == $specialName);
return strtr( $template,