19 declare(strict_types=1);
38 $def = self::getEContentDefinition(
'/campusconnect/courselinks');
39 return array_keys($def);
49 $def = self::getEContentDefinition(
'/campusconnect/courselinks');
50 return array_keys($def);
62 $all = array(
"rcrs",
"rcat",
"rfil",
"rglo",
"rgrp",
"rlm",
"rwik");
64 if (!$a_with_captions) {
69 foreach ($all as
$id) {
84 $all = array(
"crs",
"cat",
"file",
"glo",
"grp",
"lm",
"wiki");
86 if (!$a_with_captions) {
91 foreach ($all as
$id) {
102 switch ($a_resource_id) {
103 case '/campusconnect/courselinks':
105 'study_courses' => self::TYPE_ARRAY,
106 'lecturer' => self::TYPE_ARRAY,
107 'courseType' => self::TYPE_STRING,
108 'courseID' => self::TYPE_INT,
109 'credits' => self::TYPE_INT,
110 'semester_hours' => self::TYPE_INT,
111 'term' => self::TYPE_STRING,
112 'begin' => array(self::TYPE_TIMEPLACE,
'timePlace'),
113 'end' => array(self::TYPE_TIMEPLACE,
'timePlace'),
114 'room' => array(self::TYPE_TIMEPLACE,
'timePlace'),
115 'cycle' => array(self::TYPE_TIMEPLACE,
'timePlace')
118 case '/campusconnect/categories':
119 case '/campusconnect/files':
120 case '/campusconnect/glossaries':
121 case '/campusconnect/groups':
122 case '/campusconnect/learningmodules':
123 case '/campusconnect/wikis':
133 public static function getMatchableContent(
string $a_resource_id,
int $a_server_id,
object $a_ecs_content,
int $a_owner): array
141 $definition = self::getEContentDefinition($a_resource_id);
145 foreach ($definition as
$id => $type) {
146 if (is_array($type)) {
147 [$type, $target] = $type;
152 case self::TYPE_ARRAY:
153 if (isset($a_ecs_content->{$target})) {
161 if (isset($a_ecs_content->{$target})) {
168 case self::TYPE_STRING:
169 if (isset($a_ecs_content->{$target})) {
176 case self::TYPE_TIMEPLACE:
177 if (!is_object($timePlace)) {
179 if (isset($a_ecs_content->{$target}) && is_object($a_ecs_content->{$target})) {
180 $timePlace->loadFromJSON($a_ecs_content->{$target});
186 $value = array($timePlace->{
'getUT' . ucfirst(
$id)}(),
192 $value = array($timePlace->{
'get' . ucfirst(
$id)}(),
218 $defs = $a_values->getDefinitions();
219 foreach ($a_values->getADTGroup()->getElements() as $element_id => $element) {
220 if (!$element->isNull()) {
222 $res[$element_id] = $defs[$element_id]->getValueForXML($element);
static getInstancesForObjectId(int $a_obj_id, ?string $a_obj_type=null, string $a_sub_type="-", int $a_sub_id=0)
static getAdvancedMDValuesForObjId(int $a_obj_id)
Get advanced metadata values for object id.
static getPossibleReleaseTypes(bool $a_with_captions=false)
Get all possible release object types.
Representation of ECS EContent Time Place.
static getEContentDefinition(string $a_resource_id)
Get econtent / metadata definition.
static getPossibleRemoteTypes(bool $a_with_captions=false)
Get all possible remote object types.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstance()
Singleton instance.
static _getOptionalEContentFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _getOptionalECourseFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
static getMatchableContent(string $a_resource_id, int $a_server_id, object $a_ecs_content, int $a_owner)
Convert ECS content to rule matchable values.