19declare(strict_types=1);
34 $this->tpl =
$DIC[
"tpl"];
35 $this->
ctrl = $DIC->ctrl();
36 $this->
lng = $DIC->language();
46 $next_class = $this->
ctrl->getNextClass($this);
49 $cmd = $this->
ctrl->getCmd();
51 switch ($next_class) {
66 $form = $this->initForm();
80 $form->setFormAction($ilCtrl->getFormAction($this));
81 $form->setTitle($this->
lng->txt(
"cont_ed_insert_lay"));
83 $config = $this->
getPage()->getPageConfig();
88 $use_template->setRequired(
true);
89 $form->addItem($use_template);
91 foreach ($templates as $templ) {
93 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), (
string) $templ->getId());
94 $use_template->addOption($opt);
96 $use_template->setValue((
string) $templ->getId());
102 $form->addCommandButton(
"create",
$lng->
txt(
"insert"));
103 $form->addCommandButton(
"cancelCreate",
$lng->
txt(
"cancel"));
115 $form = $this->initForm();
116 if ($form->checkInput()) {
118 $this->content_obj->create(
122 (
int) $form->getInput(
"tmpl")
124 $this->updated = $this->pg_obj->update();
125 if ($this->updated ===
true) {
126 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
131 $form->setValuesByPost();
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
@ilCtrl_isCalledBy ilPCLayoutTemplateGUI: ilPageEditorGUI
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
initCreationForm()
Init creation from.
executeCommand()
Execute command.
insert()
Insert content template.
create()
Insert the template.
Layout templates are not existing in the page.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
ilGlobalTemplateInterface $tpl
Content object of ilPageObject (see ILIAS DTD).
static activeLayouts(int $a_module=0)
Get active layouts.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
This class represents an option in a radio group.
setContent(string $a_html)
Sets content for standard template.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc