ILIAS
release_4-4 Revision
◀ ilDoc Overview
class.ilDidacticTemplateCopier.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10
class
ilDidacticTemplateCopier
11
{
12
private
$tpl_id
= 0;
13
private
$new_tpl_id
= 0;
14
19
public
function
__construct
($a_tpl_id)
20
{
21
$this->tpl_id = $a_tpl_id;
22
}
23
28
public
function
getTemplateId
()
29
{
30
return
$this->tpl_id
;
31
}
32
37
public
function
getNewTemplateId
()
38
{
39
return
$this->new_tpl_id
;
40
}
41
47
public
function
start
()
48
{
49
$orig =
new
ilDidacticTemplateSetting
($this->
getTemplateId
());
50
$copy = clone $orig;
51
$copy->save();
52
$this->new_tpl_id = $copy->getId();
53
54
include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php'
;
55
foreach
(
ilDidacticTemplateActionFactory::getActionsByTemplateId
($this->
getTemplateId
()) as $action)
56
{
57
$action->setTemplateId($this->
getNewTemplateId
());
58
$new = clone $action;
59
$new->save();
60
}
61
62
63
}
64
}
65
?>
ilDidacticTemplateSetting
Definition:
class.ilDidacticTemplateSetting.php:10
ilDidacticTemplateCopier\__construct
__construct($a_tpl_id)
Constructor.
Definition:
class.ilDidacticTemplateCopier.php:19
ilDidacticTemplateCopier\$new_tpl_id
$new_tpl_id
Definition:
class.ilDidacticTemplateCopier.php:13
ilDidacticTemplateCopier\getNewTemplateId
getNewTemplateId()
Get new template id.
Definition:
class.ilDidacticTemplateCopier.php:37
ilDidacticTemplateCopier\getTemplateId
getTemplateId()
Get template id.
Definition:
class.ilDidacticTemplateCopier.php:28
ilDidacticTemplateCopier\$tpl_id
$tpl_id
Definition:
class.ilDidacticTemplateCopier.php:12
ilDidacticTemplateCopier
Copy a didactic template and all subitems.
Definition:
class.ilDidacticTemplateCopier.php:10
ilDidacticTemplateCopier\start
start()
Start copy.
Definition:
class.ilDidacticTemplateCopier.php:47
ilDidacticTemplateActionFactory\getActionsByTemplateId
static getActionsByTemplateId($a_tpl_id)
Get actions of one template.
Definition:
class.ilDidacticTemplateActionFactory.php:68
Services
DidacticTemplate
classes
class.ilDidacticTemplateCopier.php
Generated on Mon Dec 21 2020 19:01:14 for ILIAS by
1.8.13 (using
Doxyfile
)