diff options
Diffstat (limited to 'platform/www/lib/tpl/acervus/main.php')
-rw-r--r-- | platform/www/lib/tpl/acervus/main.php | 265 |
1 files changed, 265 insertions, 0 deletions
diff --git a/platform/www/lib/tpl/acervus/main.php b/platform/www/lib/tpl/acervus/main.php new file mode 100644 index 0000000..c4dfd1c --- /dev/null +++ b/platform/www/lib/tpl/acervus/main.php @@ -0,0 +1,265 @@ +<?php +/** + * DokuWiki Starter Template + * + * @link http://dokuwiki.org/template:ipari + * @author Kwangyoung Lee <ipari@leaflette.com> + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + */ + +if (!defined('DOKU_INC')) die(); +@require_once(dirname(__FILE__).'/tpl_functions.php'); +header('X-UA-Compatible: IE=edge,chrome=1'); +$showSidebar = page_findnearest($conf['sidebar']); +?> +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>" + lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js"> +<head> + <meta charset="UTF-8" /> + <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') ?> + +<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script> +<!-- <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap" rel="stylesheet"> --> + +<link rel="preconnect" href="https://fonts.googleapis.com"> +<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> +<link href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap" rel="stylesheet"> + +<?php +$translation = plugin_load('helper','translation'); +global $ID; +$startpage = $conf['start']; +$lang2 = $translation->getLangPart($ID); +if ($lang2 != '') { + $startpage = $lang2 .':'.$startpage; +} +?> + +</head> + +<body id="dokuwiki__top"> + <div id="dokuwiki__site" class="<?php echo tpl_classes(); ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>"> + <?php html_msgarea() ?> + <?php tpl_includeFile('header.html') ?> + + <!-- ********** HEADER ********** --> + <div id="dokuwiki__header"> + <div class="group"> + <!-- <h1 id="sitetitle"><?php tpl_link('/'.$startpage,$title_text,'accesskey="h" title="[H]"') ?></h1> --> + <h1><?php tpl_link('/'.$startpage,$conf['title'],'accesskey="h" title="[H]"') ?></h1> + <div class="left"> + <?php if ($showSidebar): ?> + <button class="btn_left" accesskey="s", title="[S]">Nav</button> + <?php endif; ?> + </div> + <div class="right"> + <button class="btn_search">Search</button> + <button class="btn_right" accesskey="m", title="[M]">Edit</button> + </div> + </div> + <div class="search"> + <?php tpl_searchform(); ?> + </div> + + + </div><!-- /header --> + + <!-- ********** sidebar ********** --> + <div id="sidebar_wrapper"> + <!-- ********** ASIDE ********** --> + <?php if ($showSidebar): ?> + <div id="dokuwiki__aside" class="sidebar"> + <?php tpl_includeFile('sidebarheader.html') ?> + <?php tpl_include_page($conf['sidebar'], 1, 1) ?> + <?php tpl_includeFile('sidebarfooter.html') ?> + </div><!-- /dokuwiki__aside --> + <?php endif; ?> + + <div id="dokuwiki__tools" class="sidebar left"> + <!-- PAGE TOOLS --> + <div id="dokuwiki__pagetools"> + <h3><?php echo $lang['page_tools'] ?></h3> + <ul> + <?php white_toolsevent('pagetools', array( + 'edit' => tpl_action('edit', 1, 'li', 1, '<span>', '</span>'), + 'revisions' => tpl_action('revisions', 1, 'li', 1, '<span>', '</span>'), + 'backlink' => tpl_action('backlink', 1, 'li', 1, '<span>', '</span>'), + 'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span>', '</span>'), + 'revert' => tpl_action('revert', 1, 'li', 1, '<span>', '</span>'), + )); ?> + </ul> + </div><!-- /dokuwiki__pagetools --> + + <!-- SITE TOOLS --> + <div id="dokuwiki__sitetools"> + <h3><?php echo $lang['site_tools'] ?></h3> + <ul> + <?php white_toolsevent('sitetools', array( + 'recent' => tpl_action('recent', 1, 'li', 1, '<span>', '</span>'), + 'media' => tpl_action('media', 1, 'li', 1, '<span>', '</span>'), + 'index' => tpl_action('index', 1, 'li', 1, '<span>', '</span>'), + )); ?> + </ul> + </div><!-- /dokuwiki__sitetools --> + + <!-- USER TOOLS --> + <?php if ($conf['useacl']): ?> + <div id="dokuwiki__usertools"> + <h3><?php echo $lang['user_tools'] ?></h3> + <ul> + <?php white_toolsevent('usertools', array( + 'admin' => tpl_action('admin', 1, 'li', 1, '<span>', '</span>'), + 'profile' => tpl_action('profile', 1, 'li', 1, '<span>', '</span>'), + 'register' => tpl_action('register', 1, 'li', 1, '<span>', '</span>'), + 'login' => tpl_action('login', 1, 'li', 1, '<span>', '</span>'), + )); ?> + </ul> + <?php + if (!empty($_SERVER['REMOTE_USER'])) { + echo '<div class="user">'; + tpl_userinfo(); + echo '</div>'; + } + ?> + </div><!-- /dokuwiki__usertools --> + <?php endif ?> + </div><!-- /dokuwiki__tools --> + + <div id="sidebar_bg"> + </div> + + <div id="to_top"> + <?php tpl_action('top') ?> + </div> + </div><!-- /sidebar_wrapper --> + + <div class="wrapper group"> + <!-- ********** CONTENT ********** --> + <div id="dokuwiki__content"><div class="group"> + <?php tpl_flush() ?> + <?php tpl_includeFile('pageheader.html') ?> + + <!-- BREADCRUMBS --> + <?php if($conf['breadcrumbs']){ ?> + <div class="breadcrumbs"><?php tpl_breadcrumbs($ret='›') ?></div> + <?php } ?> + <?php if($conf['youarehere']){ ?> + <div class="breadcrumbs"><?php tpl_youarehere() ?></div> + <?php } ?> + + <?php + $filepath = $INFO['filepath']; + $file_markdown = $filepath; + $file_pdf = str_replace('.txt','.pdf',$filepath); + $file_epub = str_replace('.txt','.epub',$filepath); + + if (file_exists($file_pdf)) { + $file_pdf_url = str_replace('/srv/acerv.us/platform/www','',$file_pdf); + $download_link .= '<a href="'. $file_pdf_url .'">pdf</a> | '; + } + + if (file_exists($file_epub)) { + $file_epub_url = str_replace('/srv/acerv.us/platform/www','',$file_epub); + $download_link .= '<a href="'. $file_epub_url .'">epub</a> | '; + } + + if ($download_link) { + $file_markdown_url = str_replace('/srv/acerv.us/platform','',$file_markdown); + echo '<div class="download">' . tpl_getLang('download') . ': ' . $download_link . '</div>'; + $download_link .= '<a href="'. $file_markdown_url .'">markdown</a>'; + } + + + ?> + + + <div class="page group + <?php if(tpl_getConf('numberedHeading')): ?> numbered_heading<?php endif ?> + <?php if(tpl_getConf('tocPosition')): ?> toc_<?php echo tpl_getConf('tocPosition') ?><?php endif ?> + "> + <!-- wikipage start --> + <?php tpl_content() ?> + <!-- wikipage stop --> + </div> + + <?php tpl_flush() ?> + <?php tpl_includeFile('pagefooter.html') ?> + </div></div><!-- /content --> + + <!-- ********** FOOTER ********** --> + <div id="dokuwiki__footer"> + <?php if($INFO['exists']): ?> + <div class="doc"><?php white_pageinfo() ?></div> + <?php endif ?> + <?php tpl_includeFile('sidebarfooter.html') ?> + <?php tpl_license('badge', false, false) ?> + <div class="footer"> + <?php tpl_include_page(tpl_getConf('footer'), 1, 1) ?> + </div> + + <center><?php + if ($translation) echo $translation->showTranslations(); + ?></center> + </div><!-- /footer --> + + <?php tpl_includeFile('footer.html') ?> + </div><!-- /wrapper --> + + </div><!-- /site --> + + <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div> + +<script> + +function getAnchor() { + // alert(decodeURI(document.URL)); + return (decodeURI(document.URL).split('#').length > 1) ? decodeURI(document.URL).split('#')[1] : null; +} + +if (document.URL.toLowerCase().indexOf("index") === -1) { // not show on index + if (document.URL.includes(':en') || + document.URL.includes(':es') || + document.URL.includes(':fr') || + document.URL.includes(':script') || + document.URL.includes(':article') + ) { // only shows number of paragraph in books, articles and scripts pages + anchors.options = { + placement: 'left', + visible: 'always', + icon: '¶' + }; + //anchors.add(''); + anchors.add('#dokuwiki__content p'); + anchors.add('#dokuwiki__content li'); + anchors.add('#dokuwiki__content tr'); + + // highlight referenced paragraph + anchor = getAnchor(); + if (anchor !== null) { + var anchor_element = document.getElementById(anchor); + anchor_element.style.backgroundColor = "#ffff0033"; + (function($) { + $([document.documentElement, document.body]).animate({ + scrollTop: $("#" + anchor).offset().top-50 + }, 2000); + })(jQuery); + + + } + + } + +} + + +</script> + + +</body> +</html> |