Dashboard Fach hinzufügen funktioniert in swe-b1-a-dev
This commit is contained in:
53
swe-b1-a-dev/webseite/classes/Config.php
Normal file
53
swe-b1-a-dev/webseite/classes/Config.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Konfigurationsdaten
|
||||
*/
|
||||
class Config
|
||||
{
|
||||
/**
|
||||
* @return string Verzeichnis für generelle Konfigurationsdaten
|
||||
*/
|
||||
public static function getConfigDirectory(): string
|
||||
{
|
||||
// Get absolute path to webseite directory
|
||||
$webseiteRoot = dirname(__DIR__) . '/';
|
||||
return $webseiteRoot . "config/";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string Verzeichnis für Fächer
|
||||
*/
|
||||
public static function getSubjectsDirectory(): string
|
||||
{
|
||||
return self::getConfigDirectory() . "subjects/";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subjectId ID des Faches
|
||||
* @return string Verzeichnis des Faches
|
||||
*/
|
||||
public static function getSubjectDirectory(string $subjectId): string
|
||||
{
|
||||
return self::getSubjectsDirectory() . $subjectId . "/";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subjectId ID des Faches
|
||||
* @return string Verzeichnis der Themen des Faches
|
||||
*/
|
||||
public static function getTopicsDirectory(string $subjectId): string
|
||||
{
|
||||
return self::getSubjectDirectory($subjectId) . "topics/";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $subjectId ID des Faches
|
||||
* @param string $topicId ID des Themas
|
||||
* @return string Verzeichnis des Themas
|
||||
*/
|
||||
public static function getTopicDirectory(string $subjectId, string $topicId): string
|
||||
{
|
||||
return self::getTopicsDirectory($subjectId) . $topicId . "/";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user