47 $this->
ctrl = $DIC->ctrl();
48 $this->rbacsystem = $DIC->rbac()->system();
49 $this->
toolbar = $DIC->toolbar();
50 $this->
lng = $DIC->language();
51 $this->tpl = $DIC[
"tpl"];
52 $this->
tabs = $DIC->tabs();
55 $this->admin_request = $DIC
61 $this->ref_id = $this->admin_request->getRefId();
66 $next_class = $this->
ctrl->getNextClass($this);
67 $cmd = $this->
ctrl->getCmd(
"listLayouts");
69 if ($cmd ==
"listLayouts") {
75 switch ($next_class) {
76 case 'ilpagelayoutgui':
77 $this->
tabs->clearTargets();
78 $this->
tabs->setBackTarget(
79 $this->
lng->txt(
"page_layouts"),
80 $this->
ctrl->getLinkTarget($this,
"listLayouts")
83 $this->
ctrl->setReturn($this,
"listLayouts");
84 if ($this->pg_id != null) {
89 $this->admin_request->getObjId()
93 $layout_gui->setEditPreview(
true);
94 $this->
ctrl->saveParameter($this,
"obj_id");
95 $ret = $this->
ctrl->forwardCommand($layout_gui);
97 $this->tpl->setContent($ret);
102 if (in_array($cmd, array(
"listLayouts",
"editPg",
"addPageLayout",
"cancelCreate",
"createPg",
"exportLayout",
103 "activate",
"deactivate",
"importPageLayoutForm",
"deletePgl",
"cancelDeletePg",
104 "confirmedDeletePg",
"importPageLayout"))) {
107 die(
"Unknown command " . $cmd);
118 bool $a_throw_exc =
true 120 if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id)) {
134 $this->
lng->txt(
"sty_add_pgl"),
135 $this->
ctrl->getLinkTarget($this,
"addPageLayout")
138 $this->
lng->txt(
"sty_import_page_layout"),
139 $this->
ctrl->getLinkTarget($this,
"importPageLayoutForm")
143 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/COPage/Layout");
146 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
147 $this->tpl->setContent($oa_tpl->get());
151 bool $a_activate =
true 153 $ids = $this->admin_request->getLayoutIds();
154 if (count($ids) == 0) {
155 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
157 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_opt_saved"),
true);
158 foreach ($ids as $item) {
160 $pg_layout->activate($a_activate);
163 $this->
ctrl->redirect($this,
"listLayouts");
176 $ids = $this->admin_request->getLayoutIds();
177 if (count($ids) == 0) {
178 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
179 $this->
ctrl->redirect($this,
"listLayouts");
186 $cgui->setFormAction($this->
ctrl->getFormAction($this));
187 $cgui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
188 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelDeletePg");
189 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"confirmedDeletePg");
191 foreach ($ids as
$id) {
193 $pg_obj->readObject();
195 $caption = $pg_obj->getTitle();
197 $cgui->addItem(
"pglayout[]", $id, $caption);
200 $this->tpl->setContent($cgui->getHTML());
208 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"msg_cancel"),
true);
209 $this->
ctrl->redirect($this,
"listLayouts");
217 $ids = $this->admin_request->getLayoutIds();
218 foreach ($ids as
$id) {
223 $this->
ctrl->redirect($this,
"listLayouts");
231 $this->tpl->setContent($a_form->getHTML());
236 $this->
lng->loadLanguageModule(
"content");
239 $form_gui->setFormAction($this->
ctrl->getFormAction($this));
240 $form_gui->setTitle($this->
lng->txt(
"sty_create_pgl"));
243 $title_input->setSize(50);
244 $title_input->setMaxLength(128);
246 $title_input->setTitle($this->
lng->txt(
"title"));
247 $title_input->setRequired(
true);
252 $desc_input->setCols(37);
260 $mods->addOption($mod);
267 foreach ($arr_templates1 as $v) {
268 $arr_templates[] = $v;
272 $options[
'-1'] = $this->
lng->txt(
"none");
274 foreach ($arr_templates as $templ) {
275 $templ->readObject();
276 $key = $templ->getId();
277 $value = $templ->getTitle();
278 $options[
$key] = $value;
281 $ttype_input->setOptions($options);
282 $ttype_input->setValue(-1);
283 $ttype_input->setRequired(
true);
285 $desc_input->setTitle($this->
lng->txt(
"description"));
286 $desc_input->setRequired(
false);
288 $form_gui->addItem($title_input);
289 $form_gui->addItem($desc_input);
290 $form_gui->addItem($mods);
291 $form_gui->addItem($ttype_input);
294 $form_gui->addCommandButton(
"createPg", $this->
lng->txt(
"save"));
295 $form_gui->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
304 if (!$form_gui->checkInput()) {
305 $form_gui->setValuesByPost();
312 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
313 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
314 $pg_object->setModules($form_gui->getInput(
'module'));
315 $pg_object->update();
322 $this->pg_content->setId($pg_object->getId());
324 $tmpl = $form_gui->getInput(
'pgl_template');
327 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
329 $this->pg_content->create(
false);
331 $this->
ctrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
332 $this->
ctrl->redirectByClass(
"ilpagelayoutgui",
"edit");
344 $this->
ctrl->setCmdClass(
"ilpagelayoutgui");
345 $this->
ctrl->setCmd(
"edit");
359 $succ = $exp->exportEntity(
361 $this->admin_request->getObjId(),
368 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
370 $succ[
"directory"] .
"/" . $succ[
"file"],
378 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
379 unlink($succ[
"directory"] .
"/" . $succ[
"file"]);
381 if (is_dir($succ[
"directory"])) {
392 $this->tpl->setContent($form->getHTML());
405 $fi->setRequired(
true);
408 $form->addCommandButton(
"importPageLayout", $this->
lng->txt(
"import"));
409 $form->addCommandButton(
"listLayouts", $this->
lng->txt(
"cancel"));
411 $form->setTitle($this->
lng->txt(
"sty_import_page_layout"));
412 $form->setFormAction($this->
ctrl->getFormAction($this));
423 if ($form->checkInput()) {
425 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_imported_layout"),
true);
426 $this->
ctrl->redirect($this,
"listLayouts");
428 $form->setValuesByPost();
429 $this->tpl->setContent($form->getHTML());
exportLayout()
Export page layout template object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
AdministrationGUIRequest $admin_request
importPageLayout()
Import page layout.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
Class ilPageLayoutGUI GUI class.
deletePgl()
display deletion confirmation screen
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilContentStyleSettings $settings
setTabs(ilTabsGUI $a_tabs=null)
output tabs
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activate(bool $a_activate=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static import(string $a_filename, string $a_filepath)
Import page layout.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPageLayoutPage $pg_content
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
importPageLayoutForm()
Import page layout.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAvailableModules()
addPageLayout(ilPropertyFormGUI $a_form=null)
static getLayouts(bool $a_active=false, int $a_module=0)
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
cancelDeletePg()
cancel deletion of Page Layout
This class represents a text area property in a property form.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
initPageLayoutImportForm()
Init page layout import form.
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
confirmedDeletePg()
conform deletion of Page Layout
Administration for page layouts.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...