Upgrade to 3.1.2
This commit is contained in:
@@ -367,6 +367,28 @@ class File extends ModelWithContent
|
||||
return $this->parent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file's last modification time.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string|null $handler date or strftime
|
||||
* @return mixed
|
||||
*/
|
||||
public function modified(string $format = null, string $handler = null)
|
||||
{
|
||||
$file = F::modified($this->root());
|
||||
$content = F::modified($this->contentFile());
|
||||
$modified = max($file, $content);
|
||||
|
||||
if (is_null($format) === true) {
|
||||
return $modified;
|
||||
}
|
||||
|
||||
$handler = $handler ?? $this->kirby()->option('date.handler', 'date');
|
||||
|
||||
return $handler($format, $modified);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parent Page object
|
||||
*
|
||||
@@ -418,14 +440,12 @@ class File extends ModelWithContent
|
||||
|
||||
$definition = array_merge($types[$this->type()] ?? [], $extensions[$this->extension()] ?? []);
|
||||
|
||||
$settings = [
|
||||
return [
|
||||
'type' => $definition['type'] ?? 'file',
|
||||
'back' => 'pattern',
|
||||
'color' => $definition['color'] ?? $colorWhite,
|
||||
'back' => $params['back'] ?? 'pattern',
|
||||
'ratio' => $params['ratio'] ?? null,
|
||||
];
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -745,6 +765,6 @@ class File extends ModelWithContent
|
||||
*/
|
||||
public function url(): string
|
||||
{
|
||||
return $this->url ?? $this->url = $this->kirby()->component('file::url')($this->kirby(), $this, []);
|
||||
return $this->url ?? $this->url = $this->kirby()->component('file::url')($this->kirby(), $this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user