GUI class for didactic template settings inside repository objects.
More...
GUI class for didactic template settings inside repository objects.
- Author
- Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
ilDidacticTemplateGUI: ilPermissionGUI
Definition at line 13 of file class.ilDidacticTemplateGUI.php.
◆ __construct()
ilDidacticTemplateGUI::__construct |
( |
|
$a_parent_obj | ) |
|
◆ appendToolbarSwitch()
ilDidacticTemplateGUI::appendToolbarSwitch |
( |
ilToolbarGUI |
$toolbar, |
|
|
|
$a_obj_type, |
|
|
|
$a_ref_id |
|
) |
| |
Definition at line 62 of file class.ilDidacticTemplateGUI.php.
References $_GET, $tpl, ilToolbarGUI\addFormButton(), ilToolbarGUI\addInputItem(), ilToolbarGUI\addText(), ilDidacticTemplateSettings\getInstanceByObjectType(), getParentObject(), and ilDidacticTemplateObjSettings\lookupTemplateId().
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');
101 if (count($options) < 2) {
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');
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
static getInstanceByObjectType($a_obj_type)
Get instance by obj type.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
◆ cancel()
ilDidacticTemplateGUI::cancel |
( |
| ) |
|
|
protected |
◆ confirmTemplateSwitch()
ilDidacticTemplateGUI::confirmTemplateSwitch |
( |
| ) |
|
|
protected |
Definition at line 122 of file class.ilDidacticTemplateGUI.php.
References $DIC, $tpl, ilLoggerFactory\getLogger(), getParentObject(), ilDidacticTemplateObjSettings\lookupTemplateId(), and ilUtil\sendInfo().
126 $ilCtrl = $DIC[
'ilCtrl'];
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());
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getLogger($a_component_id)
Get component logger.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Confirmation screen class.
◆ executeCommand()
ilDidacticTemplateGUI::executeCommand |
( |
| ) |
|
Execute command.
- Returns
- <type>
Definition at line 41 of file class.ilDidacticTemplateGUI.php.
References $DIC.
45 $ilCtrl = $DIC[
'ilCtrl'];
47 $next_class = $ilCtrl->getNextClass($this);
48 $cmd = $ilCtrl->getCmd();
50 switch ($next_class) {
◆ getParentObject()
ilDidacticTemplateGUI::getParentObject |
( |
| ) |
|
◆ switchTemplate()
ilDidacticTemplateGUI::switchTemplate |
( |
| ) |
|
|
protected |
Switch Template.
Definition at line 193 of file class.ilDidacticTemplateGUI.php.
References $DIC, getParentObject(), and ilDidacticTemplateUtils\switchTemplate().
197 $ilCtrl = $DIC[
'ilCtrl'];
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 switchTemplate($a_ref_id, $a_new_tpl_id)
◆ $lng
ilDidacticTemplateGUI::$lng |
|
private |
◆ $parent_object
ilDidacticTemplateGUI::$parent_object |
|
private |
The documentation for this class was generated from the following file: