1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once 'Services/WebServices/ECS/classes/class.ilECSObjectSettings.php';
6
7/**
8* Class ilECSCourseSettings
9*
10* @author Stefan Meyer <smeyer.ilias@gmx.de>
11* $Id: class.ilObjCourseGUI.php 31646 2011-11-14 11:39:37Z jluetzen $
12*
13* @ingroup ModulesCourse
14*/
15class ilECSCourseSettings extends ilECSObjectSettings
16{
17    protected function getECSObjectType()
18    {
19        return '/campusconnect/courselinks';
20    }
21
22    protected function buildJson(ilECSSetting $a_server)
23    {
24        global $DIC;
25
26        $ilLog = $DIC['ilLog'];
27
28        $json = $this->getJsonCore('application/ecs-course');
29
30        // meta language
31        include_once('./Services/MetaData/classes/class.ilMDLanguage.php');
32        $lang = ilMDLanguage::_lookupFirstLanguage($this->content_obj->getId(), $this->content_obj->getId(), $this->content_obj->getType());
33        if (strlen($lang)) {
34            $json->lang = $lang . '_' . strtoupper($lang);
35        }
36
37        $json->status = $this->content_obj->isActivated() ? 'online' : 'offline';
38
39        include_once('./Services/WebServices/ECS/classes/class.ilECSUtils.php');
40        $definition = ilECSUtils::getEContentDefinition($this->getECSObjectType());
41        $this->addMetadataToJson($json, $a_server, $definition);
42
43        $json->courseID = 'il_' . IL_INST_ID . '_' . $this->getContentObject()->getType() . '_' . $this->getContentObject()->getId();
44
45        return $json;
46    }
47}
48