|
@@ 332-335 (lines=4) @@
|
| 329 |
|
return new HTTPResponse(null, 400); |
| 330 |
|
} |
| 331 |
|
|
| 332 |
|
if (!isset($vars['ids']) || !$vars['ids']) { |
| 333 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 334 |
|
->addHeader('Content-Type', 'application/json'); |
| 335 |
|
} |
| 336 |
|
|
| 337 |
|
$fileIds = $vars['ids']; |
| 338 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
|
@@ 1011-1014 (lines=4) @@
|
| 1008 |
|
*/ |
| 1009 |
|
protected function saveOrPublish($data, $form, $doPublish = false) |
| 1010 |
|
{ |
| 1011 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1012 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1013 |
|
->addHeader('Content-Type', 'application/json'); |
| 1014 |
|
} |
| 1015 |
|
|
| 1016 |
|
$id = (int) $data['ID']; |
| 1017 |
|
/** @var File $record */ |
|
@@ 1056-1059 (lines=4) @@
|
| 1053 |
|
|
| 1054 |
|
public function unpublish($data, $form) |
| 1055 |
|
{ |
| 1056 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 1057 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 1058 |
|
->addHeader('Content-Type', 'application/json'); |
| 1059 |
|
} |
| 1060 |
|
|
| 1061 |
|
$id = (int) $data['ID']; |
| 1062 |
|
/** @var File $record */ |