@@ 958-961 (lines=4) @@ | ||
955 | */ |
|
956 | protected function saveOrPublish($data, $form, $doPublish = false) |
|
957 | { |
|
958 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
959 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
960 | ->addHeader('Content-Type', 'application/json'); |
|
961 | } |
|
962 | ||
963 | $id = (int) $data['ID']; |
|
964 | /** @var File $record */ |
|
@@ 1008-1011 (lines=4) @@ | ||
1005 | ||
1006 | public function unpublish($data, $form) |
|
1007 | { |
|
1008 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
1009 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
1010 | ->addHeader('Content-Type', 'application/json'); |
|
1011 | } |
|
1012 | ||
1013 | $id = (int) $data['ID']; |
|
1014 | /** @var File $record */ |