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") {
85 switch ($next_class) {
86 case 'ilpagelayoutgui':
87 $this->tabs->clearTargets();
88 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutGUI.php");
91 $this->tabs->setBackTarget(
92 $this->lng->txt(
"page_layouts"),
93 $this->ctrl->getLinkTarget($this,
"listLayouts")
96 $this->ctrl->setReturn($this,
"listLayouts");
97 if ($this->pg_id != null) {
102 $layout_gui->setTabs();
103 $layout_gui->setEditPreview(
true);
104 $this->ctrl->saveParameter($this,
"obj_id");
105 $ret = $this->ctrl->forwardCommand($layout_gui);
106 $this->tpl->setContent(
$ret);
110 if (in_array($cmd, array(
"listLayouts",
"editPg",
"addPageLayout",
"cancelCreate",
"createPg",
"exportLayout",
111 "savePageLayoutTypes",
"activate",
"deactivate",
"importPageLayoutForm",
"deletePgl",
"cancelDeletePg",
112 "confirmedDeletePg",
"importPageLayout"))) {
115 die(
"Unknown command " . $cmd);
129 if (!$this->rbacsystem->checkAccess($a_perm, $this->ref_id)) {
131 include_once
"Services/Object/exceptions/class.ilObjectException.php";
146 $this->toolbar->addButton(
147 $this->lng->txt(
"sty_add_pgl"),
148 $this->ctrl->getLinkTarget($this,
"addPageLayout")
150 $this->toolbar->addButton(
151 $this->lng->txt(
"sty_import_page_layout"),
152 $this->ctrl->getLinkTarget($this,
"importPageLayoutForm")
156 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/COPage/Layout");
158 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutTableGUI.php");
160 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
161 $this->tpl->setContent($oa_tpl->get());
171 if (!isset(
$_POST[
"pglayout"])) {
174 ilUtil::sendSuccess($this->lng->txt(
"sty_opt_saved"),
true);
175 foreach (
$_POST[
"pglayout"] as $item) {
177 $pg_layout->activate($a_activate);
180 $this->ctrl->redirect($this,
"listLayouts");
196 if (!isset(
$_POST[
"pglayout"])) {
198 $this->ctrl->redirect($this,
"listLayouts");
204 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
206 $cgui->setFormAction($this->ctrl->getFormAction($this));
207 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
208 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeletePg");
209 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmedDeletePg");
213 $pg_obj->readObject();
216 " " . $pg_obj->getTitle();
218 $cgui->addItem(
"pglayout[]", $id, $caption);
221 $this->tpl->setContent($cgui->getHTML());
230 $this->ctrl->redirect($this,
"listLayouts");
243 $this->ctrl->redirect($this,
"listLayouts");
255 $this->tpl->setContent($a_form->getHTML());
263 $this->lng->loadLanguageModule(
"content");
265 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
267 $form_gui->setFormAction($this->ctrl->getFormAction($this));
268 $form_gui->setTitle($this->lng->txt(
"sty_create_pgl"));
270 $title_input =
new ilTextInputGUI($this->lng->txt(
"title"),
"pgl_title");
272 $title_input->setMaxLength(128);
273 $title_input->setValue($this->layout_object->title);
274 $title_input->setTitle($this->lng->txt(
"title"));
275 $title_input->setRequired(
true);
278 $desc_input->
setValue($this->layout_object->description);
279 $desc_input->setRows(3);
280 $desc_input->setCols(37);
284 "0" => $this->lng->txt(
"cont_layout_template"),
285 "1" => $this->lng->txt(
"cont_special_page"),
295 $mods->addOption($mod);
298 $ttype_input =
new ilSelectInputGUI($this->lng->txt(
"sty_based_on"),
"pgl_template");
302 foreach ($arr_templates1 as $v) {
303 $arr_templates[] = $v;
307 $options[
'-1'] = $this->lng->txt(
"none");
309 foreach ($arr_templates as $templ) {
310 $templ->readObject();
311 $key = $templ->getId();
312 $value = $templ->getTitle();
317 $ttype_input->setValue(-1);
318 $ttype_input->setRequired(
true);
320 $desc_input->setTitle($this->lng->txt(
"description"));
321 $desc_input->setRequired(
false);
323 $form_gui->addItem($title_input);
324 $form_gui->addItem($desc_input);
325 $form_gui->addItem($si);
326 $form_gui->addItem($mods);
327 $form_gui->addItem($ttype_input);
330 $form_gui->addCommandButton(
"createPg", $this->lng->txt(
"save"));
331 $form_gui->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
340 if (!$form_gui->checkInput()) {
341 $form_gui->setValuesByPost();
348 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
349 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
350 $pg_object->setSpecialPage($form_gui->getInput(
'special_page'));
351 $pg_object->setModules($form_gui->getInput(
'module'));
352 $pg_object->update();
354 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayoutPage.php");
357 if (!is_object($pg_content)) {
361 $this->pg_content->setId($pg_object->getId());
363 $tmpl = $form_gui->getInput(
'pgl_template');
366 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
367 $this->pg_content->create(
false);
369 $this->pg_content->create(
false);
372 $this->ctrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
373 $this->ctrl->redirectByClass(
"ilpagelayoutgui",
"edit");
391 $this->ctrl->setCmdClass(
"ilpagelayoutgui");
392 $this->ctrl->setCmd(
"edit");
404 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
406 if (is_array(
$_POST[
"type"])) {
411 $l->setSpecialPage(
$t);
413 $l->setModules(array_keys(
$_POST[
"module"][$id]));
421 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"));
424 $this->ctrl->redirect($this,
"listLayouts");
433 include_once(
"./Services/Export/classes/class.ilExport.php");
439 $succ = $exp->exportEntity(
441 (
int)
$_GET[
"layout_id"],
448 if ($succ[
"success"]) {
450 $succ[
"directory"] .
"/" . $succ[
"file"],
458 if (is_file($succ[
"directory"] .
"/" . $succ[
"file"])) {
459 unlink($succ[
"directory"] .
"/" . $succ[
"file"]);
461 if (is_dir($succ[
"directory"])) {
462 unlink($succ[
"directory"]);
472 $this->tpl->setContent(
$form->getHTML());
480 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
486 $fi->setRequired(
true);
489 $form->addCommandButton(
"importPageLayout", $this->lng->txt(
"import"));
490 $form->addCommandButton(
"listLayouts", $this->lng->txt(
"cancel"));
492 $form->setTitle($this->lng->txt(
"sty_import_page_layout"));
493 $form->setFormAction($this->ctrl->getFormAction($this));
504 if (
$form->checkInput()) {
505 include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
508 ilUtil::sendSuccess($this->lng->txt(
"sty_imported_layout"),
true);
510 $this->ctrl->redirect($this,
"listLayouts");
512 $form->setValuesByPost();
513 $this->tpl->setContent(
$form->getHtml());
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.
if(!array_key_exists('StateId', $_REQUEST)) $id
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(isset($_POST['submit'])) $form
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 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)
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.
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.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.