Upgrade to 3.0.3

This commit is contained in:
Bastian Allgeier
2019-03-05 10:55:03 +01:00
parent 8e3d86a590
commit 418db4b09b
40 changed files with 704 additions and 144 deletions

View File

@@ -222,23 +222,27 @@ class File extends ModelWithContent
* used in the panel, when the file
* gets dragged onto a textarea
*
* @param string $type
* @param bool $absolute
* @return string
*/
public function dragText($type = 'kirbytext'): string
public function dragText($type = 'kirbytext', bool $absolute = false): string
{
$url = $absolute ? $this->id() : $this->filename();
switch ($type) {
case 'kirbytext':
if ($this->type() === 'image') {
return '(image: ' . $this->filename() . ')';
return '(image: ' . $url . ')';
} else {
return '(file: ' . $this->filename() . ')';
return '(file: ' . $url . ')';
}
// no break
case 'markdown':
if ($this->type() === 'image') {
return '![' . $this->alt() . '](./' . $this->filename() . ')';
return '![' . $this->alt() . '](' . $url . ')';
} else {
return '[' . $this->filename() . '](./' . $this->filename() . ')';
return '[' . $this->filename() . '](' . $url . ')';
}
}
}