Initial commit of website to git. Has the "old" ob3 website as the main site, and...
[dana/openbox-web.git] / mediawiki / skins / OpenboxWiki.php
1 <?php
2 /**
3  * openbox foo
4  *
5  * Translated from gwicke's previous TAL template version to remove
6  * dependency on PHPTAL.
7  *
8  * @todo document
9  * @addtogroup Skins
10  */
11
12 if( !defined( 'MEDIAWIKI' ) )
13         die( -1 );
14
15 /** */
16 require_once('includes/SkinTemplate.php');
17
18 $nav_urlss['news'] = 'Openbox:News';
19
20 /**
21  * Inherit main code from SkinTemplate, set the CSS and template filter.
22  * @todo document
23  * @addtogroup Skins
24  */
25 class SkinOpenboxWiki extends SkinTemplate {
26         /** Using monobook. */
27         function initPage( &$out ) {
28                 SkinTemplate::initPage( $out );
29                 $this->skinname  = 'openboxwiki';
30                 $this->stylename = 'openboxwiki';
31                 $this->template  = 'OpenboxWikiTemplate';
32         }
33 }
34
35 /**
36  * @todo document
37  * @addtogroup Skins
38  */
39 class OpenboxWikiTemplate extends QuickTemplate {
40         /**
41          * Template filter callback for MonoBook skin.
42          * Takes an associative array of data set from a SkinTemplate-based
43          * class, and a wrapper for MediaWiki's localization database, and
44          * outputs a formatted page.
45          *
46          * @access private
47          */
48         function execute() {
49                 global $wgUser;
50                 $skin = $wgUser->getSkin();
51
52                 // Suppress warnings to prevent notices about missing indexes in $this->data
53                 wfSuppressWarnings();
54
55 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
56 <html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php 
57         foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
58                 ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
59         } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
60         <head>
61                 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
62                 <?php $this->html('headlinks') ?>
63                 <title><?php $this->text('pagetitle') ?></title>
64                 <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?<?php echo $GLOBALS['wgStyleVersion'] ?>"; /*]]>*/</style>
65                 <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
66                 <!--link rel="stylesheet" type="text/css" media="handheld" href="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/handheld.css?<?php echo $GLOBALS['wgStyleVersion'] ?>" /-->
67                 <!--[-if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
68                 <!--[-if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
69                 <!--[-if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
70                 <!--[-if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
71                 <!--[-if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
72                 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
73                 
74                 <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
75                 
76                 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
77 <?php   if($this->data['jsvarurl'  ]) { ?>
78                 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl'  ) ?>"><!-- site js --></script>
79 <?php   } ?>
80 <?php   if($this->data['pagecss'   ]) { ?>
81                 <style type="text/css"><?php $this->html('pagecss'   ) ?></style>
82 <?php   }
83                 if($this->data['usercss'   ]) { ?>
84                 <style type="text/css"><?php $this->html('usercss'   ) ?></style>
85 <?php   }
86                 if($this->data['userjs'    ]) { ?>
87                 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
88 <?php   }
89                 if($this->data['userjsprev']) { ?>
90                 <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
91 <?php   }
92                 if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
93                 <!-- Head Scripts -->
94 <?php $this->html('headscripts') ?>
95         </head>
96 <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
97 <?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>
98  class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?>">
99         <div id="globalWrapper">
100                 <div id="column-content">
101         <div id="content">
102                 <a name="top" id="top"></a>
103                 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
104                 <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1>
105                 <div id="bodyContent">
106                         <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
107                         <div id="contentSub"><?php $this->html('subtitle') ?></div>
108                         <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php     $this->html('undelete') ?></div><?php } ?>
109                         <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk')  ?></div><?php } ?>
110                         <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
111                         <!-- start content -->
112                         <?php $this->html('bodytext') ?>
113                         <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php       $this->html('catlinks') ?></div><?php } ?>
114                         <!-- end content -->
115                         <div class="visualClear"></div>
116                 </div>
117         </div>
118                 </div>
119                 <div id="column-one">
120         <div id="p-cactions" class="portlet">
121                 <h5><?php $this->msg('views') ?></h5>
122                 <div class="pBody">
123                         <ul>
124         <?php                   foreach($this->data['content_actions'] as $key => $tab) { ?>
125                                  <li id="ca-<?php echo Sanitizer::escapeId($key) ?>"<?php
126                                                 if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
127                                          ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"<?php echo $skin->tooltipAndAccesskey('ca-'.$key) ?>><?php
128                                          echo htmlspecialchars($tab['text']) ?></a></li>
129         <?php                    } ?>
130                         </ul>
131                 </div>
132         </div>
133         <div class="portlet" id="p-personal">
134                 <h5><?php $this->msg('personaltools') ?></h5>
135                 <div class="pBody">
136                         <ul>
137 <?php                   foreach($this->data['personal_urls'] as $key => $item) { ?>
138                                 <li id="pt-<?php echo Sanitizer::escapeId($key) ?>"<?php
139                                         if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
140                                 echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?><?php
141                                 if(!empty($item['class'])) { ?> class="<?php
142                                 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
143                                 echo htmlspecialchars($item['text']) ?></a></li>
144 <?php                   } ?>
145                         </ul>
146                 </div>
147         </div>
148         <div class="portlet" id="p-logo">
149                 <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
150                         ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
151                         echo $skin->tooltipAndAccesskey('n-mainpage') ?>></a>
152         </div>
153         <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
154         <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
155         <div class='portlet' id='p-<?php echo Sanitizer::escapeId($bar) ?>'<?php echo $skin->tooltip('p-'.$bar) ?>>
156                 <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
157                 <div class='pBody'>
158                         <ul>
159 <?php                   foreach($cont as $key => $val) { ?>
160                                 <li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
161                                         if ( $val['active'] ) { ?> class="active" <?php }
162                                 ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $skin->tooltipAndAccesskey($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
163 <?php                   } ?>
164                         </ul>
165                 </div>
166         </div>
167         <?php } ?>
168         <div id="p-search" class="portlet">
169                 <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
170                 <div id="searchBody" class="pBody">
171                         <form action="<?php $this->text('searchaction') ?>" id="searchform"><div>
172                                 <input id="searchInput" name="search" type="text"<?php echo $skin->tooltipAndAccesskey('search');
173                                         if( isset( $this->data['search'] ) ) {
174                                                 ?> value="<?php $this->text('search') ?>"<?php } ?> />
175                                 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>" />&nbsp;
176                                 <input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>" />
177                         </div></form>
178                 </div>
179         </div>
180         <div class="portlet" id="p-tb">
181                 <h5><?php $this->msg('toolbox') ?></h5>
182                 <div class="pBody">
183                         <ul>
184 <?php
185                 if($this->data['notspecialpage']) { ?>
186                                 <li id="t-whatlinkshere"><a href="<?php
187                                 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
188                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
189 <?php
190                         if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
191                                 <li id="t-recentchangeslinked"><a href="<?php
192                                 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
193                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked') ?></a></li>
194 <?php           }
195                 }
196                 if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
197                         <li id="t-trackbacklink"><a href="<?php
198                                 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
199                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li>
200 <?php   }
201                 if($this->data['feeds']) { ?>
202                         <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
203                                         ?><span id="feed-<?php echo Sanitizer::escapeId($key) ?>"><a href="<?php
204                                         echo htmlspecialchars($feed['href']) ?>"<?php echo $skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span>
205                                         <?php } ?></li><?php
206                 }
207
208                 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
209
210                         if($this->data['nav_urls'][$special]) {
211                                 ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
212                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) ?></a></li>
213 <?php           }
214                 }
215
216                 if(!empty($this->data['nav_urls']['print']['href'])) { ?>
217                                 <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
218                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
219                 }
220
221                 if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
222                                 <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
223                                 ?>"<?php echo $skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php
224                 } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
225                                 <li id="t-ispermalink"<?php echo $skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php
226                 }
227
228                 wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
229 ?>
230                         </ul>
231                 </div>
232         </div>
233
234         <div id="p-advertisement" class="portlet">
235                 <h5>books for children</h5>
236                 <div class="pBody">
237                         <!-- Phoophie ad! -->
238                         <!--
239                         <div><a target="_BLANK" href="http://www.phoophie.com"><img src="/openbox/webgfx/bannerbyeve3.gif" /></a></div>
240                         -->
241
242                         <!-- Books for Africa widget -->
243                         <div><small>Help us support the 
244                           Fray Luis Primary School through
245                           <a target="_blank" href="http://www.booksforafrica.org/donate/projects.php?p=11">Books for Africa</a>
246                         </small></div>
247 <a href="http://www.firstgiving.com/chatoyance" alt="Firstgiving- SPONSOR ME" target="_blank"><img src="http://www.firstgiving.com/design/1/images/badges/firstgiving_badge5.gif" border="0" width="150" height="85"></a>
248                         <!-- no flash please...
249                         <object type="application/x-shockwave-flash"
250                                 allowScriptAccess="always" 
251                                 allowNetworking="all"
252                                 height="230" width="150" align="middle"
253                                 data="http://www.firstgiving.com/widgets/fgwidget.swf"
254                                 flashvars="EggId=380566">
255                           <param name="allowScriptAccess" value="always" />
256                           <param name="allowNetworking" value="all" />
257                           <param name="movie"
258                                  value="http://www.firstgiving.com/widgets/fgwidget.swf" />
259                           <param name="quality" value="high" />
260                           <param name="wmode" value="transparent" />
261                           <param name="flashvars" value="EggId=380566" />
262                           <param name="bgcolor" value="#ffffff" />
263                         </object-->
264                 </div>
265         </div>
266
267 <?php
268                 if( $this->data['language_urls'] ) { ?>
269         <div id="p-lang" class="portlet">
270                 <h5><?php $this->msg('otherlanguages') ?></h5>
271                 <div class="pBody">
272                         <ul>
273 <?php           foreach($this->data['language_urls'] as $langlink) { ?>
274                                 <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
275                                 ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
276 <?php           } ?>
277                         </ul>
278                 </div>
279         </div>
280 <?php   } ?>
281                 </div><!-- end of the left (by default at least) column -->
282                         <div class="visualClear"></div>
283                         <div id="footer">
284 <?php
285                 if($this->data['poweredbyico']) { ?>
286                                 <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
287 <?php   }
288                 if($this->data['copyrightico']) { ?>
289                                 <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
290 <?php   }
291
292                 // Generate additional footer links
293 ?>
294                         <ul id="f-list">
295 <?php
296                 $footerlinks = array(
297                         'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
298                         'privacy', 'about', 'disclaimer', 'tagline',
299                 );
300                 foreach( $footerlinks as $aLink ) {
301                         if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
302 ?>                              <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
303 <?php           }
304                 }
305 ?>
306                         </ul>
307                 </div>
308                 
309         <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
310 </div>
311 <?php $this->html('reporttime') ?>
312 <?php if ( $this->data['debug'] ): ?>
313 <!-- Debug output:
314 <?php $this->text( 'debug' ); ?>
315
316 -->
317 <?php endif; ?>
318 </body></html>
319 <?php
320         wfRestoreWarnings();
321         } // end of execute() method
322 } // end of class
323 ?>