add pdf reader modul
This commit is contained in:
@@ -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()),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user