Object : Correct Bug 691: white border around floating image
[lhc/web/wiklou.git] / skins / WikimediaWiki.php
1 <?php
2 /**
3 * Tentative to make a skin for wikimedia.org
4 *
5 * @version $Id$
6 * @package MediaWiki
7 * @subpackage Skins
8 */
9
10 /** */
11
12 if($wgUsePHPTal) {
13 require_once('includes/SkinPHPTal.php');
14
15 $wgExtraSkins['wikimediawiki'] = 'Wikimediawiki';
16
17 require_once('MonoBook.php');
18
19 /**
20 *
21 * @package MediaWiki
22 * @subpackage Skins
23 */
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';
30 }
31
32 # build array of common navigation links
33 function buildNavUrls () {
34 global $wgTitle, $wgUser, $wgRequest;
35 global $wgSiteSupportPage;
36
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
41 $nav_urls = array();
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')));
54
55
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;
64
65 if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) {
66 $id = User::idFromName($wgTitle->getText());
67 $ip = User::isIP($wgTitle->getText());
68 } else {
69 $id = 0;
70 $ip = false;
71 }
72
73 if ( 0 != $wgUser->getID() ) { # show only to signed in users
74 if($id) {
75 # can only email non-anons
76 $nav_urls['emailuser'] = array(
77 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
78 );
79 # only non-anons have contrib list
80 $nav_urls['contributions'] = array(
81 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
82 );
83 }
84 }
85
86
87 return $nav_urls;
88 }
89 }
90
91 }
92 ?>