5 * Translated from gwicke's previous TAL template version to remove
6 * dependency on PHPTAL.
13 if( !defined( 'MEDIAWIKI' ) )
17 require_once('includes/SkinTemplate.php');
20 * Inherit main code from SkinTemplate, set the CSS and template filter.
25 class SkinGForge extends SkinTemplate {
27 function initPage( &$out ) {
28 SkinTemplate::initPage( $out );
29 $this->skinname = 'gforge';
30 $this->stylename = 'gforge';
31 $this->template = 'GForgeTemplate';
40 class GForgeTemplate extends QuickTemplate {
42 * Template filter callback for GForge skin.
43 * Takes an associative array of data set from a SkinTemplate-based
44 * class, and a wrapper for MediaWiki's localization database, and
45 * outputs a formatted page.
50 // Suppress warnings to prevent notices about missing indexes in $this->data
52 $project=group_get_object_by_name(strtolower($this->data['skin']->mTitle->mTextform));
54 $params['group']=$project->getID();
55 $params['toptab']='mediawiki';
57 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
58 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
60 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
61 <?php $this->html('headlinks') ?>
62 <title><?php $this->text('pagetitle') ?></title>
63 <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?9"; /*]]>*/</style>
64 <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
65 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
66 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
67 <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
68 <!--[if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?1";</style><![endif]-->
69 <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
70 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
71 <script type="<?php $this->text('jsmimetype') ?>">var skin = '<?php $this->text('skinname')?>';var stylepath = '<?php $this->text('stylepath')?>';</script>
72 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?1"><!-- wikibits js --></script>
73 <?php if($this->data['jsvarurl' ]) { ?>
74 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
76 <?php if($this->data['pagecss' ]) { ?>
77 <style type="text/css"><?php $this->html('pagecss' ) ?></style>
79 if($this->data['usercss' ]) { ?>
80 <style type="text/css"><?php $this->html('usercss' ) ?></style>
82 if($this->data['userjs' ]) { ?>
83 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
85 if($this->data['userjsprev']) { ?>
86 <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
88 if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
90 <?php $this->html('headscripts') ?>
92 <!-- GFORGE Stylesheet BEGIN -->
93 <?php $GLOBALS['HTML']->headerCSS(); ?>
94 <!-- GFORGE Stylesheet END -->
97 <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
98 <?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?>
99 class="<?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">
101 <!-- GFORGE BodyHeader BEGIN -->
102 <?php $GLOBALS['HTML']->bodyHeader($params); ?>
103 <!-- GFORGE BodyHeader END -->
105 <div id="globalWrapper">
106 <div id="column-content">
108 <a name="top" id="top"></a>
109 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
110 <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
111 <div id="bodyContent">
112 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
113 <div id="contentSub"><?php $this->html('subtitle') ?></div>
114 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
115 <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
116 <?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 } ?>
117 <!-- start content -->
118 <?php $this->html('bodytext') ?>
119 <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
121 <div class="visualClear"></div>
125 <div id="column-one">
126 <div class="portlet" id="p-personal">
127 <h5><?php $this->msg('personaltools') ?></h5>
130 <?php // XXXXXX CB don't display login as it's done by GForge
131 $this->data['personal_urls']['login']=array();
132 $this->data['personal_urls']['logout']=array();
133 foreach($this->data['personal_urls'] as $key => $item) { ?>
134 <li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
135 if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
136 echo htmlspecialchars($item['href']) ?>"<?php
137 if(!empty($item['class'])) { ?> class="<?php
138 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
139 echo htmlspecialchars($item['text']) ?></a></li>
144 <div id="p-cactions" class="portlet">
145 <h5><?php $this->msg('views') ?></h5>
147 <?php foreach($this->data['content_actions'] as $key => $tab) { ?>
148 <li id="ca-<?php echo htmlspecialchars($key) ?>"<?php
149 if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
150 ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"><?php
151 echo htmlspecialchars($tab['text']) ?></a></li>
155 <div class="portlet" id="p-logo">
156 <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
157 ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
158 ?>title="<?php $this->msg('mainpage') ?>"></a>
160 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
161 <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
162 <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
163 <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
166 <?php foreach($cont as $key => $val) { ?>
167 <li id="<?php echo htmlspecialchars($val['id']) ?>"<?php
168 if ( $val['active'] ) { ?> class="active" <?php }
169 ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text']) ?></a></li>
175 <div id="p-search" class="portlet">
176 <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
177 <div id="searchBody" class="pBody">
178 <form action="<?php $this->text('searchaction') ?>" id="searchform">
180 <input id="searchInput" name="search" type="text" <?php
181 if($this->haveMsg('accesskey-search')) {
182 ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
183 if( isset( $this->data['search'] ) ) {
184 ?> value="<?php $this->text('search') ?>"<?php } ?> />
185 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('go') ?>" />
186 <input type='submit' name="fulltext" class="searchButton" value="<?php $this->msg('search') ?>" />
191 <div class="portlet" id="p-tbx">
192 <h5><?php $this->msg('toolbox') ?></h5>
196 if($this->data['notspecialpage']) { ?>
197 <li id="t-whatlinkshere"><a href="<?php
198 echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
199 ?>"><?php $this->msg('whatlinkshere') ?></a></li>
201 if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
202 <li id="t-recentchangeslinked"><a href="<?php
203 echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
204 ?>"><?php $this->msg('recentchangeslinked') ?></a></li>
207 if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
208 <li id="t-trackbacklink"><a href="<?php
209 echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
210 ?>"><?php $this->msg('trackbacklink') ?></a></li>
212 if($this->data['feeds']) { ?>
213 <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
214 ?><span id="feed-<?php echo htmlspecialchars($key) ?>"><a href="<?php
215 echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a> </span>
219 foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
221 if($this->data['nav_urls'][$special]) {
222 ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
223 ?>"><?php $this->msg($special) ?></a></li>
227 if(!empty($this->data['nav_urls']['print']['href'])) { ?>
228 <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
229 ?>"><?php $this->msg('printableversion') ?></a></li><?php
232 if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
233 <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
234 ?>"><?php $this->msg('permalink') ?></a></li><?php
235 } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
236 <li id="t-ispermalink"><?php $this->msg('permalink') ?></li><?php
239 wfRunHooks( 'GForgeTemplateToolboxEnd', array( &$this ) );
245 if( $this->data['language_urls'] ) { ?>
246 <div id="p-lang" class="portlet">
247 <h5><?php $this->msg('otherlanguages') ?></h5>
250 <?php foreach($this->data['language_urls'] as $langlink) { ?>
251 <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
252 ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
258 </div><!-- end of the left (by default at least) column -->
259 <div class="visualClear"></div>
262 if($this->data['poweredbyico']) { ?>
263 <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
265 if($this->data['copyrightico']) { ?>
266 <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
269 // Generate additional footer links
273 $footerlinks = array(
274 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
275 'privacy', 'about', 'disclaimer', 'tagline',
277 foreach( $footerlinks as $aLink ) {
278 if( $this->data[$aLink] ) {
279 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
285 <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
287 <?php $this->html('reporttime') ?>
289 <?php $GLOBALS['HTML']->footer($params); ?>
292 } // end of execute() method