don't know, why i have a buch of uncommited files
[opensuse:webdesign.git] / design_concept / theme_o.o-bento-mediawiki / bento.php
1 <?php
2 /**
3  * OpenSUSE bento skin
4 */
5
6 if( !defined( 'MEDIAWIKI' ) ) die();
7
8 class SkinBento extends SkinTemplate {
9     function initPage( OutputPage $out ) {
10         parent::initPage( $out );
11         $this->skinname  = 'bento';
12         $this->stylename = 'bento';
13         $this->template  = 'BentoTemplate';
14
15     }
16   function setupSkinUserCss( OutputPage $out ) {
17     parent::setupSkinUserCss( $out );
18     // Append to the default screen common & print styles...
19     $out->addStyle( 'bento/css/style.css', 'screen' );
20   }
21 }
22
23 class BentoTemplate extends QuickTemplate {
24 var $skin;
25   function execute() {
26     global $wgRequest;
27     $this->skin = $skin = $this->data['skin'];
28     $action = $wgRequest->getText( 'action' );
29
30     // Suppress warnings to prevent notices about missing indexes in $this->data
31     wfSuppressWarnings();
32 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33 <html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php foreach($this->data['xhtmlnamespaces'] as $tag => $ns) { ?>xmlns:<?php echo "{$tag}=\"{$ns}\" "; } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
34  <head>
35   <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
36   <?php $this->html('headlinks') ?>
37   <title><?php $this->text('pagetitle') ?></title>
38   <?php $this->html('csslinks') ?>
39   <!--[if lt IE 7]>
40   <meta http-equiv="imagetoolbar" content="no" />
41   <![endif]-->
42   <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
43   <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
44   <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/bento/js/jquery-1.3.2.min.js"></script>
45   <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/bento/js/script.js"></script>
46   <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/bento/js_local/script.js"></script>
47
48   <!-- Head Scripts -->
49   <?php $this->html('headscripts') ?>
50   <?php if($this->data['jsvarurl']) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script><?php }?>
51   <?php if($this->data['pagecss']) { ?> <style type="text/css"><?php $this->html('pagecss') ?></style><?php }?>
52   <?php if($this->data['usercss']) { ?><style type="text/css"><?php $this->html('usercss') ?></style><?php }?>
53   <?php if($this->data['userjs']) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script><?php }?>
54   <?php if($this->data['userjsprev']) { ?><script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script><?php }?>
55   <?php if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
56  </head>
57
58 <body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
59 <?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
60  class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
61
62
63
64   <!-- Start: Header -->
65 <?php
66   $handle = fopen(dirname( __FILE__ ) . "/bento/theme_o.o-bento/header.html","rb");
67   $content = stream_get_contents($handle);
68   fclose($handle);
69   $lastsearch = "Search";
70   if( isset( $this->data['search'] ) && ( $this->data['search'] != "" ) ) {
71     $lastsearch = $this->data['search'];
72   }
73   $search_form = '<input type="text" name="search" id="search" ' .
74                   $this->skin->tooltipAndAccesskey('search') .
75                   ' value="' . $lastsearch . '" ' .
76                   "onFocus='this.value = \"\"'" . '/>';
77   $search_button = '<input type="submit" name="go" class="hidden" ' .
78                    ' value="Search" ' .
79                    $this->skin->tooltipAndAccesskey( 'search-go' ) .
80                    '/>';
81   $content = str_replace( array(
82              '<input type="text" name="q" value="search" id="search" />' ,
83              '<input type="submit" value="Search" class="hidden" accesskey="" />'
84              ), array ( $search_form, $search_button ), $content );
85   echo $content;
86 ?>
87   <!-- End: Header -->
88
89   <div id="subheader" class="container_16">
90     <div id="breadcrump" class="grid_12 alpha">
91       <a href="http://www.opensuse.org" title="Home"><img src="<?php $this->text('stylepath' ) ?>/bento/images/home_grey.png" width="16" height="16" alt="Home" /> Home</a> &gt; <a href="/" title="">Support</a> &gt; <a href="/" title="">Wiki</a> &gt; <a href="" title=""><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></a>
92     </div>
93
94    
95     <?php if( $this->data['username'] == NULL ) { ?>
96      <div id="login-wrapper" class="grid_4 omega">
97      <a href="<?php echo $this->data['personal_urls'][login][href] ?>">Sign up</a> | <a id="login-trigger" href="#login">Login</a>
98
99       <div id="login-form">
100         <form action="http://<?php echo $_SERVER['SERVER_NAME'] ?>/ICSLogin/auth-up" method="post" enctype="application/x-www-form-urlencoded" id="login_form">
101           <input name="url" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" type="hidden">
102           <input name="context" value="default" type="hidden">
103           <input name="proxypath" value="reverse" type="hidden">
104           <input name="message" value="Please log In" type="hidden">
105           <p><label class="inlined" for="username">Username</label><input type="text" class="inline-text" name="username" value="" id="username" /></p>
106           <p><label class="inlined" for="password">Password</label><input type="password" class="inline-text" name="password" value="" id="password" /></p>
107
108           <p><input type="submit" value="Login" /></p>
109           <p class="slim-footer"><a id="close-login" href="#cancel">Cancel</a></p>
110         </form>
111       </div>
112     </div>
113    <?php } else { ?>
114
115     <div id="local-user-actions" class="grid_4 omega">
116       <ul id="pt-personal">
117         <!-- Begin Personal links (Login, etc.) xx-->
118         <?php foreach($this->data['personal_urls'] as $key => $item) { ?>
119                                 <li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php
120                                         if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
121                                 echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskey('pt-'.$key) ?><?php
122                                 if(!empty($item['class'])) { ?> class="<?php
123                                 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
124                                 echo htmlspecialchars($item['text']) ?></a></li>
125         <?php } ?>
126         <!-- End Personal links (Login, etc.) -->
127       </ul>
128     </div>
129   <?php } ?>
130
131   </div>
132
133   <!-- Start: Main Content Area -->
134   <div id="content" class="container_16 ui-oo-content-wrapper">
135
136     <div class="column grid_4 alpha">
137
138       <div id="some_other_content" class=" ui-oo-box-shadow alpha clear-both navigation">
139         <h2 class="box-header">Navigation</h2>
140           <ul class="navigation">
141             <li><a href"/Project_Overview">Project Overview</a></li>
142             <li><a href"/How_to_Participate">How to Participate</a></li>
143             <li><a href"/Documentation">Documentation</a></li>
144             <li><a href"/Support">Support</a></li>
145             <li><a href"http://forums.opensuse.org">Support Forums</a></li>
146             <li><a href"/Contact">Contact</a></li>
147             <li><a href"/openSUSE:Browse">Sitemap</a></li>
148           </ul>
149       </div>
150
151
152      <div id="some_other_content" class=" ui-oo-box-shadow alpha clear-both navigation">
153         <h2 class="box-header"><?php $this->msg('toolbox') ?></h2>
154         <ul class="navigation">
155         <?php if($this->data['notspecialpage']) { ?><li id="t-whatlinkshere"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
156         <?php if( $this->data['nav_urls']['recentchangeslinked'] ) { ?><li id="t-recentchangeslinked"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href']) ?>"<?php echo $this->skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked') ?></a></li>
157         <?php } } ?>
158
159         <?php if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
160           <li id="t-trackbacklink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href']) ?>"><?php echo $this->msg('trackbacklink') ?></a></li>
161         <?php } ?>
162         <?php if($this->data['feeds']) { ?>
163           <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) { ?><span id="feed-<?php echo htmlspecialchars($key) ?>"><a href="<?php echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span><?php } ?></li>
164         <?php } ?>
165         <?php foreach( array('contributions', 'emailuser', 'upload', 'specialpages') as $special ) { ?><?php if($this->data['nav_urls'][$special]) { ?>
166           <li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href']) ?>"><?php $this->msg($special) ?></a></li>
167         <?php } ?><?php } ?>
168          </ul>
169       </div>
170
171
172        <div id="some_other_content" class=" ui-oo-box-shadow alpha clear-both navigation">
173         <h2 class="box-header">Sponsors</h2>
174
175       </div>
176
177
178     </div>
179
180     <div id="some-content" class="ui-oo-box-shadow grid_12 clearfix">
181       <!-- box header -->
182       <div class="box-header grid_12">
183        <ul>
184        <?php $check=false;
185                         foreach($this->data['content_actions'] as $key => $tab) {
186
187                                         echo '<li>';
188                                         echo'<a href="'.htmlspecialchars($tab['href']).'"';
189                                         if( $tab['class'] ) {
190                                                 echo ' class="'.htmlspecialchars($tab['class']).'"';
191                                         }
192                                         # We don't want to give the watch tab an accesskey if the
193                                         # page is being edited, because that conflicts with the
194                                         # accesskey on the watch checkbox.  We also don't want to
195                                         # give the edit tab an accesskey, because that's fairly su-
196                                         # perfluous and conflicts with an accesskey (Ctrl-E) often
197                                         # used for editing in Safari.
198                                         if( in_array( $action, array( 'edit', 'submit' ) )
199                                         && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
200                                                 echo $skin->tooltip( "ca-$key" );
201                                         } else {
202                                                 echo $skin->tooltipAndAccesskey( "ca-$key" );
203                                         }
204                                         echo '>'.htmlspecialchars($tab['text']).'</a></li>';
205                                 } ?>
206         </ul>
207       </div>
208       <!-- End: box header -->
209
210
211     <!-- Begin language select -->
212     <?php if( $this->data['language_urls'] ) { ?>
213     <form action="" name="langsel">
214      <select name="lang" onchange="langRedirect()">
215       <option value=""><?php $this->msg('otherlanguages') ?></option>
216     <?php foreach($this->data['language_urls'] as $langlink) { ?>
217       <option value="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></option>
218     <?php } ?>
219      </select>
220     </form>
221     <?php } ?>
222     <!-- End langauge select -->
223
224     <a name="top" id="top"></a>
225     <?php if($this->data['sitenotice']) { ?>
226           <div id="siteNotice"><?php $this->html('sitenotice') ?></div>
227     <?php } ?>
228
229
230     <div class="grid_12 alpha omega">
231         <h3><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h3>
232
233         <h3 id="siteSub">tagline: <?php $this->msg('tagline') ?></h3>
234         <div id="contentSub"><?php $this->html('subtitle') ?></div>
235         <?php if($this->data['undelete']) { ?>
236           <div id="contentSub2">undelete: <?php $this->html('undelete') ?></div>
237         <?php } ?>
238         <?php if($this->data['newtalk'] ) { ?>
239           <div class="usermessage">usermessage: <?php $this->html('newtalk')  ?></div>
240         <?php } ?>
241
242     <!-- Begin Content Area -->
243         <?php $this->html('bodytext') ?>
244
245         <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
246         <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?>
247     <!-- End Content Area -->
248
249     </div>
250
251       <div class="box-footer grid_12">
252        <ul>
253        <?php $check=false;
254                         foreach($this->data['content_actions'] as $key => $tab) {
255
256                                         echo '<li>';
257                                         echo'<a href="'.htmlspecialchars($tab['href']).'"';
258                                         if( $tab['class'] ) {
259                                                 echo ' class="'.htmlspecialchars($tab['class']).'"';
260                                         }
261                                         # We don't want to give the watch tab an accesskey if the
262                                         # page is being edited, because that conflicts with the
263                                         # accesskey on the watch checkbox.  We also don't want to
264                                         # give the edit tab an accesskey, because that's fairly su-
265                                         # perfluous and conflicts with an accesskey (Ctrl-E) often
266                                         # used for editing in Safari.
267                                         if( in_array( $action, array( 'edit', 'submit' ) )
268                                         && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
269                                                 echo $skin->tooltip( "ca-$key" );
270                                         } else {
271                                                 echo $skin->tooltipAndAccesskey( "ca-$key" );
272                                         }
273                                         echo '>'.htmlspecialchars($tab['text']).'</a></li>';
274                                 } ?>
275         </ul>
276       </div>
277
278     </div></div>
279
280     <!-- Note: this clears floating, set in previous elements -->
281     <div class="clear"></div>
282
283
284   <!-- Start: Footer -->
285 <?php
286   $handle = fopen(dirname( __FILE__ ) . "/bento/theme_o.o-bento/footer.html","rb");
287   $content = stream_get_contents($handle);
288   fclose($handle);
289   if(isset($this->data['lastmod'])) {
290     $content = split('<p>',$content,2);
291     echo $content[0];
292     echo '<p>';
293     $this->html('viewcount');
294     echo '</p><p>';
295     echo $content[1];
296   } else {
297     echo $content;
298   }
299 ?>
300   <!-- End: Footer -->
301
302
303
304   <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
305   <?php $this->html('reporttime') ?>
306
307   <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-3367212-3"); pageTracker._trackPageview(); } catch(err) {}</script>
308
309  </body>
310 </html>
311 <?php
312     wfRestoreWarnings();
313   }
314 }
315 ?>