mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 18:34:32 +02:00
Allow to select the master picture attachment.
This commit is contained in:
parent
fe9526e0eb
commit
e2b643c52b
5 changed files with 47 additions and 6 deletions
|
@ -73,12 +73,18 @@ abstract class Attachment extends NamedDBElement
|
|||
|
||||
/**
|
||||
* Check if this attachement is a picture (analyse the file's extension).
|
||||
* If the link is external, it is assumed that this is false.
|
||||
*
|
||||
* @return bool * true if the file extension is a picture extension
|
||||
* * otherwise false
|
||||
*/
|
||||
public function isPicture(): bool
|
||||
{
|
||||
//We can not check if a external link is a picture, so just assume this is false
|
||||
if ($this->isExternal()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$extension = pathinfo($this->getPath(), PATHINFO_EXTENSION);
|
||||
|
||||
// list all file extensions which are supported to display them by HTML code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue