ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilECSCourseMemberConnector.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php'
;
5
include_once
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php'
;
6
13
class
ilECSCourseMemberConnector
extends
ilECSConnector
14
{
15
20
public
function
__construct
(
ilECSSetting
$settings
= null)
21
{
22
parent::__construct(
$settings
);
23
}
24
25
30
public
function
getCourseMember
($course_member_id,$a_details =
false
)
31
{
32
$this->path_postfix =
'/campusconnect/course_members/'
. (int) $course_member_id;
33
34
if
($a_details
and
$course_member_id)
35
{
36
$this->path_postfix .=
'/details'
;
37
}
38
39
try
{
40
41
$this->
prepareConnection
();
42
$this->
setHeader
(
array
());
43
if
($a_details)
44
{
45
$this->
addHeader
(
'Accept'
,
'application/json'
);
46
}
47
else
48
{
49
#$this->addHeader('Accept', 'text/uri-list');
50
}
51
$this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader
());
52
$res
= $this->
call
();
53
54
if
(substr(
$res
, 0, 4) ==
'http'
)
55
{
56
$json = file_get_contents(
$res
);
57
$ecs_result =
new
ilECSResult
($json);
58
}
59
else
60
{
61
$ecs_result =
new
ilECSResult
(
$res
);
62
63
}
64
65
// Return ECSEContentDetails for details switch
66
if
($a_details)
67
{
68
include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php'
;
69
$details =
new
ilECSEContentDetails
();
70
$GLOBALS
[
'ilLog'
]->write(print_r(
$res
,
true
));
71
$details->loadFromJson($ecs_result->getResult());
72
return
$details;
73
}
74
75
return
$ecs_result->getResult();
76
}
77
catch
(
ilCurlConnectionException
$e)
78
{
79
throw
new
ilECSConnectorException
(
'Error calling ECS service: '
.$e->getMessage());
80
}
81
}
82
}
83
?>
ilCurlConnectionException
Definition:
class.ilCurlConnectionException.php:34
ilECSSetting
Definition:
class.ilECSSetting.php:33
$res
$res
Definition:
examplelayouts.sql.php:25
ilECSConnector\$settings
$settings
Definition:
class.ilECSConnector.php:50
ilECSConnector\getHeader
getHeader()
Definition:
class.ilECSConnector.php:85
ilECSResult
Definition:
class.ilECSResult.php:35
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
ilECSEContentDetails
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
Definition:
class.ilECSEContentDetails.php:32
ilECSConnectorException
Definition:
class.ilECSConnectorException.php:36
ilECSConnector\setHeader
setHeader($a_header_strings)
Definition:
class.ilECSConnector.php:90
ilECSCourseMemberConnector
Connector for course member ressource.
Definition:
class.ilECSCourseMemberConnector.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilECSCourseMemberConnector\__construct
__construct(ilECSSetting $settings=null)
Constructor.
Definition:
class.ilECSCourseMemberConnector.php:20
ilECSConnector\call
call()
call peer
Definition:
class.ilECSConnector.php:651
ilECSConnector
Definition:
class.ilECSConnector.php:38
php
and
ilECSConnector\addHeader
addHeader($a_name, $a_value)
Add Header.
Definition:
class.ilECSConnector.php:80
ilECSConnector\prepareConnection
prepareConnection()
prepare connection
Definition:
class.ilECSConnector.php:604
ilECSCourseMemberConnector\getCourseMember
getCourseMember($course_member_id, $a_details=false)
Get single directory tree.
Definition:
class.ilECSCourseMemberConnector.php:30
Services
WebServices
ECS
classes
Course
class.ilECSCourseMemberConnector.php
Generated on Fri Jan 17 2025 19:01:20 for ILIAS by
1.8.13 (using
Doxyfile
)