4 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php';
26 $this->parent_object = $a_parent_obj;
38 $next_class = $ilCtrl->getNextClass($this);
39 $cmd = $ilCtrl->getCmd();
64 $ilToolbar->addButton(
65 $lng->txt(
'didactic_import_btn'),
66 $ilCtrl->getLinkTarget($this,
'showImportForm')
69 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSettingsTableGUI.php';
74 $GLOBALS[
'tpl']->setContent($table->getHTML());
86 $ilTabs->clearTargets();
87 $ilTabs->setBackTarget(
88 $this->lng->txt(
'didactic_back_to_overview'),
89 $ilCtrl->getLinkTarget($this,
'overview')
96 $GLOBALS[
'tpl']->setContent($form->getHTML());
107 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
109 $form->setShowTopButtons(
false);
110 $form->setFormAction($ilCtrl->getFormAction($this));
111 $form->setTitle($this->lng->txt(
'didactic_import_table_title'));
112 $form->addCommandButton(
'importTemplate', $this->lng->txt(
'import'));
113 $form->addCommandButton(
'overview', $this->lng->txt(
'cancel'));
116 $file->setSuffixes(array(
'xml'));
117 $file->setRequired(TRUE);
118 $form->addItem(
$file);
133 if(!$form->checkInput())
136 $form->setValuesByPost();
141 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateImport.php';
145 $file = $form->getInput(
'file');
154 $import->setInputFile($tmp);
156 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using '.$tmp);
163 $GLOBALS[
'ilLog']->write(__METHOD__.
': Import failed with message: '. $e->getMessage());
168 $ilCtrl->redirect($this,
'overview');
182 return $ilCtrl->redirect($this,
'overview');
185 $ilTabs->clearTargets();
186 $ilTabs->setBackTarget(
187 $this->lng->txt(
'didactic_back_to_overview'),
188 $ilCtrl->getLinkTarget($this,
'overview')
192 $ilCtrl->saveParameter($this,
'tplid');
199 $GLOBALS[
'tpl']->setContent($form->getHTML());
212 if($form->checkInput())
214 $temp->setTitle($form->getInput(
'title'));
215 $temp->setDescription($form->getInput(
'description'));
216 $temp->setInfo($form->getInput(
'info'));
217 $temp->setAssignments(array($form->getInput(
'type')));
221 $ilCtrl->redirect($this,
'overview');
225 $form->setValuesByPost();
236 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
238 $form->setShowTopButtons(
false);
239 $form->setFormAction($ilCtrl->getFormAction($this,
'updateTemplate'));
240 $form->setTitle($this->lng->txt(
'didactic_edit_tpl'));
241 $form->addCommandButton(
'updateTemplate', $this->lng->txt(
'save'));
242 $form->addCommandButton(
'overview', $this->lng->txt(
'cancel'));
249 $title->setRequired(
true);
256 $form->addItem($desc);
262 $form->addItem($info);
268 $type->setValue(isset($assigned[0]) ? $assigned[0] :
'');
269 $subs = $objDefinition->getCreatableSubobjects(
'root',
false);
271 foreach(array_merge($subs,array(
'fold' => 1)) as $obj => $null)
273 if($objDefinition->isAllowedInRepository($obj))
275 $options[$obj] = $this->lng->txt(
'obj_'.$obj);
278 $type->setOptions($options);
279 $form->addItem($type);
294 return $ilCtrl->redirect($this,
'overview');
297 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateCopier.php';
303 $ilCtrl->redirect($this,
'overview');
316 return $ilCtrl->redirect($this,
'overview');
319 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateXmlWriter.php';
324 $writer->xmlDumpMem(TRUE),
325 $writer->getSetting()->getTitle().
'.xml',
340 return $ilCtrl->redirect($this,
'overview');
343 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
346 $confirm->setFormAction($ilCtrl->getFormAction($this));
347 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteTemplates');
348 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
350 foreach((array)
$_REQUEST[
'tpls'] as $tplid)
353 $confirm->addItem(
'tpls[]',
$tpl->getId(),
$tpl->getTitle());
357 $GLOBALS[
'tpl']->setContent($confirm->getHTML());
373 return $ilCtrl->redirect($this,
'overview');
376 foreach((array)
$_REQUEST[
'tpls'] as $tplid)
383 $ilCtrl->redirect($this,
'overview');
399 return $ilCtrl->redirect($this,
'overview');
410 $ilCtrl->redirect($this,
'overview');
426 return $ilCtrl->redirect($this,
'overview');
437 $ilCtrl->redirect($this,
'overview');