20 private $type = self::TYPE_CREATION;
61 $this->enabled = $a_status;
79 $this->title = $a_title;
100 return $lng->txt($this->
getTitle());
104 return $tit ? $tit : $this->
getTitle();
138 $this->description = $a_description;
147 $this->info = $a_info;
183 $this->assignments = (
array) $a_ass;
201 $this->assignments[] = $a_obj_type;
263 $lang = $trans->getLanguages();
265 foreach(
$lang as $k => $v)
267 if($v[
'lang_default'])
279 $lang[0][
'lang_code'] = $trans->getDefaultLanguage();
297 $a_lng = $ilUser->getCurrentLanguage();
300 if(isset(
$lang[$a_lng][$a_value]))
302 return $lang[$a_lng][$a_value] ;
312 public function delete()
322 $query =
'DELETE FROM didactic_tpl_settings '.
323 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
324 $ilDB->manipulate(
$query);
327 $query =
'DELETE FROM didactic_tpl_sa '.
328 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
329 $ilDB->manipulate(
$query);
331 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
337 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
352 $this->
setId($ilDB->nextId(
'didactic_tpl_settings'));
354 $query =
'INSERT INTO didactic_tpl_settings (id,enabled,title,description,info,type,auto_generated,exclusive_tpl) '.
356 $ilDB->quote($this->
getId(),
'integer').
', '.
357 $ilDB->quote($this->
isEnabled(),
'integer').
', '.
358 $ilDB->quote($this->
getTitle(),
'text').
', '.
360 $ilDB->quote($this->
getInfo(),
'text').
', '.
361 $ilDB->quote($this->
getType(),
'integer').
', '.
366 $ilDB->manipulate($query);
405 $query =
'INSERT INTO didactic_tpl_sa (id,obj_type) '.
407 $ilDB->quote($this->
getId(),
'integer').
', '.
408 $ilDB->quote($a_obj_type,
'text').
410 $ilDB->manipulate(
$query);
428 $ilDB->quote($this->
getId(),
'integer').
', '.
429 $ilDB->quote($node,
'integer').
433 $query =
'INSERT INTO didactic_tpl_en (id,node) '.
434 'VALUES ' . implode(
', ' , $values);
436 $ilDB->manipulate(
$query);
443 $query =
'DELETE FROM didactic_tpl_en '.
444 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
445 $ilDB->manipulate(
$query);
452 $effective_nodes =
array();
454 $query =
'SELECT * FROM didactic_tpl_en '.
455 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
459 $effective_nodes[] =
$row->node;
479 $query =
'DELETE FROM didactic_tpl_sa '.
480 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
481 $ilDB->manipulate(
$query);
494 $query =
'UPDATE didactic_tpl_settings '.
496 'enabled = '.$ilDB->quote($this->
isEnabled(),
'integer').
', '.
497 'title = '.$ilDB->quote($this->
getTitle(),
'text').
', '.
498 'description = '.$ilDB->quote($this->
getDescription(),
'text').
', '.
499 'info = '.$ilDB->quote($this->
getInfo(),
'text').
', '.
500 'type = '.$ilDB->quote($this->
getType(),
'integer').
', '.
501 'exclusive_tpl = '.$ilDB->quote((
int)$this->
isExclusive(),
'integer').
' '.
502 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
503 $ilDB->manipulate(
$query);
529 $query =
'SELECT * FROM didactic_tpl_settings dtpl '.
530 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
546 $query =
'SELECT * FROM didactic_tpl_sa '.
547 'WHERE id = '.$ilDB->quote($this->
getId(),
'integer');
569 case self::TYPE_CREATION:
586 foreach($info_lines as
$info)
588 $trimmed_info = trim($info);
589 if(strlen($trimmed_info))
606 $writer->
xmlStartTag(
'effectiveFrom',
array(
'nic_id'=> $ilSetting->get(
'inst_id')));
625 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
628 $action->toXml($writer);
642 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateCopier.php';
653 include_once(
"./Services/Multilingualism/classes/class.ilMultilingualism.php");
672 if($tree->isGrandChild($node, $a_node_id))
static getInstance($a_obj_id, $a_type)
Get instance.
setInfo($a_info)
Set installation info text.
setType($a_type)
Set type.
isEnabled()
Check if template is enabled.
getDescription()
Get description.
getAssignments()
Get object assignemnts.
setTitle($a_title)
Set title.
saveAssignments()
Save assignments in DB.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
setAssignments(Array $a_ass)
Set assignments.
getPresentation($a_value, $a_lng)
xmlEndTag($tag)
Writes an endtag.
addAssignment($a_obj_type)
Add one assignment obj type.
setAutoGenerated($auto_generated)
DO NOT CHANGE THIS VALUE.
update()
Update settings ilDB $ilDB.
static deleteByTemplateId($a_tpl_id)
Delete by template id ilDB $ilDB.
read()
read settings from db
getPresentationDescription($a_lng="")
static appendCopyInfo($a_orig_title)
__construct($a_id=0)
Constructor.
getPresentationTitle($a_lng="")
Create styles array
The data for the language used.
toXml(ilXmlWriter $writer)
Export.
enable($a_status)
Set enabled status.
saveAssignment($a_obj_type)
Add one object assignment ilDB $ilDB.
__clone()
Implemented clone method.
deleteAssignments()
Delete assignments ilDB $ilDB.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
getInfo()
Get installation info text.
getTranslations()
get all translations from this object
setDescription($a_description)
Set description.
static getActionsByTemplateId($a_tpl_id)
Get actions of one template.
setEffectiveFrom($effective_from)