3 * Tentative to make a skin for wikimedia.org
9 if( !defined( 'MEDIAWIKI' ) )
14 require_once('includes/SkinPHPTal.php');
15 if( class_exists( 'SkinPHPTal' ) ) {
17 $wgExtraSkins['wikimediawiki'] = 'Wikimediawiki';
19 require_once('MonoBook.php');
26 class SkinWikimediawiki
extends SkinMonoBook
{
27 function initPage( &$out ) {
28 SkinPHPTal
::initPage( $out );
29 $this->skinname
= 'wikimediawiki';
30 $this->stylename
= 'monobook';
31 $this->template
= 'WikimediaWiki';
34 # build array of common navigation links
35 function buildNavUrls () {
36 global $wgTitle, $wgUser, $wgRequest;
37 global $wgSiteSupportPage;
39 $action = $wgRequest->getText( 'action' );
40 $oldid = $wgRequest->getVal( 'oldid' );
41 $diff = $wgRequest->getVal( 'diff' );
42 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
44 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
45 $nav_urls['randompage'] = (wfMsgForContent('randompage') != '-') ?
array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))) : false;
46 $nav_urls['recentchanges'] = (wfMsgForContent('recentchanges') != '-') ?
array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))) : false;
47 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
48 $nav_urls['currentevents'] = (wfMsgForContent('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
49 $nav_urls['portal'] = (wfMsgForContent('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
50 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
51 $nav_urls['bugreports'] = (wfMsgForContent('bugreports') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))) : false;
52 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
53 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
54 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
55 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
58 # Specific for mediawiki.org menu
59 $nav_urls['aboutmediawiki'] = (wfMsgForContent('aboutmediawiki') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('aboutmediawiki-url'))) : false;
60 $nav_urls['projects'] = (wfMsgForContent('projects') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('projects-url'))) : false;
61 $nav_urls['membership'] = (wfMsgForContent('membership') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('membership-url'))) : false;
62 $nav_urls['pressroom'] = (wfMsgForContent('pressroom') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('pressroom-url'))) : false;
63 $nav_urls['software'] = (wfMsgForContent('software') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('software-url'))) : false;
64 $nav_urls['localchapters'] = (wfMsgForContent('localchapters') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('localchapters-url'))) : false;
65 $nav_urls['contactus'] = (wfMsgForContent('contactus') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('contactus-url'))) : false;
67 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
68 $id = User
::idFromName($wgTitle->getText());
69 $ip = User
::isIP($wgTitle->getText());
75 if ( 0 != $wgUser->getID() ) { # show only to signed in users
77 # can only email non-anons
78 $nav_urls['emailuser'] = array(
79 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
81 # only non-anons have contrib list
82 $nav_urls['contributions'] = array(
83 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )