4 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php';
27 $this->parent_object = $a_parent_obj;
29 $this->lng->loadLanguageModule(
'didactic');
47 $next_class =
$ilCtrl->getNextClass($this);
50 switch ($next_class) {
64 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php';
67 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
70 if (!count($tpls) && !$value) {
75 $toolbar->
addText($this->lng->txt(
'didactic_selected_tpl_option'));
78 $options = array(0 => $this->lng->txt(
'didactic_default_type'));
81 foreach ($tpls as
$tpl) {
83 if ($tpl->isEffective(
$_GET[
'ref_id'])) {
84 $options[$tpl->getId()] = $tpl->getPresentationTitle();
86 if ($tpl->isExclusive()) {
92 if ($excl_tpl && $value != 0) {
97 if (!in_array($value, array_keys(
$options)) || ($excl_tpl && $value == 0)) {
98 $options[$value] = $this->lng->txt(
'not_available');
105 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
110 $tpl_selection->setOptions(
$options);
111 $tpl_selection->setValue($value);
115 $toolbar->
addFormButton($this->lng->txt(
'change'),
'confirmTemplateSwitch');
127 $ilTabs = $DIC[
'ilTabs'];
130 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
133 $new_tpl_id = (int) $_REQUEST[
'tplid'];
137 $ilCtrl->returnToParent($this);
140 $ilTabs->clearTargets();
141 $ilTabs->clearSubTabs();
143 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
145 $confirm->setFormAction(
$ilCtrl->getFormAction($this));
146 $confirm->setHeaderText($this->lng->txt(
'didactic_confirm_apply_new_template'));
147 $confirm->setConfirm($this->lng->txt(
'apply'),
'switchTemplate');
148 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
151 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php';
157 $dtpl->getPresentationTitle() .
158 '<div class="il_Description">' .
159 $dtpl->getPresentationDescription() .
' ' .
166 $this->lng->txt(
'default') .
' ' .
167 '<div class="il_Description">' .
169 $this->lng->txt(
'didactic_default_type_info'),
175 $tpl->setContent($confirm->getHTML());
187 $ilCtrl->returnToParent($this);
199 $new_tpl_id = (int) $_REQUEST[
'tplid'];
201 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateUtils.php';
204 ilUtil::sendSuccess($this->lng->txt(
'didactic_template_applied'),
true);
205 $ilCtrl->returnToParent($this);
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
appendToolbarSwitch(ilToolbarGUI $toolbar, $a_obj_type, $a_ref_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static switchTemplate($a_ref_id, $a_new_tpl_id)
executeCommand()
Execute command.
GUI class for didactic template settings inside repository objects.
__construct($a_parent_obj)
Constructor.
cancel()
Return to parent gui.
static getInstanceByObjectType($a_obj_type)
Get instance by obj type.
static getLogger($a_component_id)
Get component logger.
switchTemplate()
Switch Template.
Confirmation screen class.