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