ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjRemoteGlossary.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once('Services/WebServices/ECS/classes/class.ilRemoteObjectBase.php');
5 
16 {
17  const DB_TABLE_NAME = "rglo_settings";
18 
19  const ACTIVATION_OFFLINE = 0;
20  const ACTIVATION_ONLINE = 1;
21 
22  protected $availability_type;
23 
24  public function initType()
25  {
26  $this->type = "rglo";
27  }
28 
29  protected function getTableName()
30  {
31  return self::DB_TABLE_NAME;
32  }
33 
34  protected function getECSObjectType()
35  {
36  return "/campusconnect/glossaries";
37  }
38 
44  public function setAvailabilityType($a_type)
45  {
46  $this->availability_type = $a_type;
47  }
48 
54  public function getAvailabilityType()
55  {
57  }
58 
65  public static function _lookupOnline($a_obj_id)
66  {
67  global $ilDB;
68 
69  $query = "SELECT * FROM " . self::DB_TABLE_NAME .
70  " WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
71  $res = $ilDB->query($query);
73  switch ($row->availability_type) {
74  case self::ACTIVATION_ONLINE:
75  return true;
76 
77  case self::ACTIVATION_OFFLINE:
78  return false;
79 
80  default:
81  return false;
82  }
83 
84  return false;
85  }
86 
87  protected function doCreateCustomFields(array &$a_fields)
88  {
89  $a_fields["availability_type"] = array("integer", 0);
90  }
91 
92  protected function doUpdateCustomFields(array &$a_fields)
93  {
94  $a_fields["availability_type"] = array("integer", $this->getAvailabilityType());
95  }
96 
97  protected function doReadCustomFields($a_row)
98  {
99  $this->setAvailabilityType($a_row->availability_type);
100  }
101 
102  protected function updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
103  {
104  $this->setAvailabilityType($a_ecs_content->availability == 'online' ? self::ACTIVATION_ONLINE : self::ACTIVATION_OFFLINE);
105  }
106 }
doUpdateCustomFields(array &$a_fields)
Remote glossary app class.
updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
doCreateCustomFields(array &$a_fields)
setAvailabilityType($a_type)
Set Availability type.
$a_type
Definition: workflow.php:92
foreach($_POST as $key=> $value) $res
$query
Remote object app base class.
Create styles array
The data for the language used.
getAvailabilityType()
get availability type
global $ilDB
static _lookupOnline($a_obj_id)
Lookup online.