31 protected \ILIAS\COPage\Layout\GUIService
$gui;
50 $this->
ctrl = $DIC->ctrl();
51 $this->rbacsystem =
$DIC->rbac()->system();
52 $this->
toolbar = $DIC->toolbar();
53 $this->
lng = $DIC->language();
54 $this->tpl =
$DIC[
"tpl"];
55 $this->
tabs = $DIC->tabs();
56 $this->
lng->loadLanguageModule(
"style");
57 $this->gui =
$DIC->copage()->internal()->gui()->layout();
60 $this->admin_request =
$DIC
66 $this->ref_id = $this->admin_request->getRefId();
67 $this->export_handler =
new ilExportHandler();
72 $next_class = $this->
ctrl->getNextClass($this);
73 $cmd = $this->
ctrl->getCmd(
"listLayouts");
75 if ($cmd ==
"listLayouts") {
81 switch ($next_class) {
82 case 'ilpagelayoutgui':
83 $this->
tabs->clearTargets();
84 $this->
tabs->setBackTarget(
85 $this->
lng->txt(
"page_layouts"),
86 $this->ctrl->getLinkTarget($this,
"listLayouts")
89 $this->
ctrl->setReturn($this,
"listLayouts");
90 if ($this->pg_id !=
null) {
95 $this->admin_request->getObjId()
98 $layout_gui->setTabs();
99 $layout_gui->setEditPreview(
true);
100 $this->
ctrl->saveParameter($this,
"obj_id");
101 $ret = $this->
ctrl->forwardCommand($layout_gui);
103 $this->tpl->setContent($ret);
108 if (in_array($cmd, array(
"listLayouts",
"editPg",
"addPageLayout",
"cancelCreate",
"createPg",
"exportLayout",
109 "activate",
"deactivate",
"importPageLayoutForm",
"deletePgl",
"cancelDeletePg",
110 "confirmedDeletePg",
"importPageLayout"))) {
113 die(
"Unknown command " . $cmd);
124 bool $a_throw_exc =
true
126 if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id)) {
137 return $this->gui->pageLayoutTableBuilder(
146 if ($this->checkPermission(
"sty_write_page_layout",
false)) {
148 $this->
lng->txt(
"sty_add_pgl"),
149 $this->ctrl->getLinkTarget($this,
"addPageLayout")
152 $this->
lng->txt(
"sty_import_page_layout"),
153 $this->ctrl->getLinkTarget($this,
"importPageLayoutForm")
157 $table = $this->getTable();
158 if ($table->handleCommand()) {
162 $this->tpl->setContent($table->render());
167 bool $a_activate =
true
169 if (count($ids) == 0) {
170 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
172 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_opt_saved"),
true);
173 foreach ($ids as $item) {
175 $pg_layout->activate($a_activate);
178 $this->
ctrl->redirect($this,
"listLayouts");
183 $this->activate($ids,
false);
191 if (count($ids) == 0) {
192 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
193 $this->
ctrl->redirect($this,
"listLayouts");
196 $table = $this->getTable();
199 foreach ($ids as
$id) {
201 $pg_obj->readObject();
202 $items[
$id] = $pg_obj->getTitle();
205 $table->renderDeletionConfirmation(
206 $this->
lng->txt(
"info_delete_sure"),
207 $this->lng->txt(
"info_delete_sure"),
218 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"msg_cancel"),
true);
219 $this->
ctrl->redirect($this,
"listLayouts");
227 $ids = $this->getTable()->getItemIds();
228 foreach ($ids as
$id) {
233 $this->
ctrl->redirect($this,
"listLayouts");
239 $a_form = $this->initAddPageLayoutForm();
241 $this->tpl->setContent($a_form->getHTML());
246 $this->
lng->loadLanguageModule(
"content");
247 $this->
lng->loadLanguageModule(
"copg");
250 $form_gui->setFormAction($this->
ctrl->getFormAction($this));
251 $form_gui->setTitle($this->
lng->txt(
"sty_create_pgl"));
254 $title_input->setSize(50);
255 $title_input->setMaxLength(128);
257 $title_input->setTitle($this->
lng->txt(
"title"));
258 $title_input->setRequired(
true);
262 $desc_input->setRows(3);
263 $desc_input->setCols(37);
271 $mods->addOption($mod);
278 foreach ($arr_templates1 as $v) {
279 $arr_templates[] = $v;
285 foreach ($arr_templates as $templ) {
286 $templ->readObject();
287 $key = $templ->getId();
288 $value = $templ->getTitle();
293 $ttype_input->setValue(-1);
294 $ttype_input->setRequired(
true);
296 $desc_input->setTitle($this->
lng->txt(
"description"));
297 $desc_input->setRequired(
false);
299 $form_gui->addItem($title_input);
300 $form_gui->addItem($desc_input);
301 $form_gui->addItem($mods);
302 $form_gui->addItem($ttype_input);
305 $form_gui->addCommandButton(
"createPg", $this->
lng->txt(
"save"));
306 $form_gui->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
314 $form_gui = $this->initAddPageLayoutForm();
315 if (!$form_gui->checkInput()) {
316 $form_gui->setValuesByPost();
317 $this->addPageLayout($form_gui);
323 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
324 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
325 $pg_object->setModules($form_gui->getInput(
'module'));
326 $pg_object->update();
333 $this->pg_content->setId($pg_object->getId());
335 $tmpl = $form_gui->getInput(
'pgl_template');
338 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
340 $this->pg_content->create(
false);
342 $this->
ctrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
343 $this->
ctrl->redirectByClass(
"ilpagelayoutgui",
"edit");
348 $this->listLayouts();
353 $this->checkPermission(
"sty_write_page_layout");
355 $this->
ctrl->setParameterByClass(ilPageLayoutGUI::class,
"obj_id",
$id);
356 $this->
ctrl->redirectByClass(ilPageLayoutGUI::class,
"edit");
357 $this->executeCommand();
370 $exp->setExportConfigs($this->export_handler->consumer()->exportConfig()->allExportConfigs());
371 $succ = $exp->exportEntity(
375 "components/ILIAS/COPage",
380 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
382 $succ[
"directory"] .
"/" . $succ[
"file"],
390 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
391 unlink($succ[
"directory"] .
"/" . $succ[
"file"]);
393 if (is_dir($succ[
"directory"])) {
403 $form = $this->initPageLayoutImportForm();
404 $this->tpl->setContent($form->getHTML());
416 $fi->setSuffixes(array(
"zip"));
417 $fi->setRequired(
true);
420 $form->addCommandButton(
"importPageLayout", $this->
lng->txt(
"import"));
421 $form->addCommandButton(
"listLayouts", $this->
lng->txt(
"cancel"));
423 $form->setTitle($this->
lng->txt(
"sty_import_page_layout"));
424 $form->setFormAction($this->
ctrl->getFormAction($this));
434 $form = $this->initPageLayoutImportForm();
435 if ($form->checkInput()) {
437 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"sty_imported_layout"),
true);
438 $this->
ctrl->redirect($this,
"listLayouts");
440 $form->setValuesByPost();
441 $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.
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.
deletePgl(array $ids)
display deletion confirmation screen
activate(array $ids, bool $a_activate=true)
ilPageLayoutPage $pg_content
initPageLayoutImportForm()
Init page layout import form.
cancelDeletePg()
cancel deletion of Page Layout
ilExportHandler $export_handler
importPageLayoutForm()
Import page layout.
confirmedDeletePg()
conform deletion of Page Layout
importPageLayout()
Import page layout.
addPageLayout(?ilPropertyFormGUI $a_form=null)
ILIAS COPage Layout GUIService $gui
ilContentStyleSettings $settings
exportLayout(int $id)
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...
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...
This class represents a text area property in a property form.
This class represents a text property in a property form.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))