278 lines
9.7 KiB
PHP
278 lines
9.7 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* DokuWiki Default Template 2012
|
||
|
*
|
||
|
* @link http://dokuwiki.org/template
|
||
|
* @author Anika Henke <anika@selfthinker.org>
|
||
|
* @author Clarence Lee <clarencedglee@gmail.com>
|
||
|
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
|
||
|
*/
|
||
|
|
||
|
if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
|
||
|
|
||
|
$hasSidebar = page_findnearest($conf['sidebar']);
|
||
|
$showSidebar = $hasSidebar && ($ACT=='show');
|
||
|
?><!DOCTYPE html>
|
||
|
<html lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
|
||
|
<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
|
||
|
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
|
||
|
<?php tpl_metaheaders() ?>
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||
|
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
|
||
|
<?php tpl_includeFile('meta.html') ?>
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<!--Barre générale Khaganat-->
|
||
|
<?php include_once("/var/www/nav2/nav.php"); ?>
|
||
|
<!--Fin Barre générale Khaganat-->
|
||
|
|
||
|
<?php
|
||
|
|
||
|
//get needed language array
|
||
|
include "lang/fr/lang.php";
|
||
|
//overwrite French language values with available translations
|
||
|
if (!empty($conf["lang"]) &&
|
||
|
$conf["lang"] !== "fr" &&
|
||
|
file_exists("lang/".$conf["lang"]."/lang.php")){
|
||
|
//get language file (partially translated language files are no problem
|
||
|
//cause non translated stuff is still existing as English array value)
|
||
|
include "lang/".$conf["lang"]."/lang.php";
|
||
|
}
|
||
|
?>
|
||
|
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
|
||
|
<div id="dokuwiki__site"><div id="dokuwiki__top"
|
||
|
class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'showSidebar' : '';
|
||
|
?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
|
||
|
|
||
|
<?php include('tpl_header.php') ?>
|
||
|
|
||
|
<!-- BREADCRUMBS -->
|
||
|
<?php if($conf['breadcrumbs'] || $conf['youarehere']): ?>
|
||
|
<div class="breadcrumbs">
|
||
|
<div id="bread_and_here">
|
||
|
<?php if($conf['youarehere']): ?>
|
||
|
<div class="youarehere"><?php tpl_youarehere() ?></div>
|
||
|
<?php endif ?>
|
||
|
<?php if($conf['breadcrumbs']): ?>
|
||
|
<div class="trace"><?php tpl_breadcrumbs() ?></div>
|
||
|
<?php endif ?>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
<div id="search_lang">
|
||
|
|
||
|
<?php tpl_searchform(); ?>
|
||
|
|
||
|
<?php $translation = &plugin_load('helper','translation');
|
||
|
if ($translation) echo $translation->showTranslations();
|
||
|
?>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php endif ?>
|
||
|
|
||
|
<div class="wrapper group">
|
||
|
|
||
|
<!-- ********** SIDEBAR ********** -->
|
||
|
<?php if($showSidebar): ?>
|
||
|
<script type="text/javascript">
|
||
|
function expand(n)
|
||
|
{
|
||
|
var node = n;
|
||
|
while ( node.nodeName != "UL" )
|
||
|
node = node.nextSibling;
|
||
|
if ( node.style.display == 'block' ) {
|
||
|
node.style.display = 'none';
|
||
|
n.src = '/test/lib/tpl/dokuwikha/images/plus.gif';
|
||
|
} else {
|
||
|
node.style.display = 'block';
|
||
|
n.src = '/test/lib/tpl/dokuwikha/images/minus.gif';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
<!-- ********** ASIDE ********** -->
|
||
|
<div id="dokuwiki__aside"><div class="pad include group">
|
||
|
<h3 class="toggle"><?php echo $lang['sidebar'] ?></h3>
|
||
|
<div class="content">
|
||
|
<?php tpl_flush() ?>
|
||
|
|
||
|
<?php tpl_includeFile('sidebarheader.html') ?>
|
||
|
<?php tpl_include_page($conf['sidebar'], 1, 1) ?>
|
||
|
<?php tpl_includeFile('sidebarfooter.html') ?>
|
||
|
</div>
|
||
|
</div></div><!-- /aside -->
|
||
|
<?php endif; ?>
|
||
|
|
||
|
<!-- ********** ONGLETS ********** -->
|
||
|
<!-- This part of code (onglets) is based on monobook template -->
|
||
|
<?php
|
||
|
//detect revision
|
||
|
$rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core
|
||
|
if ($rev < 1){
|
||
|
$rev = (int)$INFO["lastmod"];
|
||
|
}
|
||
|
|
||
|
|
||
|
//detect revision
|
||
|
$rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core
|
||
|
if ($rev < 1){
|
||
|
$rev = (int)$INFO["lastmod"];
|
||
|
}
|
||
|
|
||
|
//get tab config
|
||
|
include "tabs.php"; //default
|
||
|
|
||
|
function _monobook_renderTabs($arr)
|
||
|
{
|
||
|
//is there something useful?
|
||
|
if (empty($arr) ||
|
||
|
!is_array($arr)){
|
||
|
return false; //nope, break operation
|
||
|
}
|
||
|
|
||
|
//array to store the created tabs into
|
||
|
$elements = array();
|
||
|
|
||
|
//handle the tab data
|
||
|
foreach($arr as $li_id => $element){
|
||
|
//basic check
|
||
|
if (empty($element) ||
|
||
|
!is_array($element) ||
|
||
|
!isset($element["text"])){
|
||
|
continue; //ignore invalid stuff and go on
|
||
|
}
|
||
|
$li_created = true; //flag to control if we created any list element
|
||
|
$interim = "";
|
||
|
//do we have an external link?
|
||
|
if (!empty($element["href"])){
|
||
|
//add URL
|
||
|
$interim = "<a href=\"".hsc($element["href"])."\""; //@TODO: real URL encoding
|
||
|
//add rel="nofollow" attribute to the link?
|
||
|
if (!empty($element["nofollow"])){
|
||
|
$interim .= " rel=\"nofollow\"";
|
||
|
}
|
||
|
//add special css class?
|
||
|
if (!empty($element["class"])){
|
||
|
$interim .= " class=\"".hsc($element["class"])."\"";
|
||
|
} elseif (substr($element["href"], 0, 4) === "http" ||
|
||
|
substr($element["href"], 0, 3) === "ftp"){
|
||
|
$interim .= " class=\"urlextern\"";
|
||
|
}
|
||
|
//add access key?
|
||
|
if (!empty($element["accesskey"])){
|
||
|
$interim .= " accesskey=\"".hsc($element["accesskey"])."\" title=\"[ALT+".hsc(strtoupper($element["accesskey"]))."]\"";
|
||
|
}
|
||
|
$interim .= ">".hsc($element["text"])."</a>";
|
||
|
//internal wiki link
|
||
|
}else if (!empty($element["wiki"])){
|
||
|
//add special css class?
|
||
|
if (!empty($element["class"])){
|
||
|
$interim = "<span class=\"".hsc($element["class"])."\">".html_wikilink($element["wiki"], hsc($element["text"]))."</span>";
|
||
|
}else{
|
||
|
$interim = html_wikilink($element["wiki"], hsc($element["text"]));
|
||
|
}
|
||
|
/* Following works, but I think it is too heavy... //use a wiki page as content
|
||
|
} elseif ($element["wiki_include"]){
|
||
|
|
||
|
//we have to show a wiki page. get the rendered content of the
|
||
|
//defined wiki article to use as content.
|
||
|
$interim = tpl_include_page($element["wiki_include"], false);
|
||
|
if ($interim === "" ||
|
||
|
$interim === false){
|
||
|
//show creation/edit link if the defined page got no content
|
||
|
$interim = "[ ".html_wikilink($element["wiki_include"], hsc($lang["monobook_fillplaceholder"]." (".hsc($element["wiki_include"]).")"))." ]<br />";
|
||
|
}*/
|
||
|
//text only
|
||
|
}else{
|
||
|
$interim = "<span";
|
||
|
//add special css class?
|
||
|
if (!empty($element["class"])){
|
||
|
$interim .= " class=\"".hsc($element["class"])."\"";
|
||
|
}else{
|
||
|
$interim .= " style=\"color:#ccc;\"";
|
||
|
}
|
||
|
$interim .= "> ".hsc($element["text"])." </span>";
|
||
|
}
|
||
|
//store it
|
||
|
$elements[] = " <li id=\"".hsc($li_id)."\">".$interim."</li>\n";
|
||
|
}
|
||
|
|
||
|
//show everything created
|
||
|
if (!empty($elements)){
|
||
|
echo "\n"
|
||
|
." <div id=\"p-cactions\" class=\"portlet\">\n" //don't touch the id, it is needed as css selector
|
||
|
." <ul>\n";
|
||
|
foreach ($elements as $element){
|
||
|
echo $element;
|
||
|
}
|
||
|
echo " </ul>\n"
|
||
|
." </div>\n";
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
|
||
|
<!-- ********** CONTENT ********** -->
|
||
|
<div id="dokuwiki__content"><div class="pad group">
|
||
|
|
||
|
<?php
|
||
|
//show tabs, see monobook/user/tabs.php to configure them
|
||
|
if (!empty($_monobook_tabs) &&
|
||
|
is_array($_monobook_tabs)){
|
||
|
_monobook_renderTabs($_monobook_tabs);
|
||
|
}
|
||
|
?>
|
||
|
|
||
|
<div class="pageId"><span><?php echo hsc($ID) ?></span></div>
|
||
|
|
||
|
<div class="page group">
|
||
|
<?php tpl_flush() ?>
|
||
|
<?php tpl_includeFile('pageheader.html') ?>
|
||
|
<!-- wikipage start -->
|
||
|
<?php tpl_content() ?>
|
||
|
<!-- wikipage stop -->
|
||
|
<?php tpl_includeFile('pagefooter.html') ?>
|
||
|
</div>
|
||
|
|
||
|
<div class="docInfo"><?php tpl_pageinfo() ?></div>
|
||
|
|
||
|
<?php tpl_flush() ?>
|
||
|
</div></div><!-- /content -->
|
||
|
|
||
|
<hr class="a11y" />
|
||
|
|
||
|
<!-- PAGE ACTIONS -->
|
||
|
<div id="dokuwiki__pagetools">
|
||
|
<h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
|
||
|
<div class="tools">
|
||
|
<ul>
|
||
|
<?php
|
||
|
tpl_action('edit', 1, 'li', 0, '<span>', '</span>');
|
||
|
tpl_action('revert', 1, 'li', 0, '<span>', '</span>');
|
||
|
tpl_action('revisions', 1, 'li', 0, '<span>', '</span>');
|
||
|
tpl_action('backlink', 1, 'li', 0, '<span>', '</span>');
|
||
|
tpl_action('subscribe', 1, 'li', 0, '<span>', '</span>');
|
||
|
tpl_action('top', 1, 'li', 0, '<span>', '</span>');
|
||
|
?>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div><!-- /wrapper -->
|
||
|
|
||
|
<?php include('tpl_footer.php') ?>
|
||
|
</div></div><!-- /site -->
|
||
|
|
||
|
<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
|
||
|
<div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?>
|
||
|
<!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
|
||
|
</body>
|
||
|
</html>
|