58 $this->ctrl = $DIC->ctrl();
59 $this->rbacsystem = $DIC->rbac()->system();
60 $this->toolbar = $DIC->toolbar();
61 $this->lng = $DIC->language();
62 $this->tpl = $DIC[
"tpl"];
63 $this->ref_id = (int)
$_GET[
"ref_id"];
64 $this->tabs = $DIC[
"ilTabs"];
67 include_once(
"./Services/Style/Content/classes/class.ilContentStyleSettings.php");
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd(
"listLayouts");
79 if (
$cmd ==
"listLayouts")
90 case 'ilpagelayoutgui':
91 $this->tabs->clearTargets();
92 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutGUI.php");
95 $this->tabs->setBackTarget($this->lng->txt(
"page_layouts"),
96 $this->ctrl->getLinkTarget($this,
"listLayouts"));
98 $this->ctrl->setReturn($this,
"listLayouts");
99 if ($this->pg_id!=null) {
104 $layout_gui->setTabs();
105 $layout_gui->setEditPreview(
true);
106 $this->ctrl->saveParameter($this,
"obj_id");
107 $ret = $this->ctrl->forwardCommand($layout_gui);
108 $this->tpl->setContent(
$ret);
112 if (in_array(
$cmd,
array(
"listLayouts",
"editPg",
"addPageLayout",
"cancelCreate",
"createPg",
"exportLayout",
113 "savePageLayoutTypes",
"activate",
"deactivate",
"importPageLayoutForm",
"deletePgl",
"cancelDeletePg",
114 "confirmedDeletePg",
"importPageLayout")))
120 die(
"Unknown command ".
$cmd);
134 if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id))
138 include_once
"Services/Object/exceptions/class.ilObjectException.php";
154 $this->toolbar->addButton($this->lng->txt(
"sty_add_pgl"),
155 $this->ctrl->getLinkTarget($this,
"addPageLayout"));
156 $this->toolbar->addButton($this->lng->txt(
"sty_import_page_layout"),
157 $this->ctrl->getLinkTarget($this,
"importPageLayoutForm"));
160 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/COPage/Layout");
162 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutTableGUI.php");
164 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
165 $this->tpl->setContent($oa_tpl->get());
176 if (!isset(
$_POST[
"pglayout"]))
183 foreach (
$_POST[
"pglayout"] as $item)
186 $pg_layout->activate($a_activate);
189 $this->ctrl->redirect($this,
"listLayouts");
205 if(!isset(
$_POST[
"pglayout"]))
208 $this->ctrl->redirect($this,
"listLayouts");
214 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
216 $cgui->setFormAction($this->ctrl->getFormAction($this));
217 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
218 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeletePg");
219 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmedDeletePg");
221 foreach(
$_POST[
"pglayout"] as $id)
224 $pg_obj->readObject();
227 " ".$pg_obj->getTitle();
229 $cgui->addItem(
"pglayout[]", $id, $caption);
232 $this->tpl->setContent($cgui->getHTML());
241 $this->ctrl->redirect($this,
"listLayouts");
249 foreach (
$_POST[
"pglayout"] as $id)
255 $this->ctrl->redirect($this,
"listLayouts");
268 $this->tpl->setContent($a_form->getHTML());
276 $this->lng->loadLanguageModule(
"content");
278 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
280 $form_gui->setFormAction($this->ctrl->getFormAction($this));
281 $form_gui->setTitle($this->lng->txt(
"sty_create_pgl"));
283 $title_input =
new ilTextInputGUI($this->lng->txt(
"title"),
"pgl_title");
285 $title_input->setMaxLength(128);
286 $title_input->setValue($this->layout_object->title);
287 $title_input->setTitle($this->lng->txt(
"title"));
288 $title_input->setRequired(
true);
291 $desc_input->
setValue($this->layout_object->description);
292 $desc_input->setRows(3);
293 $desc_input->setCols(37);
297 "0" => $this->lng->txt(
"cont_layout_template"),
298 "1" => $this->lng->txt(
"cont_special_page"),
309 $mods->addOption($mod);
312 $ttype_input =
new ilSelectInputGUI($this->lng->txt(
"sty_based_on"),
"pgl_template");
316 foreach ($arr_templates1 as $v)
318 $arr_templates[] = $v;
322 $options[
'-1'] = $this->lng->txt(
"none");
324 foreach ($arr_templates as $templ) {
325 $templ->readObject();
326 $key = $templ->getId();
327 $value = $templ->getTitle();
332 $ttype_input->setValue(-1);
333 $ttype_input->setRequired(
true);
335 $desc_input->setTitle($this->lng->txt(
"description"));
336 $desc_input->setRequired(
false);
338 $form_gui->addItem($title_input);
339 $form_gui->addItem($desc_input);
340 $form_gui->addItem($si);
341 $form_gui->addItem($mods);
342 $form_gui->addItem($ttype_input);
345 $form_gui->addCommandButton(
"createPg", $this->lng->txt(
"save"));
346 $form_gui->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
355 if(!$form_gui->checkInput())
357 $form_gui->setValuesByPost();
364 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
365 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
366 $pg_object->setSpecialPage($form_gui->getInput(
'special_page'));
367 $pg_object->setModules($form_gui->getInput(
'module'));
368 $pg_object->update();
370 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutPage.php");
373 if(!is_object($pg_content))
378 $this->pg_content->setId($pg_object->getId());
380 $tmpl = $form_gui->getInput(
'pgl_template');
384 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
385 $this->pg_content->create(
false);
389 $this->pg_content->create(
false);
392 $this->ctrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
393 $this->ctrl->redirectByClass(
"ilpagelayoutgui",
"edit");
411 $this->ctrl->setCmdClass(
"ilpagelayoutgui");
412 $this->ctrl->setCmd(
"edit");
423 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
425 if (is_array(
$_POST[
"type"]))
427 foreach(
$_POST[
"type"] as $id =>
$t)
433 $l->setSpecialPage(
$t);
434 if(is_array(
$_POST[
"module"][$id]))
436 $l->setModules(array_keys(
$_POST[
"module"][$id]));
449 $this->ctrl->redirect($this,
"listLayouts");
458 include_once(
"./Services/Export/classes/class.ilExport.php");
464 $succ = $exp->exportEntity(
"pgtp", (
int)
$_GET[
"layout_id"],
"4.2.0",
465 "Services/COPage",
"Title", $tmpdir);
467 if ($succ[
"success"])
470 "",
false,
false,
false);
472 if (is_file($succ[
"directory"].
"/".$succ[
"file"]))
474 unlink($succ[
"directory"].
"/".$succ[
"file"]);
476 if (is_dir($succ[
"directory"]))
478 unlink($succ[
"directory"]);
488 $this->tpl->setContent($form->getHTML());
496 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
502 $fi->setRequired(
true);
505 $form->addCommandButton(
"importPageLayout", $this->lng->txt(
"import"));
506 $form->addCommandButton(
"listLayouts", $this->lng->txt(
"cancel"));
508 $form->setTitle($this->lng->txt(
"sty_import_page_layout"));
509 $form->setFormAction($this->ctrl->getFormAction($this));
520 if ($form->checkInput())
522 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
528 $this->ctrl->redirect($this,
"listLayouts");
532 $form->setValuesByPost();
533 $this->tpl->setContent($form->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
exportLayout()
Export page layout template object.
This class represents an option in a checkbox group.
importPageLayout()
Import page layout.
__construct()
Constructor.
Class ilPageLayoutGUI GUI class.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
savePageLayoutTypes()
Save page layout types.
deletePgl()
display deletion confirmation screen
Base exception class for object service.
setValue($a_value)
Set Value.
executeCommand()
Execute command.
activate($a_activate=true)
Activate layout.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addPageLayout($a_form=null)
if(!is_array($argv)) $options
importPageLayoutForm()
Import page layout.
static import($a_filename, $a_filepath)
Import page layout.
TableGUI class for page layouts.
static getLayouts($a_active=false, $a_special_page=false, $a_module=null)
Get layouts.
special template class to simplify handling of ITX/PEAR
cancelCreate()
Cancel creation.
static getAvailableModules()
setSize($a_size)
Set Size.
deactivate()
Deactivate layout.
This class represents a text property in a property form.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
listLayouts()
view list of page layouts
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
cancelDeletePg()
cancel deletion of Page Layout
This class represents a text area property in a property form.
checkPermission($a_perm, $a_throw_exc=true)
Check permission.
initPageLayoutImportForm()
Init page layout import form.
confirmedDeletePg()
conform deletion of Page Layout
Administration for page layouts.
Confirmation screen class.