add pdf reader modul

This commit is contained in:
team2
2026-02-12 20:57:54 +01:00
parent 14d7f3b2b9
commit a625468a9a
9 changed files with 229 additions and 6 deletions

View File

@@ -181,4 +181,26 @@ class DocumentVersion
{
return $this->isActive;
}
//#########################################################
// Helper
//#########################################################
public function getFileExtension(): string
{
if (!$this->filePath) {
return '';
}
return mb_strtolower(pathinfo($this->filePath, PATHINFO_EXTENSION));
}
public function getFileTypeLabel(): string
{
return match ($this->getFileExtension()) {
'pdf' => 'PDF',
'txt' => 'Text',
'md' => 'Markdown',
default => strtoupper($this->getFileExtension()),
};
}
}