|
@@ 343-346 (lines=4) @@
|
| 340 |
|
return new HTTPResponse(null, 400); |
| 341 |
|
} |
| 342 |
|
|
| 343 |
|
if (!isset($vars['ids']) || !$vars['ids']) { |
| 344 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 345 |
|
->addHeader('Content-Type', 'application/json'); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
$fileIds = $vars['ids']; |
| 349 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
|
@@ 1015-1018 (lines=4) @@
|
| 1012 |
|
*/ |
| 1013 |
|
protected function saveOrPublish($data, $form, $doPublish = false) |
| 1014 |
|
{ |
| 1015 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1016 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1017 |
|
->addHeader('Content-Type', 'application/json'); |
| 1018 |
|
} |
| 1019 |
|
|
| 1020 |
|
$id = (int) $data['ID']; |
| 1021 |
|
/** @var File $record */ |
|
@@ 1048-1051 (lines=4) @@
|
| 1045 |
|
|
| 1046 |
|
public function unpublish($data, $form) |
| 1047 |
|
{ |
| 1048 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1049 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1050 |
|
->addHeader('Content-Type', 'application/json'); |
| 1051 |
|
} |
| 1052 |
|
|
| 1053 |
|
$id = (int) $data['ID']; |
| 1054 |
|
/** @var File $record */ |