Upgrade to rc5
This commit is contained in:
@@ -41,25 +41,15 @@ return [
|
||||
}
|
||||
|
||||
return $fields;
|
||||
},
|
||||
}
|
||||
],
|
||||
'methods' => [
|
||||
'errors' => function () {
|
||||
return $this->form->errors();
|
||||
},
|
||||
'data' => function () {
|
||||
$values = $this->form->values();
|
||||
|
||||
if (is_a($this->model, 'Kirby\Cms\Page') === true || is_a($this->model, 'Kirby\Cms\Site') === true) {
|
||||
// the title should never be updated directly via
|
||||
// fields section to avoid conflicts with the rename dialog
|
||||
unset($values['title']);
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
],
|
||||
'toArray' => function () {
|
||||
return [
|
||||
'errors' => $this->errors,
|
||||
'fields' => $this->fields,
|
||||
];
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ return [
|
||||
'template' => $this->template
|
||||
]);
|
||||
|
||||
return $file->blueprint()->accept()['mime'] ?? '*';
|
||||
return $file->blueprint()->acceptMime();
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -84,12 +84,12 @@ return [
|
||||
$files = $this->parent->files()->template($this->template);
|
||||
|
||||
// filter out all protected files
|
||||
$files = $files->filterBy('isReadable', true);
|
||||
$files = $files->filter('isReadable', true);
|
||||
|
||||
if ($this->sortBy) {
|
||||
$files = $files->sortBy(...$files::sortArgs($this->sortBy));
|
||||
} elseif ($this->sortable === true) {
|
||||
$files = $files->sortBy('sort', 'asc', 'filename', 'asc');
|
||||
$files = $files->sort(...$files::sortArgs($this->sortBy));
|
||||
} else {
|
||||
$files = $files->sort('sort', 'asc', 'filename', 'asc');
|
||||
}
|
||||
|
||||
// flip
|
||||
@@ -206,13 +206,15 @@ return [
|
||||
$multiple = true;
|
||||
}
|
||||
|
||||
$template = $this->template === 'default' ? null : $this->template;
|
||||
|
||||
return [
|
||||
'accept' => $this->accept,
|
||||
'multiple' => $multiple,
|
||||
'max' => $max,
|
||||
'api' => $this->parent->apiUrl(true) . '/files',
|
||||
'attributes' => array_filter([
|
||||
'template' => $this->template
|
||||
'template' => $template
|
||||
])
|
||||
];
|
||||
}
|
||||
|
@@ -126,7 +126,7 @@ return [
|
||||
|
||||
// sort
|
||||
if ($this->sortBy) {
|
||||
$pages = $pages->sortBy(...$pages::sortArgs($this->sortBy));
|
||||
$pages = $pages->sort(...$pages::sortArgs($this->sortBy));
|
||||
}
|
||||
|
||||
// flip
|
||||
@@ -165,7 +165,9 @@ return [
|
||||
'status' => $item->status(),
|
||||
'permissions' => [
|
||||
'sort' => $permissions->can('sort'),
|
||||
'changeStatus' => $permissions->can('changeStatus')
|
||||
'changeSlug' => $permissions->can('changeSlug'),
|
||||
'changeStatus' => $permissions->can('changeStatus'),
|
||||
'changeTitle' => $permissions->can('changeTitle')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user