ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
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:23
ilTermsOfServiceJsonResponse\setBody
setBody($body)
Definition:
class.ilTermsOfServiceJsonResponse.php:50
ilTermsOfServiceJsonResponse\$body
$body
Definition:
class.ilTermsOfServiceJsonResponse.php:19
header
Add a drawing to the header
Definition:
04printing.php:69
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
exit
exit
Definition:
old-extract-schema.php:8
Services
TermsOfService
classes
class.ilTermsOfServiceJsonResponse.php
Generated on Sat Jan 18 2025 19:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)