Downloadlinks und Erklärungstexte funktional
This commit is contained in:
@@ -4,7 +4,13 @@
|
||||
require_once ("classes/SubjectData.php");
|
||||
require_once ("classes/TopicData.php");
|
||||
|
||||
if(!isset($_GET["subject"])) {
|
||||
die("Ungültige Seite");
|
||||
}
|
||||
$subjectData = SubjectData::fromName($_GET["subject"]);
|
||||
if(!isset($subjectData)) {
|
||||
die("Ungültige Seite");
|
||||
}
|
||||
$topics = $subjectData->topics;
|
||||
?>
|
||||
|
||||
@@ -15,6 +21,7 @@ $topics = $subjectData->topics;
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo($subjectData->displayName); ?> 5. Klasse - Modern</title>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
@@ -536,23 +543,23 @@ $topics = $subjectData->topics;
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($topics as $topic) {
|
||||
foreach ($topics as $topicData) {
|
||||
?>
|
||||
|
||||
<div class="topic-card" onclick="window.location.href='topic.php?subject=<?php echo($topic->subjectId); ?>&topic=<?php echo($topic->id); ?>'" style="cursor: pointer;">
|
||||
<div class="topic-card" onclick="window.location.href='topic.php?subject=<?php echo($topicData->subjectId); ?>&topic=<?php echo($topicData->id); ?>'" style="cursor: pointer;">
|
||||
<div class="topic-header">
|
||||
<i class="fas <?php echo($topic->icon); ?> topic-icon"></i>
|
||||
<h3 class="topic-title"><?php echo($topic->displayName); ?></h3>
|
||||
<i class="fas <?php echo($topicData->icon); ?> topic-icon"></i>
|
||||
<h3 class="topic-title"><?php echo($topicData->displayName); ?></h3>
|
||||
</div>
|
||||
<div class="topic-content">
|
||||
<p class="topic-description">
|
||||
<?php echo($topic->description); ?>
|
||||
<?php echo($topicData->description); ?>
|
||||
</p>
|
||||
<div class="related-topics">
|
||||
<h4>Verwandte Themen:</h4>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($topic->relatedTopics as $relatedTopic) {
|
||||
foreach ($topicData->relatedTopics as $relatedTopic) {
|
||||
?>
|
||||
|
||||
<li><?php echo($relatedTopic); ?></li>
|
||||
@@ -567,28 +574,18 @@ $topics = $subjectData->topics;
|
||||
<h4>Übungen herunterladen:</h4>
|
||||
<div class="download-links">
|
||||
<?php
|
||||
foreach ($topic->files as $file) {
|
||||
foreach ($topicData->files as $fileName) {
|
||||
?>
|
||||
|
||||
|
||||
<a href="#" class="download-btn">
|
||||
<a href="<?php echo("config/subjects/$subjectData->id/topics/$topicData->id/$fileName")?>" target="_blank" class="download-btn">
|
||||
<i class="fas fa-file-pdf"></i>
|
||||
<?php echo($file); ?>
|
||||
<?php echo($fileName); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<a href="#" class="download-btn">
|
||||
<i class="fas fa-file-pdf"></i>
|
||||
Übung 1
|
||||
</a>
|
||||
<a href="#" class="download-btn">
|
||||
<i class="fas fa-file-pdf"></i>
|
||||
Übung 2
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress-bar" data-progress="100">
|
||||
|
||||
Reference in New Issue
Block a user