|
@@ 348-351 (lines=4) @@
|
| 345 |
|
return new HTTPResponse(null, 400); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
if (!isset($vars['ids']) || !$vars['ids']) { |
| 349 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 350 |
|
->addHeader('Content-Type', 'application/json'); |
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
$fileIds = $vars['ids']; |
| 354 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
|
@@ 1020-1023 (lines=4) @@
|
| 1017 |
|
*/ |
| 1018 |
|
protected function saveOrPublish($data, $form, $doPublish = false) |
| 1019 |
|
{ |
| 1020 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1021 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1022 |
|
->addHeader('Content-Type', 'application/json'); |
| 1023 |
|
} |
| 1024 |
|
|
| 1025 |
|
$id = (int) $data['ID']; |
| 1026 |
|
/** @var File $record */ |
|
@@ 1053-1056 (lines=4) @@
|
| 1050 |
|
|
| 1051 |
|
public function unpublish($data, $form) |
| 1052 |
|
{ |
| 1053 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1054 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1055 |
|
->addHeader('Content-Type', 'application/json'); |
| 1056 |
|
} |
| 1057 |
|
|
| 1058 |
|
$id = (int) $data['ID']; |
| 1059 |
|
/** @var File $record */ |