| @@ 269-276 (lines=8) @@ | ||
| 266 | $obj['_id'] = $id; |
|
| 267 | } |
|
| 268 | $res = $db->updateObjectInCollection('themes', $obj); |
|
| 269 | if($res === FALSE) |
|
| 270 | { |
|
| 271 | throw new Exception('Unable to update object!', INTERNAL_ERROR); |
|
| 272 | } |
|
| 273 | else |
|
| 274 | { |
|
| 275 | echo json_encode(array('update'=>TRUE)); |
|
| 276 | } |
|
| 277 | } |
|
| 278 | ||
| 279 | function obj_delete($id) |
|
| @@ 293-300 (lines=8) @@ | ||
| 290 | throw new Exception('Cannot delete object that is not yours', ACCESS_DENIED); |
|
| 291 | } |
|
| 292 | $res = $db->deleteObjectFromCollection('themes', $old_obj); |
|
| 293 | if($res === false) |
|
| 294 | { |
|
| 295 | throw new Exception('Unable to delete object!', INTERNAL_ERROR); |
|
| 296 | } |
|
| 297 | else |
|
| 298 | { |
|
| 299 | echo json_encode(array('delete'=>TRUE)); |
|
| 300 | } |
|
| 301 | } |
|
| 302 | ||
| 303 | function themes() |
|