|
@@ 281-284 (lines=4) @@
|
| 278 |
|
return new HTTPResponse(null, 400); |
| 279 |
|
} |
| 280 |
|
|
| 281 |
|
if (!isset($vars['ids']) || !$vars['ids']) { |
| 282 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 283 |
|
->addHeader('Content-Type', 'application/json'); |
| 284 |
|
} |
| 285 |
|
|
| 286 |
|
$fileIds = $vars['ids']; |
| 287 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
|
@@ 671-674 (lines=4) @@
|
| 668 |
|
*/ |
| 669 |
|
protected function saveOrPublish($data, $form, $doPublish = false) |
| 670 |
|
{ |
| 671 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 672 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 673 |
|
->addHeader('Content-Type', 'application/json'); |
| 674 |
|
} |
| 675 |
|
|
| 676 |
|
$id = (int) $data['ID']; |
| 677 |
|
/** @var File $record */ |
|
@@ 708-711 (lines=4) @@
|
| 705 |
|
|
| 706 |
|
public function unpublish($data, $form) |
| 707 |
|
{ |
| 708 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 709 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 710 |
|
->addHeader('Content-Type', 'application/json'); |
| 711 |
|
} |
| 712 |
|
|
| 713 |
|
$id = (int) $data['ID']; |
| 714 |
|
/** @var File $record */ |