49 $this->
ctrl = $DIC->ctrl();
50 $this->rbacsystem =
$DIC->rbac()->system();
51 $this->
toolbar = $DIC->toolbar();
52 $this->
lng = $DIC->language();
53 $this->tpl =
$DIC[
"tpl"];
54 $this->
tabs = $DIC->tabs();
55 $this->
lng->loadLanguageModule(
"style");
58 $this->admin_request =
$DIC
64 $this->ref_id = $this->admin_request->getRefId();
65 $this->export_handler =
new ilExportHandler();
70 $next_class = $this->
ctrl->getNextClass($this);
71 $cmd = $this->
ctrl->getCmd(
"listLayouts");
73 if ($cmd ==
"listLayouts") {
79 switch ($next_class) {
80 case 'ilpagelayoutgui':
81 $this->
tabs->clearTargets();
82 $this->
tabs->setBackTarget(
83 $this->
lng->txt(
"page_layouts"),
84 $this->ctrl->getLinkTarget($this,
"listLayouts")
87 $this->
ctrl->setReturn($this,
"listLayouts");
88 if ($this->pg_id !=
null) {
93 $this->admin_request->getObjId()
96 $layout_gui->setTabs();
97 $layout_gui->setEditPreview(
true);
98 $this->
ctrl->saveParameter($this,
"obj_id");
99 $ret = $this->
ctrl->forwardCommand($layout_gui);
101 $this->tpl->setContent($ret);
106 if (in_array($cmd, array(
"listLayouts",
"editPg",
"addPageLayout",
"cancelCreate",
"createPg",
"exportLayout",
107 "activate",
"deactivate",
"importPageLayoutForm",
"deletePgl",
"cancelDeletePg",
108 "confirmedDeletePg",
"importPageLayout"))) {
111 die(
"Unknown command " . $cmd);
122 bool $a_throw_exc =
true
124 if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id)) {
136 if ($this->checkPermission(
"sty_write_page_layout",
false)) {
138 $this->
lng->txt(
"sty_add_pgl"),
139 $this->ctrl->getLinkTarget($this,
"addPageLayout")
142 $this->
lng->txt(
"sty_import_page_layout"),
143 $this->ctrl->getLinkTarget($this,
"importPageLayoutForm")
147 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"components/ILIAS/COPage/Layout");
150 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
151 $this->tpl->setContent($oa_tpl->get());
155 bool $a_activate =
true
157 $ids = $this->admin_request->getLayoutIds();
158 if (count($ids) == 0) {
159 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
161 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_opt_saved"),
true);
162 foreach ($ids as $item) {
164 $pg_layout->activate($a_activate);
167 $this->
ctrl->redirect($this,
"listLayouts");
172 $this->activate(
false);
180 $ids = $this->admin_request->getLayoutIds();
181 if (count($ids) == 0) {
182 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
183 $this->
ctrl->redirect($this,
"listLayouts");
190 $cgui->setFormAction($this->
ctrl->getFormAction($this));
191 $cgui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
192 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelDeletePg");
193 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"confirmedDeletePg");
195 foreach ($ids as
$id) {
197 $pg_obj->readObject();
199 $caption = $pg_obj->getTitle();
201 $cgui->addItem(
"pglayout[]",
$id, $caption);
204 $this->tpl->setContent($cgui->getHTML());
212 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"msg_cancel"),
true);
213 $this->
ctrl->redirect($this,
"listLayouts");
221 $ids = $this->admin_request->getLayoutIds();
222 foreach ($ids as
$id) {
227 $this->
ctrl->redirect($this,
"listLayouts");
233 $a_form = $this->initAddPageLayoutForm();
235 $this->tpl->setContent($a_form->getHTML());
240 $this->
lng->loadLanguageModule(
"content");
241 $this->
lng->loadLanguageModule(
"copg");
244 $form_gui->setFormAction($this->
ctrl->getFormAction($this));
245 $form_gui->setTitle($this->
lng->txt(
"sty_create_pgl"));
248 $title_input->setSize(50);
249 $title_input->setMaxLength(128);
251 $title_input->setTitle($this->
lng->txt(
"title"));
252 $title_input->setRequired(
true);
256 $desc_input->setRows(3);
257 $desc_input->setCols(37);
265 $mods->addOption($mod);
272 foreach ($arr_templates1 as $v) {
273 $arr_templates[] = $v;
279 foreach ($arr_templates as $templ) {
280 $templ->readObject();
281 $key = $templ->getId();
282 $value = $templ->getTitle();
287 $ttype_input->setValue(-1);
288 $ttype_input->setRequired(
true);
290 $desc_input->setTitle($this->
lng->txt(
"description"));
291 $desc_input->setRequired(
false);
293 $form_gui->addItem($title_input);
294 $form_gui->addItem($desc_input);
295 $form_gui->addItem($mods);
296 $form_gui->addItem($ttype_input);
299 $form_gui->addCommandButton(
"createPg", $this->
lng->txt(
"save"));
300 $form_gui->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
308 $form_gui = $this->initAddPageLayoutForm();
309 if (!$form_gui->checkInput()) {
310 $form_gui->setValuesByPost();
311 $this->addPageLayout($form_gui);
317 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
318 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
319 $pg_object->setModules($form_gui->getInput(
'module'));
320 $pg_object->update();
327 $this->pg_content->setId($pg_object->getId());
329 $tmpl = $form_gui->getInput(
'pgl_template');
332 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
334 $this->pg_content->create(
false);
336 $this->
ctrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
337 $this->
ctrl->redirectByClass(
"ilpagelayoutgui",
"edit");
342 $this->listLayouts();
347 $this->checkPermission(
"sty_write_page_layout");
349 $this->
ctrl->saveParameterByClass(ilPageLayoutGUI::class,
"obj_id");
350 $this->
ctrl->redirectByClass(ilPageLayoutGUI::class,
"edit");
351 $this->executeCommand();
364 $exp->setExportConfigs($this->export_handler->consumer()->exportConfig()->allExportConfigs());
365 $succ = $exp->exportEntity(
367 $this->admin_request->getObjId(),
369 "components/ILIAS/COPage",
374 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
376 $succ[
"directory"] .
"/" . $succ[
"file"],
384 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
385 unlink($succ[
"directory"] .
"/" . $succ[
"file"]);
387 if (is_dir($succ[
"directory"])) {
397 $form = $this->initPageLayoutImportForm();
398 $this->tpl->setContent($form->getHTML());
410 $fi->setSuffixes(array(
"zip"));
411 $fi->setRequired(
true);
414 $form->addCommandButton(
"importPageLayout", $this->
lng->txt(
"import"));
415 $form->addCommandButton(
"listLayouts", $this->
lng->txt(
"cancel"));
417 $form->setTitle($this->
lng->txt(
"sty_import_page_layout"));
418 $form->setFormAction($this->
ctrl->getFormAction($this));
428 $form = $this->initPageLayoutImportForm();
429 if ($form->checkInput()) {
431 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_imported_layout"),
true);
432 $this->
ctrl->redirect($this,
"listLayouts");
434 $form->setValuesByPost();
435 $this->tpl->setContent($form->getHTML());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Customizing of pimple-DIC for ILIAS.
Provides fluid interface to RBAC services.
This class represents an option in a checkbox group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
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 makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
Base exception class for object service.
Administration for page layouts.
ilPageLayoutPage $pg_content
initPageLayoutImportForm()
Init page layout import form.
cancelDeletePg()
cancel deletion of Page Layout
ilExportHandler $export_handler
importPageLayoutForm()
Import page layout.
activate(bool $a_activate=true)
confirmedDeletePg()
conform deletion of Page Layout
importPageLayout()
Import page layout.
addPageLayout(?ilPropertyFormGUI $a_form=null)
ilContentStyleSettings $settings
deletePgl()
display deletion confirmation screen
exportLayout()
Export page layout template object.
ilGlobalTemplateInterface $tpl
checkPermission(string $a_perm, bool $a_throw_exc=true)
Check permission.
AdministrationGUIRequest $admin_request
Class ilPageLayoutGUI GUI class.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static import(string $a_filename, string $a_filepath)
Import page layout.
static getLayouts(bool $a_active=false, int $a_module=0)
static getAvailableModules()
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
if(!file_exists('../ilias.ini.php'))