id;
}
public function getUrl(): string {
if ($this->isFolder() && !$this->external)
return '/files/'.$this->id.'/';
global $config;
$buf = 'https://'.$config['files_domain'];
if (!str_starts_with($this->path, '/'))
$buf .= '/';
$buf .= $this->path;
return $buf;
}
public function getTitleHtml(): ?string {
if ($this->isFolder() || !$this->author)
return null;
$buf = ''.htmlescape($this->author).'';
if (!str_ends_with($this->author, '.'))
$buf .= '.';
$buf .= ' '.htmlescape($this->title).'';
return $buf;
}
public function getTitle(): string {
return $this->title;
}
public function getMeta(?string $hl_matched = null): array {
if ($this->isFolder())
return [];
$items = [
sizeString($this->size),
strtoupper($this->getExtension())
];
return [
'inline' => false,
'items' => $items
];
}
protected function getExtension(): string {
return extension(basename($this->path));
}
public function isAvailable(): bool {
return true;
}
public function isTargetBlank(): bool {
return $this->isFile() || $this->external;
}
public function getSubtitle(): ?string {
if (!$this->year && !$this->subtitle)
return null;
$buf = '(';
$buf .= $this->subtitle ?: $this->year;
$buf .= ')';
return $buf;
}
}