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';
192 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
205 $this->
setId($ilDB->nextId(
'didactic_tpl_settings'));
207 $query =
'INSERT INTO didactic_tpl_settings (id,enabled,title,description,info,type) '.
209 $ilDB->quote($this->
getId(),
'integer').
', '.
210 $ilDB->quote($this->
isEnabled(),
'integer').
', '.
211 $ilDB->quote($this->
getTitle(),
'text').
', '.
213 $ilDB->quote($this->
getInfo(),
'text').
', '.
214 $ilDB->quote($this->
getType(),
'integer').
217 $ilDB->manipulate($query);
247 $query =
'INSERT INTO didactic_tpl_sa (id,obj_type) '.
249 $ilDB->quote($this->
getId(),
'integer').
', '.
250 $ilDB->quote($a_obj_type,
'text').
252 $ilDB->manipulate(
$query);
264 $query =
'DELETE FROM didactic_tpl_sa '.
265 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
266 $ilDB->manipulate(
$query);
278 $query =
'UPDATE didactic_tpl_settings '.
280 'enabled = '.$ilDB->quote($this->
isEnabled(),
'integer').
', '.
281 'title = '.$ilDB->quote($this->
getTitle(),
'text').
', '.
282 'description = '.$ilDB->quote($this->
getDescription(),
'text').
', '.
283 'info = '.$ilDB->quote($this->
getInfo(),
'text').
', '.
284 'type = '.$ilDB->quote($this->
getType(),
'integer').
' '.
285 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
286 $ilDB->manipulate(
$query);
309 $query =
'SELECT * FROM didactic_tpl_settings dtpl '.
310 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
325 $query =
'SELECT * FROM didactic_tpl_sa '.
326 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
344 case self::TYPE_CREATION:
358 $info_lines = (array) explode(
"\n",$this->
getInfo());
359 foreach($info_lines as
$info)
361 $trimmed_info = trim($info);
362 if(strlen($trimmed_info))
364 $writer->
xmlElement(
'p', array(), $trimmed_info);
375 $writer->
xmlElement(
'assignment', array(), $assignment);
381 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
384 $action->toXml($writer);