Files
cwsvJudo/homepage/participo/infoZettel.php
2022-01-16 19:04:26 +01:00

128 lines
3.6 KiB
PHP

<?php
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once("config/participo.php");
require_once("./local/dbConf.php");
require_once("./local/cwsvJudo.php");
require_once("./lib/db.php");
require_once("./lib/api.php");
require_once("./lib/participoLib/participo.php");
require_once("./auth.php");
$basePath = $config['basePath'];
require_once($basePath."/config/cwsvJudo.config.php");
require_once($basePath."/ressourcen/phpLib/parsedown/Parsedown.php");
require_once($basePath."/ressourcen/phpLib/Spyc/Spyc.php");
// get a list of all infoZettel
$fileList = glob($basePath."/infoZettel/*.md");
rsort($fileList);
$years = [];
foreach($fileList as $file){
$years[] = (int)substr(basename($file), 0, 4);
}
$years = array_unique($years);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php readfile("./shared/imports.php");?>
<!-- adjustments to parsedowncards (smaller headings) -->
<link rel="stylesheet" href="css/parsedownCard.css">
<!-- inits for the materializeCss -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, {
// specify options here
});
});
</script>
<title>InfoZettel</title>
<meta name="description" content="InfoZettel der Judoka des Chemnitzer WSV">
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
</head>
<body>
<header>
<nav class="indigo darken-4">cwsvJudo InfoZettel<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
<i class="material-icons">menu</i>
</a></nav>
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
<li class="logo">
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
</a>
</li>
<li><?php require_once("sidenav/loginStatus.php");?></li>
<li class="bold">
<a class="waves-effect waves-teal left-align" href="/participo">zurück</a>
</li>
<?php
foreach($years as $year){?>
<li class="bold">
<a class="waves-effect waves-teal right-align" href="#infoZettel-<?php echo($year);?>"><?php echo($year);?></a>
</li>
<?php
}
?>
</ul>
</header>
<?php
if($_SESSION['login']){
?>
<main>
<!-- List of Infos -->
<div class="row" id="infoList">
<?php
$currentYear = (int)substr(basename($fileList[0]), 0, 4);
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
foreach($fileList as $file){
$thisYear = (int)substr(basename($file), 0, 4);
if($thisYear != $currentYear){
$currentYear=$thisYear;
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
}
// get a list of all infoZettel
$fileList = glob($basePath."/infoZettel/*.md");
rsort($fileList);
foreach($fileList as $file){
$thisYear = (int)substr(basename($file), 0, 4);
if($thisYear != $currentYear){
$currentYear=$thisYear;
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
}
$infoZettel = loadMarkdownFile($file);
echo(
AppCard::fromArray([
'title' => $infoZettel['yaml']['title'],
'description'=> Parsedown::instance()->text( $infoZettel['mdText'] ),
])->htmlCode(['extraClass'=>"parsedownCard"])
);
}
?>
</div><!-- End of Infos -->
</main>
<?php
}
?>
</body>
</html>