58 $this->enabled = $a_status;
76 $this->title = $a_title;
103 $this->description = $a_description;
112 $this->info = $a_info;
130 $this->type = $a_type;
148 $this->assignments = (array) $a_ass;
166 $this->assignments[] = $a_obj_type;
172 public function delete()
177 $query =
'DELETE FROM didactic_tpl_settings '.
178 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
179 $ilDB->manipulate(
$query);
182 $query =
'DELETE FROM didactic_tpl_sa '.
183 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
184 $ilDB->manipulate(
$query);
186 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
203 $this->
setId($ilDB->nextId(
'didactic_tpl_settings'));
205 $query =
'INSERT INTO didactic_tpl_settings (id,enabled,title,description,info,type) '.
207 $ilDB->quote($this->
getId(),
'integer').
', '.
208 $ilDB->quote($this->
isEnabled(),
'integer').
', '.
209 $ilDB->quote($this->
getTitle(),
'text').
', '.
211 $ilDB->quote($this->
getInfo(),
'text').
', '.
212 $ilDB->quote($this->
getType(),
'integer').
215 $ilDB->manipulate($query);
245 $query =
'INSERT INTO didactic_tpl_sa (id,obj_type) '.
247 $ilDB->quote($this->
getId(),
'integer').
', '.
248 $ilDB->quote($a_obj_type,
'text').
250 $ilDB->manipulate(
$query);
262 $query =
'DELETE FROM didactic_tpl_sa '.
263 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
264 $ilDB->manipulate(
$query);
276 $query =
'UPDATE didactic_tpl_settings '.
278 'enabled = '.$ilDB->quote($this->
isEnabled(),
'integer').
', '.
279 'title = '.$ilDB->quote($this->
getTitle(),
'text').
', '.
280 'description = '.$ilDB->quote($this->
getDescription(),
'text').
', '.
281 'info = '.$ilDB->quote($this->
getInfo(),
'text').
', '.
282 'type = '.$ilDB->quote($this->
getType(),
'integer').
' '.
283 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
284 $ilDB->manipulate(
$query);
307 $query =
'SELECT * FROM didactic_tpl_settings dtpl '.
308 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
323 $query =
'SELECT * FROM didactic_tpl_sa '.
324 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
342 case self::TYPE_CREATION:
356 $info_lines = (array) explode(
"\n",$this->
getInfo());
357 foreach($info_lines as
$info)
359 $trimmed_info = trim($info);
360 if(strlen($trimmed_info))
362 $writer->
xmlElement(
'p', array(), $trimmed_info);
373 $writer->
xmlElement(
'assignment', array(), $assignment);
379 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
382 $action->toXml($writer);