ILIAS
release_4-4 Revision
◀ ilDoc Overview
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
4
require_once
'Services/JSON/classes/class.ilJsonUtil.php'
;
5
11
class
ilTermsOfServiceJsonResponse
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
}
ilTermsOfServiceJsonResponse\setStatus
setStatus($status)
Definition:
class.ilTermsOfServiceJsonResponse.php:42
exit
exit
Definition:
login.php:54
ilTermsOfServiceJsonResponse\STATUS_FAILURE
const STATUS_FAILURE
Definition:
class.ilTermsOfServiceJsonResponse.php:14
ilTermsOfServiceJsonResponse
Let this class derive from a real http response class in future.
Definition:
class.ilTermsOfServiceJsonResponse.php:11
ilTermsOfServiceJsonResponse\__construct
__construct()
Definition:
class.ilTermsOfServiceJsonResponse.php:24
ilJsonUtil\encode
static encode($mixed, $suppress_native=false)
Definition:
class.ilJsonUtil.php:14
ilTermsOfServiceJsonResponse\setBody
setBody($body)
Definition:
class.ilTermsOfServiceJsonResponse.php:50
ilTermsOfServiceJsonResponse\$body
$body
Definition:
class.ilTermsOfServiceJsonResponse.php:19
ilTermsOfServiceJsonResponse\__toString
__toString()
Definition:
class.ilTermsOfServiceJsonResponse.php:58
ilTermsOfServiceJsonResponse\initHttpBody
initHttpBody()
Definition:
class.ilTermsOfServiceJsonResponse.php:32
ilTermsOfServiceJsonResponse\STATUS_SUCCESS
const STATUS_SUCCESS
Definition:
class.ilTermsOfServiceJsonResponse.php:13
Services
TermsOfService
classes
class.ilTermsOfServiceJsonResponse.php
Generated on Mon Dec 21 2020 19:01:24 for ILIAS by
1.8.13 (using
Doxyfile
)