@@ 28-44 (lines=17) @@ | ||
25 | ); |
|
26 | ||
27 | ||
28 | public function spam(SS_HTTPRequest $request) { |
|
29 | $ids = array(); |
|
30 | ||
31 | foreach($this->getRecords() as $record) { |
|
32 | array_push($ids, $record->ID); |
|
33 | $record->markSpam(); |
|
34 | } |
|
35 | ||
36 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
|
37 | 'done' => true, |
|
38 | 'records' => $ids |
|
39 | ))); |
|
40 | ||
41 | $response->addHeader('Content-Type', 'text/json'); |
|
42 | ||
43 | return $response; |
|
44 | } |
|
45 | ||
46 | ||
47 | public function approve(SS_HTTPRequest $request) { |
|
@@ 47-63 (lines=17) @@ | ||
44 | } |
|
45 | ||
46 | ||
47 | public function approve(SS_HTTPRequest $request) { |
|
48 | $ids = array(); |
|
49 | ||
50 | foreach($this->getRecords() as $record) { |
|
51 | array_push($ids, $record->ID); |
|
52 | $record->markApproved(); |
|
53 | } |
|
54 | ||
55 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
|
56 | 'done' => true, |
|
57 | 'records' => $ids |
|
58 | ))); |
|
59 | ||
60 | $response->addHeader('Content-Type', 'text/json'); |
|
61 | ||
62 | return $response; |
|
63 | } |
|
64 | } |