|
@@ 278-281 (lines=4) @@
|
| 275 |
|
return new HTTPResponse(null, 400); |
| 276 |
|
} |
| 277 |
|
|
| 278 |
|
if (!isset($vars['ids']) || !$vars['ids']) { |
| 279 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 280 |
|
->addHeader('Content-Type', 'application/json'); |
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
$fileIds = $vars['ids']; |
| 284 |
|
$files = $this->getList()->filter("ID", $fileIds)->toArray(); |
|
@@ 638-641 (lines=4) @@
|
| 635 |
|
* @return HTTPResponse |
| 636 |
|
*/ |
| 637 |
|
protected function saveOrPublish($data, $form, $doPublish = false) { |
| 638 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 639 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 640 |
|
->addHeader('Content-Type', 'application/json'); |
| 641 |
|
} |
| 642 |
|
|
| 643 |
|
$id = (int) $data['ID']; |
| 644 |
|
/** @var File $record */ |
|
@@ 674-677 (lines=4) @@
|
| 671 |
|
} |
| 672 |
|
|
| 673 |
|
public function unpublish($data, $form) { |
| 674 |
|
if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
| 675 |
|
return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
| 676 |
|
->addHeader('Content-Type', 'application/json'); |
| 677 |
|
} |
| 678 |
|
|
| 679 |
|
$id = (int) $data['ID']; |
| 680 |
|
/** @var File $record */ |