4 include_once
"./classes/class.ilObjectGUI.php";
5 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
32 $cmd = $ilCtrl->getCmd();
34 if (
$cmd ==
"editPg") {
35 $this->peditor_active =
true;
38 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
40 $lng->loadLanguageModule(
"style");
48 $next_class = $this->ctrl->getNextClass($this);
49 $cmd = $this->ctrl->getCmd();
51 if ($next_class ==
"ilpagelayoutgui" ||
$cmd ==
"createPg") {
52 $this->peditor_active =
true;
59 case 'ilpermissiongui':
60 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
62 $ret =& $this->ctrl->forwardCommand($perm_gui);
65 case 'ilpagelayoutgui':
66 include_once(
"./Services/Style/classes/class.ilPageLayoutGUI.php");
67 $this->tpl->getStandardTemplate();
68 $this->ctrl->setReturn($this,
"edit");
69 if ($this->pg_id!=null) {
74 $layout_gui->setTabs();
75 $layout_gui->setEditPreview(
true);
76 $this->ctrl->saveParameter($this,
"obj_id");
77 $ret =& $this->ctrl->forwardCommand($layout_gui);
78 $this->tpl->setContent(
$ret);
84 $cmd =
"editBasicSettings";
119 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
121 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
124 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_basic_settings",
"tpl.stys_basic_settings.html");
127 $settings = $this->ilias->getAllSettings();
129 if ($rbacsystem->checkAccess(
"write", $this->object->getRefId()))
131 $this->tpl->setCurrentBlock(
"save_but");
132 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
133 $this->tpl->parseCurrentBlock();
136 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
138 $this->tpl->setVariable(
"TXT_TREE_FRAME", $this->lng->txt(
"tree_frame"));
139 $this->tpl->setVariable(
"TXT_TREE_FRAME_INFO", $this->lng->txt(
"tree_frame_info"));
140 $this->tpl->setVariable(
"TXT_FRAME_LEFT", $this->lng->txt(
"tree_left"));
141 $this->tpl->setVariable(
"TXT_FRAME_RIGHT", $this->lng->txt(
"tree_right"));
143 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"basic_settings"));
144 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS", $this->lng->txt(
"icons_in_typed_lists"));
145 $this->tpl->setVariable(
"TXT_ICONS_IN_HEADER", $this->lng->txt(
"icons_in_header"));
146 $this->tpl->setVariable(
"TXT_ICONS_IN_ITEM_ROWS", $this->lng->txt(
"icons_in_item_rows"));
147 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS_INFO", $this->lng->txt(
"icons_in_typed_lists_info"));
149 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS", $this->lng->txt(
"enable_custom_icons"));
150 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS_INFO", $this->lng->txt(
"enable_custom_icons_info"));
151 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_BIG", $this->lng->txt(
"custom_icon_size_big"));
152 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_SMALL", $this->lng->txt(
"custom_icon_size_standard"));
153 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_TINY", $this->lng->txt(
"custom_icon_size_tiny"));
154 $this->tpl->setVariable(
"TXT_WIDTH_X_HEIGHT", $this->lng->txt(
"width_x_height"));
157 if ($settings[
"tree_frame"] ==
"right")
159 $this->tpl->setVariable(
"SEL_FRAME_RIGHT",
"selected=\"selected\"");
163 $this->tpl->setVariable(
"SEL_FRAME_LEFT",
"selected=\"selected\"");
166 if ($settings[
"custom_icons"])
168 $this->tpl->setVariable(
"CHK_CUSTOM_ICONS",
"checked=\"checked\"");
178 $this->tpl->setVariable(
"CUST_ICON_BIG_WIDTH", $settings[
"custom_icon_big_width"]);
179 $this->tpl->setVariable(
"CUST_ICON_BIG_HEIGHT", $settings[
"custom_icon_big_height"]);
180 $this->tpl->setVariable(
"CUST_ICON_SMALL_WIDTH", $settings[
"custom_icon_small_width"]);
181 $this->tpl->setVariable(
"CUST_ICON_SMALL_HEIGHT", $settings[
"custom_icon_small_height"]);
182 $this->tpl->setVariable(
"CUST_ICON_TINY_WIDTH", $settings[
"custom_icon_tiny_width"]);
183 $this->tpl->setVariable(
"CUST_ICON_TINY_HEIGHT", $settings[
"custom_icon_tiny_height"]);
193 $this->ilias->setSetting(
"tree_frame",
$_POST[
"tree_frame"]);
195 $this->ilias->setSetting(
"custom_icons",
$_POST[
"custom_icons"]);
196 $this->ilias->setSetting(
"custom_icon_big_width", (
int)
$_POST[
"custom_icon_big_width"]);
197 $this->ilias->setSetting(
"custom_icon_big_height", (
int) $_POST[
"custom_icon_big_height"]);
198 $this->ilias->setSetting(
"custom_icon_small_width", (
int) $_POST[
"custom_icon_small_width"]);
199 $this->ilias->setSetting(
"custom_icon_small_height", (
int) $_POST[
"custom_icon_small_height"]);
200 $this->ilias->setSetting(
"custom_icon_tiny_width", (
int) $_POST[
"custom_icon_tiny_width"]);
201 $this->ilias->setSetting(
"custom_icon_tiny_height", (
int) $_POST[
"custom_icon_tiny_height"]);
203 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editBasicSettings",
"",
false,
false));
213 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
215 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
219 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
220 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
222 $from_styles = $to_styles =
$data = array();
223 $styles = $this->
object->getStyles();
225 foreach($styles as $style)
229 $data[$style[
"title"].
":".$style[
"id"]]
231 if ($style[
"lm_nr"] > 0)
233 $from_styles[$style[
"id"]] = $style[
"title"];
235 if ($style[
"active"] > 0)
237 $to_styles[$style[
"id"]] = $style[
"title"];
242 if ($fixed_style <= 0)
245 array(
"title" => $this->lng->txt(
"sty_individual_styles"),
247 $from_styles[-1] = $this->lng->txt(
"sty_individual_styles");
251 if ($default_style <= 0 && $fixed_style <= 0)
254 array(
"title" => $this->lng->txt(
"sty_default_style"),
256 $from_styles[0] = $this->lng->txt(
"sty_default_style");
257 $to_styles[0] = $this->lng->txt(
"sty_default_style");
260 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
262 $ilToolbar->addButton($lng->txt(
"sty_add_content_style"),
263 $ilCtrl->getLinkTarget($this,
"createStyle"));
264 $ilToolbar->addSeparator();
265 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
268 $si =
new ilSelectInputGUI($lng->txt(
"sty_move_lm_styles").
": ".$lng->txt(
"sty_from"),
"from_style");
270 $ilToolbar->addInputItem($si,
true);
275 $ilToolbar->addInputItem($si,
true);
276 $ilToolbar->addFormButton($lng->txt(
"sty_move_style"),
"moveLMStyles");
278 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
281 include_once(
"./Services/Style/classes/class.ilContentStylesTableGUI.php");
283 $tpl->setContent($table->getHTML());
292 if (
$_POST[
"from_style"] == -1)
298 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
300 $this->ctrl->redirect($this,
"editContentStyles");
309 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
311 $this->ctrl->redirect($this,
"editContentStyles");
321 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
323 $ilCtrl->setParameter($this,
"to_style",
$_POST[
"to_style"]);
326 $cgui->setFormAction($ilCtrl->getFormAction($this));
327 $cgui->setHeaderText($lng->txt(
"sty_confirm_del_ind_styles").
": ".
328 sprintf($this->lng->txt(
"sty_confirm_del_ind_styles_desc"),
330 $cgui->setCancel($lng->txt(
"cancel"),
"editContentStyles");
331 $cgui->setConfirm($lng->txt(
"ok"),
"moveIndividualStyles");
332 $tpl->setContent($cgui->getHTML());
340 global $rbacsystem,
$ilias, $styleDefinition;;
342 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
344 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
347 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_settings",
"tpl.stys_settings.html");
348 $this->tpl->setCurrentBlock(
"style_settings");
350 $settings = $this->ilias->getAllSettings();
352 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
354 $this->tpl->setCurrentBlock(
"save_but");
355 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
356 $this->tpl->parseCurrentBlock();
358 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
359 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"system_style_settings"));
360 $this->tpl->setVariable(
"TXT_DEFAULT_SKIN_STYLE", $this->lng->txt(
"default_skin_style"));
361 $this->tpl->setVariable(
"TXT_SKIN_STYLE_ACTIVATION", $this->lng->txt(
"style_activation"));
362 $this->tpl->setVariable(
"TXT_NUMBER_OF_USERS", $this->lng->txt(
"num_users"));
363 $this->tpl->setVariable(
"TXT_MOVE_USERS_TO_STYLE", $this->lng->txt(
"move_users_to_style"));
366 $templates = $styleDefinition->getAllTemplates();
368 $all_styles = array();
370 foreach ($templates as $template)
374 $styleDef->startParsing();
375 $styles = $styleDef->getStyles();
377 foreach ($styles as $style)
379 if ($this->ilias->ini->readVariable(
"layout",
"skin") == $template[
"id"] &&
380 $this->ilias->ini->readVariable(
"layout",
"style") == $style[
"id"])
382 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
386 $this->tpl->setCurrentBlock(
"selectskin");
387 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
388 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
389 $this->tpl->parseCurrentBlock();
392 foreach ($templates as $template2)
396 $styleDef2->startParsing();
397 $styles2 = $styleDef2->getStyles();
399 foreach ($styles2 as $style2)
403 $this->tpl->setCurrentBlock(
"move_to_skin");
404 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
405 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
406 $this->tpl->parseCurrentBlock();
412 $this->tpl->setCurrentBlock(
"activation_checkbox");
413 $this->tpl->setVariable(
"VAL_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
416 $this->tpl->setVariable(
"CHK_SKIN_STYLE",
" checked=\"1\" ");
418 $this->tpl->parseCurrentBlock();
421 $this->tpl->setCurrentBlock(
"style_activation");
422 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
423 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
424 $styleDef->getTemplateName().
" / ".$style[
"name"]);
426 $this->tpl->setVariable(
"VAL_NUM_USERS", $num_users);
427 $this->tpl->parseCurrentBlock();
429 $all_styles[] = $template[
"id"].
":".$style[
"id"];
438 $users_missing_styles = 0;
439 foreach($all_user_styles as $style)
441 if (!in_array($style, $all_styles))
443 $style_arr = explode(
":", $style);
448 if ($users_missing_styles > 0)
451 foreach ($templates as $template2)
455 $styleDef2->startParsing();
456 $styles2 = $styleDef2->getStyles();
458 foreach ($styles2 as $style2)
462 $this->tpl->setCurrentBlock(
"move_to_skin");
463 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
464 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
465 $this->tpl->parseCurrentBlock();
470 $this->tpl->setCurrentBlock(
"style_activation");
471 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
472 $this->lng->txt(
"other"));
473 $this->tpl->setVariable(
"VAL_NUM_USERS",
474 $users_missing_styles);
475 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE",
"other");
476 $this->tpl->parseCurrentBlock();
479 $this->tpl->parseCurrentBlock();
488 global $styleDefinition,
$ilCtrl;
491 if (count(
$_POST[
"st_act"]) < 1)
493 $this->ilias->raiseError($this->lng->txt(
"at_least_one_style"), $this->ilias->error_obj->MESSAGE);
498 $templates = $styleDefinition->getAllTemplates();
499 $all_styles = array();
500 foreach ($templates as $template)
504 $styleDef->startParsing();
505 $styles = $styleDef->getStyles();
506 foreach ($styles as $style)
508 if (!isset(
$_POST[
"st_act"][$template[
"id"].
":".$style[
"id"]]))
512 $this->ilias->raiseError($this->lng->txt(
"cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
523 $all_styles[] = $template[
"id"].
":".$style[
"id"];
528 foreach(
$_POST[
"move_users"] as $key => $value)
532 $to = explode(
":", $value);
536 $from = explode(
":", $key);
546 foreach($all_user_styles as $style)
548 if (!in_array($style, $all_styles))
550 $style_arr = explode(
":", $style);
559 if (
$_POST[
"default_skin_style"] !=
"")
561 $sknst = explode(
":",
$_POST[
"default_skin_style"]);
563 if ($this->ilias->ini->readVariable(
"layout",
"style") != $sknst[1] ||
564 $this->ilias->ini->readVariable(
"layout",
"skin") != $sknst[0])
566 $this->ilias->ini->setVariable(
"layout",
"skin", $sknst[0]);
567 $this->ilias->ini->setVariable(
"layout",
"style",$sknst[1]);
570 $this->ilias->ini->write();
573 $ilCtrl->redirect($this ,
"editSystemStyles");
585 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
591 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
598 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
601 $this->tpl->setCurrentBlock(
"table_header");
602 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
603 $this->tpl->parseCurrentBlock();
610 foreach (
$_POST[
"id"] as $id)
612 $this->tpl->setCurrentBlock(
"table_row");
616 $this->tpl->parseCurrentBlock();
622 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
623 "cancelDelete" => $this->lng->txt(
"cancel"));
624 foreach ($buttons as $name => $value)
626 $this->tpl->setCurrentBlock(
"operation_btn");
628 $this->tpl->setVariable(
"BTN_NAME",$name);
629 $this->tpl->setVariable(
"BTN_VALUE",$value);
630 $this->tpl->parseCurrentBlock();
644 $this->
object->removeStyle($id);
645 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
646 $style_obj->delete();
648 $this->
object->update();
651 $this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false)));
664 $ilSetting->delete(
"fixed_content_style_id");
665 $def_style = $ilSetting->get(
"default_content_style_id");
667 if ($def_style !=
$_GET[
"id"])
669 $ilSetting->set(
"default_content_style_id", (
int)
$_GET[
"id"]);
673 $ilSetting->delete(
"default_content_style_id");
677 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
689 $ilSetting->delete(
"default_content_style_id");
690 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
691 if ($fixed_style == (
int)
$_GET[
"id"])
693 $ilSetting->delete(
"fixed_content_style_id");
697 $ilSetting->set(
"fixed_content_style_id", (
int) $_GET[
"id"]);
701 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
710 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
711 $styles = $this->
object->getStyles();
712 foreach($styles as $style)
714 if (
$_POST[
"std_".$style[
"id"]] == 1)
723 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
736 $this->tpl->setCurrentBlock(
"tbl_action_btn");
737 $this->tpl->setVariable(
"BTN_NAME",
"deleteStyle");
738 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
739 $this->tpl->parseCurrentBlock();
742 $this->tpl->setCurrentBlock(
"tbl_action_btn");
743 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalDefault");
744 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
745 $this->tpl->parseCurrentBlock();
748 $this->tpl->setCurrentBlock(
"tbl_action_btn");
749 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalFixed");
750 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
751 $this->tpl->parseCurrentBlock();
754 $this->tpl->setCurrentBlock(
"tbl_action_btn");
755 $this->tpl->setVariable(
"BTN_NAME",
"setScope");
756 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_set_scope"));
757 $this->tpl->parseCurrentBlock();
760 $this->tpl->setCurrentBlock(
"tbl_action_btn");
761 $this->tpl->setVariable(
"BTN_NAME",
"saveActiveStyles");
762 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_save_active_styles"));
763 $this->tpl->parseCurrentBlock();
765 if ($with_subobjects ===
true)
770 $this->tpl->setCurrentBlock(
"tbl_action_row");
772 $this->tpl->parseCurrentBlock();
782 session_unregister(
"saved_post");
785 $this->ctrl->redirect($this,
"editContentStyles");
793 include_once (
"./Services/Style/classes/class.ilStyleScopeExplorer.php");
795 $exp->setExpandTarget(
"repository.php?cmd=showTree");
796 $exp->setTargetGet(
"ref_id");
798 $exp->forceExpandAll(
true,
false);
799 $exp->addFilter(
"root");
800 $exp->addFilter(
"cat");
802 if (
$_GET[
"expand"] ==
"")
804 $expanded = $this->tree->readRootId();
808 $expanded =
$_GET[
"expand"];
811 $exp->setExpand($expanded);
815 $output = $exp->getOutput();
818 $this->tpl->setVariable(
"ADM_CONTENT", $output);
828 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
829 if (
$_GET[
"cat"] == 0)
835 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
846 $ilTabs->setTabActive(
'page_layouts');
849 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
851 $ilToolbar->addButton($lng->txt(
"sty_add_pgl"),
852 $ilCtrl->getLinkTarget($this,
"addPageLayout"));
853 $ilToolbar->addButton($lng->txt(
"sty_import_page_layout"),
854 $ilCtrl->getLinkTarget($this,
"importPageLayoutForm"));
857 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/Style");
859 include_once(
"./Services/Style/classes/class.ilPageLayoutTableGUI.php");
861 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
862 $tpl->setContent($oa_tpl->get());
868 if (!isset(
$_POST[
"pglayout"]))
873 foreach (
$_POST[
"pglayout"] as $item)
876 $pg_layout->activate($a_activate);
879 $this->ctrl->redirect($this,
"viewPageLayouts");
895 if(!isset(
$_POST[
"pglayout"]))
897 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
900 $ilTabs->setTabActive(
'page_layouts');
906 $this->data[
"cols"] = array(
"type",
"title");
908 foreach(
$_POST[
"pglayout"] as $id)
911 $pg_obj->readObject();
912 $this->data[
"data"][
"$id"] = array(
914 "title" => $pg_obj->getTitle()
919 $this->data[
"buttons"] = array(
"cancelDeletePg" => $this->lng->txt(
"cancel"),
920 "confirmedDeletePg" => $this->lng->txt(
"confirm"));
926 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
929 foreach ($this->data[
"cols"] as $key)
931 $this->tpl->setCurrentBlock(
"table_header");
932 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
933 $this->tpl->parseCurrentBlock();
940 foreach($this->data[
"data"] as $key => $value)
943 foreach($value as $key => $cell_data)
945 $this->tpl->setCurrentBlock(
"table_cell");
954 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
956 $this->tpl->parseCurrentBlock();
959 $this->tpl->setCurrentBlock(
"table_row");
961 $this->tpl->parseCurrentBlock();
967 foreach($this->data[
"buttons"] as $name => $value)
969 $this->tpl->setCurrentBlock(
"operation_btn");
970 $this->tpl->setVariable(
"BTN_NAME",$name);
971 $this->tpl->setVariable(
"BTN_VALUE",$value);
972 $this->tpl->parseCurrentBlock();
982 session_unregister(
"pglayout_user_delete");
984 $this->ctrl->redirect($this,
"viewPageLayouts");
993 global
$ilDB, $ilUser;
995 foreach (
$_SESSION[
"pglayout_user_delete"] as $id)
1001 $this->ctrl->redirect($this,
"viewPageLayouts");
1008 $ilTabs->setTabActive(
'page_layouts');
1015 $this->tpl->setContent($a_form->getHTML());
1022 $lng->loadLanguageModule(
"content");
1024 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1026 $form_gui->setFormAction($ilCtrl->getFormAction($this));
1027 $form_gui->setTitle($lng->txt(
"sty_create_pgl"));
1029 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
1032 $title_input =
new ilTextInputGUI($lng->txt(
"title"),
"pgl_title");
1034 $title_input->setMaxLength(128);
1035 $title_input->setValue($this->layout_object->title);
1036 $title_input->setTitle($lng->txt(
"title"));
1037 $title_input->setRequired(
true);
1040 $desc_input->
setValue($this->layout_object->description);
1041 $desc_input->setRows(3);
1042 $desc_input->setCols(37);
1046 "0" => $lng->txt(
"cont_layout_template"),
1047 "1" => $lng->txt(
"cont_special_page"),
1058 $mods->addOption($mod);
1061 $ttype_input =
new ilSelectInputGUI($lng->txt(
"sty_based_on"),
"pgl_template");
1065 foreach ($arr_templates1 as $v)
1067 $arr_templates[] = $v;
1071 $options[
'-1'] = $lng->txt(
"none");
1073 foreach ($arr_templates as $templ) {
1074 $templ->readObject();
1075 $key = $templ->getId();
1076 $value = $templ->getTitle();
1077 $options[$key] = $value;
1080 $ttype_input->setOptions($options);
1081 $ttype_input->setValue(-1);
1082 $ttype_input->setRequired(
true);
1084 $desc_input->setTitle($lng->txt(
"description"));
1085 $desc_input->setRequired(
false);
1087 $form_gui->addItem($title_input);
1088 $form_gui->addItem($desc_input);
1089 $form_gui->addItem($si);
1090 $form_gui->addItem($mods);
1091 $form_gui->addItem($ttype_input);
1094 $form_gui->addCommandButton(
"createPg", $lng->txt(
"save"));
1095 $form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
1106 if(!$form_gui->checkInput())
1108 $form_gui->setValuesByPost();
1114 $pg_object->setTitle($form_gui->getInput(
'pgl_title'));
1115 $pg_object->setDescription($form_gui->getInput(
'pgl_desc'));
1116 $pg_object->setSpecialPage($form_gui->getInput(
'special_page'));
1117 $pg_object->setModules($form_gui->getInput(
'module'));
1118 $pg_object->update();
1120 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1123 if(!is_object($pg_content))
1128 $this->pg_content->setId($pg_object->getId());
1130 $tmpl = $form_gui->getInput(
'pgl_template');
1134 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
1135 $this->pg_content->create(
false);
1139 $this->pg_content->create(
false);
1142 $ilCtrl->setParameterByClass(
"ilpagelayoutgui",
"obj_id", $pg_object->getId());
1143 $ilCtrl->redirectByClass(
"ilpagelayoutgui",
"edit");
1154 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
1156 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1159 $ilCtrl->setCmdClass(
"ilpagelayoutgui");
1160 $ilCtrl->setCmd(
"edit");
1167 echo
"settings_setTabs";
1182 global $rbacsystem,
$lng, $ilTabs;
1184 if ($this->peditor_active) {
1185 $tabs_gui->setBackTarget($this->lng->txt(
"page_layouts"),
1186 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"));
1189 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()) && !$this->peditor_active)
1191 $tabs_gui->addTarget(
"basic_settings",
1192 $this->ctrl->getLinkTarget($this,
"editBasicSettings"), array(
"editBasicSettings",
"",
"view"),
"",
"");
1194 $tabs_gui->addTarget(
"system_styles",
1195 $this->ctrl->getLinkTarget($this,
"editSystemStyles"),
"editSystemStyles",
"",
"");
1197 $tabs_gui->addTarget(
"content_styles",
1198 $this->ctrl->getLinkTarget($this,
"editContentStyles"),
"editContentStyles",
"",
"");
1200 $tabs_gui->addTarget(
"page_layouts",
1201 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"),
"viewPageLayouts",
"",
"");
1206 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()) && !$this->peditor_active)
1208 $tabs_gui->addTarget(
"perm_settings",
1209 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1220 $ilCtrl->setParameter($this,
"new_type",
"sty");
1221 $ilCtrl->redirect($this,
"create");
1231 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
1233 if (is_array(
$_POST[
"type"]))
1235 foreach(
$_POST[
"type"] as $id =>
$t)
1241 $l->setSpecialPage(
$t);
1242 if(is_array(
$_POST[
"module"][$id]))
1244 $l->setModules(array_keys(
$_POST[
"module"][$id]));
1257 $ilCtrl->redirect($this,
"viewPageLayouts");
1266 include_once(
"./Services/Export/classes/class.ilExport.php");
1272 $succ = $exp->exportEntity(
"pgtp", (
int)
$_GET[
"layout_id"],
"4.2.0",
1273 "Services/COPage",
"Title", $tmpdir);
1275 if ($succ[
"success"])
1278 "",
false,
false,
false);
1280 if (is_file($succ[
"directory"].
"/".$succ[
"file"]))
1282 unlink($succ[
"directory"].
"/".$succ[
"file"]);
1284 if (is_dir($succ[
"directory"]))
1286 unlink($succ[
"directory"]);
1295 global
$tpl, $ilTabs;
1297 $ilTabs->setTabActive(
'page_layouts');
1299 $tpl->setContent($form->getHTML());
1309 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1315 $fi->setRequired(
true);
1316 $form->addItem($fi);
1318 $form->addCommandButton(
"importPageLayout", $lng->txt(
"import"));
1319 $form->addCommandButton(
"viewPageLayouts", $lng->txt(
"cancel"));
1321 $form->setTitle($lng->txt(
"sty_import_page_layout"));
1322 $form->setFormAction($ilCtrl->getFormAction($this));
1335 if ($form->checkInput())
1337 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
1343 $ilCtrl->redirect($this,
"viewPageLayouts");
1347 $ilTabs->setTabActive(
'page_layouts');
1348 $form->setValuesByPost();
1349 $tpl->setContent($form->getHtml());