@@ 953-956 (lines=4) @@ | ||
950 | */ |
|
951 | protected function saveOrPublish($data, $form, $doPublish = false) |
|
952 | { |
|
953 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
954 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
955 | ->addHeader('Content-Type', 'application/json'); |
|
956 | } |
|
957 | ||
958 | $id = (int) $data['ID']; |
|
959 | /** @var File $record */ |
|
@@ 1003-1006 (lines=4) @@ | ||
1000 | ||
1001 | public function unpublish($data, $form) |
|
1002 | { |
|
1003 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
1004 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
1005 | ->addHeader('Content-Type', 'application/json'); |
|
1006 | } |
|
1007 | ||
1008 | $id = (int) $data['ID']; |
|
1009 | /** @var File $record */ |