Extract the edit page interface functions out of Article and into separate
[mediawiki.git] / includes / SkinCologneBlue.php
blob5640d1114e3af43a942a8a90e7fda287952f5287
1 <?
2 # See skin.doc
4 class SkinCologneBlue extends Skin {
6 function initPage()
8 global $wgOut, $wgStyleSheetPath;
10 $wgOut->addLink( "stylesheet", "",
11 "{$wgStyleSheetPath}/cologneblue.css" );
14 function doBeforeContent()
16 global $wgUser, $wgOut, $wgTitle;
18 $s = "";
19 $qb = $this->qbSetting();
21 $s .= "\n<div id='content'>\n<div id='topbar'>" .
22 "<table width='98%' border=0 cellspacing=0 cellpadding=8><tr>";
24 $s .= "<td class='top' align=left valign=middle nowrap>";
25 $s .= "<a href=\"" . wfLocalUrlE( wfMsg( "mainpage" ) ) . "\">";
26 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
28 $s .= "</td><td class='top' align=right valign=bottom width='100%'>";
29 $s .= $this->sysLinks();
30 $s .= "</td></tr><tr><td valign=top>";
32 $s .= "<font size='-1'><span id='sitesub'>";
33 $s .= wfMsg( "sitesubtitle" ) . "</span></font>";
34 $s .= "</td><td align=right>" ;
36 $s .= "<font size='-1'><span id='langlinks'>" ;
37 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
38 $s .= "<br>" . $this->pageTitleLinks();
39 $s .= "</span></font>";
41 $s .= "</td></tr></table>\n";
43 $s .= "\n</div>\n<div id='article'>";
45 $s .= $this->pageTitle();
46 $s .= $this->pageSubtitle() . "\n<p>";
47 return $s;
50 function doAfterContent()
52 global $wgUser, $wgOut;
54 $s = "\n</div><br clear=all>\n";
56 $s .= "\n<div id='footer'>";
57 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
59 $qb = $this->qbSetting();
60 if ( 1 == $qb || 3 == $qb ) { # Left
61 $s .= $this->getQuickbarCompensator();
63 $s .= "<td class='bottom' align=center valign=top>";
65 $s .= $this->bottomLinks();
66 $s .= "\n<br>" . $this->makeKnownLink( wfMsg( "mainpage" ),
67 wfMsg( "mainpage" ) ) . " | "
68 . $this->aboutLink() . " | "
69 . $this->searchForm( wfMsg( "qbfind" ) );
71 $s .= "\n<br>" . $this->pageStats();
73 $s .= "</td>";
74 if ( 2 == $qb ) { # Right
75 $s .= $this->getQuickbarCompensator();
77 $s .= "</tr></table>\n</div>\n</div>\n";
79 if ( 0 != $qb ) { $s .= $this->quickBar(); }
80 return $s;
82 function doGetUserStyles()
84 global $wgUser, $wgOut, $wgStyleSheetPath;
86 $s = parent::doGetUserStyles();
87 $qb = $this->qbSetting();
89 if ( 2 == $qb ) { # Right
90 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
91 "#article { margin-left: 4px; margin-right: 148px; }\n";
92 } else if ( 1 == $qb || 3 == $qb ) {
93 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
94 "#article { margin-left: 148px; margin-right: 4px; }\n";
96 return $s;
98 function sysLinks()
100 global $wgUser;
101 $s = "" .
102 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
103 . " | " .
104 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
105 . " | " .
106 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
107 . " | " .
108 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
109 . " | " .
110 $this->specialLink( "specialpages" ) . " | " .
111 $this->specialLink( $wgUser->getID() ? "userlogout" : "userlogin" ) ;
112 return $s;
115 function quickBar()
117 global $wgOut, $wgTitle, $wgUser, $wgLang;
119 $s = "\n<div id='quickbar'>";
121 $sep = "<br>";
122 $s .= $this->menuHead( "qbfind" );
123 $s .= $this->searchForm();
125 $s .= $this->menuHead( "qbbrowse" )
126 . $this->mainPageLink()
127 . $sep . $this->specialLink( "recentchanges" )
128 . $sep . $this->specialLink( "randompage" )
129 . $sep . $this->specialLink( "newpages" )
130 . $sep . $this->specialLink( "imagelist" )
131 . $sep . $this->specialLink( "statistics" )
132 . $sep . $this->specialLink( "specialpages" )
133 . $sep . $this->bugReportsLink() ;
134 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
135 $s .= "\n";
137 if ( $wgOut->isArticle() ) {
138 $s .= $this->menuHead( "qbedit" );
139 $s .= "<strong>" . $this->editThisPage() . "</strong>"
140 . $sep . $this->makeKnownLink( wfMsg( "edithelppage" ),
141 wfMsg( "edithelp" ) );
143 if ( 0 != $wgUser->getID() ) {
144 $s .= $sep . $this->specialLink( "upload" )
145 . $sep . $this->moveThisPage();
147 if ( $wgUser->isSysop() ) {
148 $s .= $sep . $this->deleteThisPage() .
149 $sep . $this->protectThisPage();
151 $s .= $sep;
153 $s .= $this->menuHead( "qbpageoptions" );
154 $s .= $this->talkLink()
155 . $sep . $this->printableLink();
156 if ( 0 != $wgUser->getID() ) {
157 $s .= $sep . $this->watchThisPage();
159 $s .= $sep;
161 $s .= $this->menuHead( "qbpageinfo" )
162 . $this->historyLink()
163 . $sep . $this->whatLinksHere()
164 . $sep . $this->watchPageLinksLink();
166 if ( Namespace::getUser() == $wgTitle->getNamespace() ) {
167 $s .= $sep . $this->userContribsLink();
168 if ( 0 != $wgUser->getID() ) {
169 $s .= $sep . $this->emailUserLink();
172 $s .= $sep;
174 $s .= $this->menuHead( "qbmyoptions" );
175 if ( 0 != $wgUser->getID() ) {
176 $name = $wgUser->getName();
177 $tl = $this->makeKnownLink( $wgLang->getNsText(
178 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
179 wfMsg( "mytalk" ) );
180 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
182 $s .= $this->makeKnownLink( $wgLang->getNsText(
183 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
184 . $sep . $tl
185 . $sep . $this->specialLink( "watchlist" )
186 . $sep . $this->specialLink( "preferences" )
187 . $sep . $this->specialLink( "userlogout" );
188 } else {
189 $s .= $this->specialLink( "userlogin" );
191 $s .= $sep . "\n</div>\n";
192 return $s;
195 function menuHead( $key )
197 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
198 return $s;
201 function searchForm( $label = "" )
203 global $search;
204 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
205 wfLocalUrlE( "" ) . "\">";
206 if ( "" != $label ) { $s .= "{$label}: "; }
208 $s .= "<input type=text name=\"search\" size=10 value=\""
209 . htmlspecialchars(substr($search,0,256)) . "\">"
210 . "<input type=submit value=\"" . wfMsg( "ok" ) . "\"></form>";
212 return $s;