ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilTermsOfServiceJsonResponse.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/JSON/classes/class.ilJsonUtil.php';
5
12{
13 const STATUS_SUCCESS = 1;
14 const STATUS_FAILURE = 2;
15
19 protected $body;
20
24 public function __construct()
25 {
26 $this->initHttpBody();
27 }
28
32 protected function initHttpBody()
33 {
34 $this->body = new stdClass();
35 $this->body->status = self::STATUS_SUCCESS;
36 $this->body->body = '';
37 }
38
42 public function setStatus($status)
43 {
44 $this->body->status = $status;
45 }
46
50 public function setBody($body)
51 {
52 $this->body->body = $body;
53 }
54
58 public function __toString()
59 {
60 header("Content-type: application/json; charset=UTF-8");
61 echo ilJsonUtil::encode($this->body);
62 exit();
63 }
64}
static encode($mixed, $suppress_native=false)
Let this class derive from a real http response class in future.
exit
Definition: login.php:54