2 # Tentative to make a skin for wikimedia.org
6 require_once('includes/SkinPHPTal.php');
8 $wgExtraSkins['wikimediawiki'] = 'Wikimediawiki';
10 require_once('MonoBook.php');
12 class SkinWikimediawiki
extends SkinMonoBook
{
13 function initPage( &$out ) {
14 SkinPHPTal
::initPage( $out );
15 $this->skinname
= 'wikimediawiki';
16 $this->template
= 'WikimediaWiki';
19 # build array of common navigation links
20 function buildNavUrls () {
21 global $wgTitle, $wgUser, $wgRequest;
22 global $wgSiteSupportPage;
24 $action = $wgRequest->getText( 'action' );
25 $oldid = $wgRequest->getVal( 'oldid' );
26 $diff = $wgRequest->getVal( 'diff' );
27 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
29 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
30 $nav_urls['randompage'] = (wfMsg('randompage') != '-') ?
array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))) : false;
31 $nav_urls['recentchanges'] = (wfMsg('recentchanges') != '-') ?
array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))) : false;
32 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
33 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
34 $nav_urls['portal'] = (wfMsg('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
35 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
36 $nav_urls['bugreports'] = (wfMsg('bugreports') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))) : false;
37 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
38 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
39 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
40 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
43 # Specific for mediawiki.org menu
44 $nav_urls['aboutmediawiki'] = (wfMsg('aboutmediawiki') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('aboutmediawiki-url'))) : false;
45 $nav_urls['projects'] = (wfMsg('projects') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('projects-url'))) : false;
46 $nav_urls['membership'] = (wfMsg('membership') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('membership-url'))) : false;
47 $nav_urls['pressroom'] = (wfMsg('pressroom') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('pressroom-url'))) : false;
48 $nav_urls['software'] = (wfMsg('software') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('software-url'))) : false;
49 $nav_urls['localchapters'] = (wfMsg('localchapters') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('localchapters-url'))) : false;
50 $nav_urls['contactus'] = (wfMsg('contactus') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('contactus-url'))) : false;
52 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
53 $id = User
::idFromName($wgTitle->getText());
54 $ip = User
::isIP($wgTitle->getText());
60 if ( 0 != $wgUser->getID() ) { # show only to signed in users
62 # can only email non-anons
63 $nav_urls['emailuser'] = array(
64 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
66 # only non-anons have contrib list
67 $nav_urls['contributions'] = array(
68 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )