15 include_once
"./classes/class.ilObjectGUI.php";
16 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
38 $cmd = $ilCtrl->getCmd();
40 if (
$cmd ==
"editPg") {
41 $this->peditor_active =
true;
44 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
46 $lng->loadLanguageModule(
"style");
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd();
54 if ($next_class ==
"ilpagelayoutgui" ||
$cmd ==
"createPg") {
55 $this->peditor_active =
true;
63 case 'ilpermissiongui':
64 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
66 $ret =& $this->ctrl->forwardCommand($perm_gui);
69 case 'ilpagelayoutgui':
70 include_once(
"./Services/Style/classes/class.ilPageLayoutGUI.php");
71 $this->tpl->getStandardTemplate();
72 $this->ctrl->setReturn($this,
"edit");
73 if ($this->pg_id!=null) {
78 $layout_gui->setTabs();
79 $layout_gui->setEditPreview(
true);
80 $this->ctrl->saveParameter($this,
"obj_id");
81 $ret =& $this->ctrl->forwardCommand($layout_gui);
82 $this->tpl->setContent(
$ret);
88 $cmd =
"editBasicSettings";
130 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
132 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
135 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_basic_settings",
"tpl.stys_basic_settings.html");
136 $this->tpl->setCurrentBlock(
"style_settings");
138 $settings = $this->ilias->getAllSettings();
140 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
142 $this->tpl->setVariable(
"TXT_TREE_FRAME", $this->lng->txt(
"tree_frame"));
143 $this->tpl->setVariable(
"TXT_TREE_FRAME_INFO", $this->lng->txt(
"tree_frame_info"));
144 $this->tpl->setVariable(
"TXT_FRAME_LEFT", $this->lng->txt(
"tree_left"));
145 $this->tpl->setVariable(
"TXT_FRAME_RIGHT", $this->lng->txt(
"tree_right"));
147 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"basic_settings"));
148 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS", $this->lng->txt(
"icons_in_typed_lists"));
149 $this->tpl->setVariable(
"TXT_ICONS_IN_HEADER", $this->lng->txt(
"icons_in_header"));
150 $this->tpl->setVariable(
"TXT_ICONS_IN_ITEM_ROWS", $this->lng->txt(
"icons_in_item_rows"));
151 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS_INFO", $this->lng->txt(
"icons_in_typed_lists_info"));
153 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS", $this->lng->txt(
"enable_custom_icons"));
154 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS_INFO", $this->lng->txt(
"enable_custom_icons_info"));
155 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_BIG", $this->lng->txt(
"custom_icon_size_big"));
156 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_SMALL", $this->lng->txt(
"custom_icon_size_standard"));
157 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_TINY", $this->lng->txt(
"custom_icon_size_tiny"));
158 $this->tpl->setVariable(
"TXT_WIDTH_X_HEIGHT", $this->lng->txt(
"width_x_height"));
159 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
162 if ($settings[
"tree_frame"] ==
"right")
164 $this->tpl->setVariable(
"SEL_FRAME_RIGHT",
"selected=\"selected\"");
168 $this->tpl->setVariable(
"SEL_FRAME_LEFT",
"selected=\"selected\"");
171 if ($settings[
"custom_icons"])
173 $this->tpl->setVariable(
"CHK_CUSTOM_ICONS",
"checked=\"checked\"");
183 $this->tpl->setVariable(
"CUST_ICON_BIG_WIDTH", $settings[
"custom_icon_big_width"]);
184 $this->tpl->setVariable(
"CUST_ICON_BIG_HEIGHT", $settings[
"custom_icon_big_height"]);
185 $this->tpl->setVariable(
"CUST_ICON_SMALL_WIDTH", $settings[
"custom_icon_small_width"]);
186 $this->tpl->setVariable(
"CUST_ICON_SMALL_HEIGHT", $settings[
"custom_icon_small_height"]);
187 $this->tpl->setVariable(
"CUST_ICON_TINY_WIDTH", $settings[
"custom_icon_tiny_width"]);
188 $this->tpl->setVariable(
"CUST_ICON_TINY_HEIGHT", $settings[
"custom_icon_tiny_height"]);
198 $this->ilias->setSetting(
"tree_frame",
$_POST[
"tree_frame"]);
200 $this->ilias->setSetting(
"custom_icons",
$_POST[
"custom_icons"]);
201 $this->ilias->setSetting(
"custom_icon_big_width", (
int)
$_POST[
"custom_icon_big_width"]);
202 $this->ilias->setSetting(
"custom_icon_big_height", (
int) $_POST[
"custom_icon_big_height"]);
203 $this->ilias->setSetting(
"custom_icon_small_width", (
int) $_POST[
"custom_icon_small_width"]);
204 $this->ilias->setSetting(
"custom_icon_small_height", (
int) $_POST[
"custom_icon_small_height"]);
205 $this->ilias->setSetting(
"custom_icon_tiny_width", (
int) $_POST[
"custom_icon_tiny_width"]);
206 $this->ilias->setSetting(
"custom_icon_tiny_height", (
int) $_POST[
"custom_icon_tiny_height"]);
216 global $rbacsystem,
$ilias;
218 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
220 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
223 include_once
"./Services/Table/classes/class.ilTableGUI.php";
226 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.styf_content_styles.html");
229 $this->tpl->addBlockfile(
"STYLE_TABLE",
"style_table",
"tpl.table.html");
232 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.styf_row.html");
236 $this->tpl->setVariable(
"FORMACTION",
237 $this->ctrl->getFormAction($this));
243 $tbl->setTitle($this->lng->txt(
"content_styles"),
"icon_sty.gif",
244 $this->lng->txt(
"content_styles"));
249 $header_names = array(
"", $this->lng->txt(
"title"),
250 $this->lng->txt(
"sty_nr_learning_modules"),
251 $this->lng->txt(
"purpose"), $this->lng->txt(
"sty_scope"),
252 $this->lng->txt(
"active"));
253 $tbl->setHeaderNames($header_names);
255 $header_params = array(
"ref_id" => $this->ref_id);
256 $tbl->setHeaderVars(array(
"",
"title",
"nr_lms",
"purpose",
"scope",
"active"), $header_params);
257 $tbl->setColumnWidth(array(
"1px",
"",
"",
"",
""));
260 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
261 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
262 $tbl->setLimit(
$_GET[
"limit"]);
263 $tbl->setOffset(
$_GET[
"offset"]);
264 $tbl->disable(
"sort");
267 $style_entries = array();
268 $styles = $this->
object->getStyles();
269 foreach($styles as $style)
271 $style_entries[$style[
"title"].
":".$style[
"id"]]
274 ksort($style_entries);
275 $from_styles = $to_styles = array();
277 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
280 if ($fixed_style <= 0)
283 array(
"title" => $this->lng->txt(
"sty_individual_styles"),
285 $from_styles[-1] = $this->lng->txt(
"sty_individual_styles");
289 if ($default_style <= 0 && $fixed_style <= 0)
292 array(
"title" => $this->lng->txt(
"sty_default_style"),
294 $from_styles[0] = $this->lng->txt(
"sty_default_style");
295 $to_styles[0] = $this->lng->txt(
"sty_default_style");
299 $tbl->setMaxCount(count($style_entries));
301 $this->tpl->setVariable(
"COLUMN_COUNTS", 6);
304 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
309 include_once (
"./Services/Style/classes/class.ilObjStyleSheet.php");
311 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
312 $default_style = $ilias->getSetting(
"default_content_style_id");
314 foreach ($style_entries as $style)
317 $css_row = ($css_row ==
"tblrow2")
322 if ($style[
"id"] > 0)
324 $this->tpl->setCurrentBlock(
"check_box");
325 $this->tpl->setVariable(
"CHECKBOX_ID", $style[
"id"]);
326 $this->tpl->parseCurrentBlock();
330 if ($fixed_style <= 0 && $style[
"id"] > 0)
332 $this->tpl->setCurrentBlock(
"active_box");
335 $this->tpl->setVariable(
"CHECKED_STY",
'checked="checked"');
337 $this->tpl->setVariable(
"ACTIVE_ID", $style[
"id"]);
338 $this->tpl->parseCurrentBlock();
342 if ($style[
"id"] > 0)
344 $this->ctrl->setParameterByClass(
"ilobjstylesheetgui",
"obj_id", $style[
"id"]);
345 $this->tpl->setCurrentBlock(
"linka");
346 $this->tpl->setVariable(
"TXT_TITLE", $style[
"title"]);
347 $this->tpl->setVariable(
"LINK_STYLE",
348 $this->ctrl->getLinkTargetByClass(
"ilobjstylesheetgui"),
"view");
349 $this->tpl->parseCurrentBlock();
353 $this->tpl->setCurrentBlock(
"texta");
354 $this->tpl->setVariable(
"TXT_TEXT", $style[
"title"]);
355 $this->tpl->parseCurrentBlock();
358 $this->tpl->setCurrentBlock(
"style_row");
361 if ($style[
"id"] > 0)
368 $from_styles[$style[
"id"]] = $style[
"title"];
372 $to_styles[$style[
"id"]] = $style[
"title"];
375 $this->tpl->setVariable(
"TXT_NR_LEARNING_MODULES", $nr_lm);
380 $this->tpl->setVariable(
"TXT_NR_LEARNING_MODULES", $style[
"nr"]);
383 $this->tpl->setVariable(
"ROWCOL", $css_row);
386 if ($style[
"id"] > 0)
388 if ($style[
"id"] == $fixed_style)
390 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_fixed"));
392 if ($style[
"id"] == $default_style)
394 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_default"));
396 if ($style[
"category"] > 0)
398 $this->tpl->setVariable(
"TXT_SCOPE",
404 $this->tpl->parseCurrentBlock();
406 $this->tpl->setCurrentBlock(
"tbl_content");
407 $this->tpl->parseCurrentBlock();
411 if (count($style_entries) == 0)
413 $tbl->disable(
"header");
414 $tbl->disable(
"footer");
416 $this->tpl->setCurrentBlock(
"text");
417 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"obj_not_found"));
418 $this->tpl->parseCurrentBlock();
420 $this->tpl->setCurrentBlock(
"tbl_content");
421 $this->tpl->parseCurrentBlock();
429 $this->tpl->setCurrentBlock(
"adm_content");
430 $this->tpl->setVariable(
"TXT_MOVE_LM_STYLE", $this->lng->txt(
"sty_move_lm_styles"));
431 $this->tpl->setVariable(
"TXT_FROM", $this->lng->txt(
"from"));
432 $this->tpl->setVariable(
"TXT_TO", $this->lng->txt(
"to"));
433 $this->tpl->setVariable(
"TXT_MOVE_LM_STYLE", $this->lng->txt(
"sty_move_lm_styles"));
434 $this->tpl->setVariable(
"TXT_MOVE_STYLE", $this->lng->txt(
"sty_move_style"));
435 $this->tpl->setVariable(
"SELECT_FROM",
437 $this->tpl->setVariable(
"SELECT_TO",
439 $this->tpl->setVariable(
"FORMACTION2", $this->ctrl->getFormAction($this));
440 $this->tpl->parseCurrentBlock();
448 if (
$_POST[
"from_style"] == -1)
454 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
456 $this->ctrl->redirect($this,
"editContentStyles");
465 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
467 $this->ctrl->redirect($this,
"editContentStyles");
477 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
478 $this->tpl->setVariable(
"CMD_OK",
"moveIndividualStyles");
479 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"ok"));
480 $this->tpl->setVariable(
"CMD_CANCEL",
"editContentStyles");
481 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
482 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"sty_confirm_del_ind_styles"));
483 $this->tpl->setVariable(
"TXT_CONTENT",
484 sprintf($this->lng->txt(
"sty_confirm_del_ind_styles_desc"),
486 $this->ctrl->setParameter($this,
"to_style",
$_POST[
"to_style"]);
487 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
488 $this->tpl->parseCurrentBlock();
497 global $rbacsystem,
$ilias, $styleDefinition;;
499 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
501 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
504 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_settings",
"tpl.stys_settings.html");
505 $this->tpl->setCurrentBlock(
"style_settings");
507 $settings = $this->ilias->getAllSettings();
509 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
510 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"system_style_settings"));
511 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
512 $this->tpl->setVariable(
"TXT_DEFAULT_SKIN_STYLE", $this->lng->txt(
"default_skin_style"));
513 $this->tpl->setVariable(
"TXT_SKIN_STYLE_ACTIVATION", $this->lng->txt(
"style_activation"));
514 $this->tpl->setVariable(
"TXT_NUMBER_OF_USERS", $this->lng->txt(
"num_users"));
515 $this->tpl->setVariable(
"TXT_MOVE_USERS_TO_STYLE", $this->lng->txt(
"move_users_to_style"));
518 $templates = $styleDefinition->getAllTemplates();
520 $all_styles = array();
522 foreach ($templates as $template)
526 $styleDef->startParsing();
527 $styles = $styleDef->getStyles();
529 foreach ($styles as $style)
531 if ($this->ilias->ini->readVariable(
"layout",
"skin") == $template[
"id"] &&
532 $this->ilias->ini->readVariable(
"layout",
"style") == $style[
"id"])
534 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
538 $this->tpl->setCurrentBlock(
"selectskin");
539 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
540 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
541 $this->tpl->parseCurrentBlock();
544 foreach ($templates as $template2)
548 $styleDef2->startParsing();
549 $styles2 = $styleDef2->getStyles();
551 foreach ($styles2 as $style2)
555 $this->tpl->setCurrentBlock(
"move_to_skin");
556 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
557 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
558 $this->tpl->parseCurrentBlock();
564 $this->tpl->setCurrentBlock(
"activation_checkbox");
565 $this->tpl->setVariable(
"VAL_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
568 $this->tpl->setVariable(
"CHK_SKIN_STYLE",
" checked=\"1\" ");
570 $this->tpl->parseCurrentBlock();
573 $this->tpl->setCurrentBlock(
"style_activation");
574 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
575 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
576 $styleDef->getTemplateName().
" / ".$style[
"name"]);
578 $this->tpl->setVariable(
"VAL_NUM_USERS", $num_users);
579 $this->tpl->parseCurrentBlock();
581 $all_styles[] = $template[
"id"].
":".$style[
"id"];
590 $users_missing_styles = 0;
591 foreach($all_user_styles as $style)
593 if (!in_array($style, $all_styles))
595 $style_arr = explode(
":", $style);
600 if ($users_missing_styles > 0)
603 foreach ($templates as $template2)
607 $styleDef2->startParsing();
608 $styles2 = $styleDef2->getStyles();
610 foreach ($styles2 as $style2)
614 $this->tpl->setCurrentBlock(
"move_to_skin");
615 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
616 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
617 $this->tpl->parseCurrentBlock();
622 $this->tpl->setCurrentBlock(
"style_activation");
623 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
624 $this->lng->txt(
"other"));
625 $this->tpl->setVariable(
"VAL_NUM_USERS",
626 $users_missing_styles);
627 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE",
"other");
628 $this->tpl->parseCurrentBlock();
631 $this->tpl->parseCurrentBlock();
640 global $styleDefinition;
643 if (count(
$_POST[
"st_act"]) < 1)
645 $this->ilias->raiseError($this->lng->txt(
"at_least_one_style"), $this->ilias->error_obj->MESSAGE);
650 $templates = $styleDefinition->getAllTemplates();
651 $all_styles = array();
652 foreach ($templates as $template)
656 $styleDef->startParsing();
657 $styles = $styleDef->getStyles();
658 foreach ($styles as $style)
660 if (!isset(
$_POST[
"st_act"][$template[
"id"].
":".$style[
"id"]]))
664 $this->ilias->raiseError($this->lng->txt(
"cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
675 $all_styles[] = $template[
"id"].
":".$style[
"id"];
680 foreach(
$_POST[
"move_users"] as
$key => $value)
684 $to = explode(
":", $value);
688 $from = explode(
":",
$key);
698 foreach($all_user_styles as $style)
700 if (!in_array($style, $all_styles))
702 $style_arr = explode(
":", $style);
711 if (
$_POST[
"default_skin_style"] !=
"")
713 $sknst = explode(
":",
$_POST[
"default_skin_style"]);
715 if ($this->ilias->ini->readVariable(
"layout",
"style") != $sknst[1] ||
716 $this->ilias->ini->readVariable(
"layout",
"skin") != $sknst[0])
718 $this->ilias->ini->setVariable(
"layout",
"skin", $sknst[0]);
719 $this->ilias->ini->setVariable(
"layout",
"style",$sknst[1]);
722 $this->ilias->ini->write();
737 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
743 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
750 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
753 $this->tpl->setCurrentBlock(
"table_header");
754 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
755 $this->tpl->parseCurrentBlock();
762 foreach (
$_POST[
"id"] as $id)
764 $this->tpl->setCurrentBlock(
"table_row");
768 $this->tpl->parseCurrentBlock();
774 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
775 "cancelDelete" => $this->lng->txt(
"cancel"));
776 foreach ($buttons as
$name => $value)
778 $this->tpl->setCurrentBlock(
"operation_btn");
780 $this->tpl->setVariable(
"BTN_NAME",
$name);
781 $this->tpl->setVariable(
"BTN_VALUE",$value);
782 $this->tpl->parseCurrentBlock();
796 $this->
object->removeStyle($id);
797 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
798 $style_obj->delete();
800 $this->
object->update();
803 $this->ctrl->getLinkTarget($this,
"editContentStyles")));
818 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
820 if(count(
$_POST[
"id"]) > 1)
822 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
825 $ilias->deleteSetting(
"fixed_content_style_id");
826 $def_style = $ilias->getSetting(
"default_content_style_id");
828 if ($def_style !=
$_POST[
"id"][0])
830 $ilias->setSetting(
"default_content_style_id",
$_POST[
"id"][0]);
834 $ilias->deleteSetting(
"default_content_style_id");
851 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
853 if(count(
$_POST[
"id"]) > 1)
855 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
858 $ilias->deleteSetting(
"default_content_style_id");
859 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
860 if ($fixed_style ==
$_POST[
"id"][0])
862 $ilias->deleteSetting(
"fixed_content_style_id");
866 $ilias->setSetting(
"fixed_content_style_id",
$_POST[
"id"][0]);
877 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
878 $styles = $this->
object->getStyles();
879 foreach($styles as $style)
881 if (
$_POST[
"std_".$style[
"id"]] == 1)
903 $this->tpl->setCurrentBlock(
"tbl_action_btn");
904 $this->tpl->setVariable(
"BTN_NAME",
"deleteStyle");
905 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
906 $this->tpl->parseCurrentBlock();
909 $this->tpl->setCurrentBlock(
"tbl_action_btn");
910 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalDefault");
911 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
912 $this->tpl->parseCurrentBlock();
915 $this->tpl->setCurrentBlock(
"tbl_action_btn");
916 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalFixed");
917 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
918 $this->tpl->parseCurrentBlock();
921 $this->tpl->setCurrentBlock(
"tbl_action_btn");
922 $this->tpl->setVariable(
"BTN_NAME",
"setScope");
923 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_set_scope"));
924 $this->tpl->parseCurrentBlock();
927 $this->tpl->setCurrentBlock(
"tbl_action_btn");
928 $this->tpl->setVariable(
"BTN_NAME",
"saveActiveStyles");
929 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_save_active_styles"));
930 $this->tpl->parseCurrentBlock();
932 if ($with_subobjects ===
true)
937 $this->tpl->setCurrentBlock(
"tbl_action_row");
939 $this->tpl->parseCurrentBlock();
949 session_unregister(
"saved_post");
952 $this->ctrl->redirect($this,
"editContentStyles");
960 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
967 include_once (
"./Services/Style/classes/class.ilStyleScopeExplorer.php");
969 $exp->setExpandTarget(
"repository.php?cmd=showTree");
970 $exp->setTargetGet(
"ref_id");
972 $exp->forceExpandAll(
true,
false);
973 $exp->addFilter(
"root");
974 $exp->addFilter(
"cat");
976 if (
$_GET[
"expand"] ==
"")
978 $expanded = $this->tree->readRootId();
982 $expanded =
$_GET[
"expand"];
985 $exp->setExpand($expanded);
989 $output = $exp->getOutput();
991 $this->tpl->setVariable(
"ADM_CONTENT", $output);
1001 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1002 if (
$_GET[
"cat"] == 0)
1020 $ilTabs->setTabActive(
'page_layouts');
1022 $tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1024 $tpl->setCurrentBlock(
"btn_cell");
1025 $tpl->setVariable(
"BTN_LINK",
1026 $ilCtrl->getLinkTarget($this,
"createPgGUI"));
1027 $tpl->setVariable(
"BTN_TXT",$lng->txt(
"sty_add_pgl"));
1028 $tpl->parseCurrentBlock();
1030 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/Style");
1032 include_once(
"./Services/Style/classes/class.ilPageLayoutTableGUI.php");
1034 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
1035 $tpl->setContent($oa_tpl->get());
1041 if (!isset(
$_POST[
"pglayout"]))
1046 foreach (
$_POST[
"pglayout"] as $item)
1049 $pg_layout->activate($a_activate);
1052 $this->ctrl->redirect($this,
"viewPageLayouts");
1068 if(!isset(
$_POST[
"pglayout"]))
1070 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1073 $ilTabs->setTabActive(
'page_layouts');
1079 $this->data[
"cols"] = array(
"type",
"title");
1081 foreach(
$_POST[
"pglayout"] as $id)
1084 $pg_obj->readObject();
1085 $this->data[
"data"][
"$id"] = array(
1087 "title" => $pg_obj->getTitle()
1092 $this->data[
"buttons"] = array(
"cancelDeletePg" => $this->lng->txt(
"cancel"),
1093 "confirmedDeletePg" => $this->lng->txt(
"confirm"));
1099 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1102 foreach ($this->data[
"cols"] as
$key)
1104 $this->tpl->setCurrentBlock(
"table_header");
1105 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1106 $this->tpl->parseCurrentBlock();
1113 foreach($this->data[
"data"] as $key => $value)
1116 foreach($value as $key => $cell_data)
1118 $this->tpl->setCurrentBlock(
"table_cell");
1127 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1129 $this->tpl->parseCurrentBlock();
1132 $this->tpl->setCurrentBlock(
"table_row");
1134 $this->tpl->parseCurrentBlock();
1140 foreach($this->data[
"buttons"] as
$name => $value)
1142 $this->tpl->setCurrentBlock(
"operation_btn");
1143 $this->tpl->setVariable(
"BTN_NAME",
$name);
1144 $this->tpl->setVariable(
"BTN_VALUE",$value);
1145 $this->tpl->parseCurrentBlock();
1155 session_unregister(
"pglayout_user_delete");
1157 $this->ctrl->redirect($this,
"viewPageLayouts");
1166 global
$ilDB, $ilUser;
1170 foreach (
$_SESSION[
"pglayout_user_delete"] as $id)
1177 $this->ctrl->redirect($this,
"viewPageLayouts");
1184 $ilTabs->setTabActive(
'page_layouts');
1186 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1188 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1189 $this->form_gui->setTitle($lng->txt(
"sty_create_pgl"));
1191 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
1194 $title_input =
new ilTextInputGUI($lng->txt(
"title"),
"pgl_title");
1196 $title_input->setMaxLength(128);
1197 $title_input->setValue($this->layout_object->title);
1198 $title_input->setTitle($lng->txt(
"title"));
1199 $title_input->setRequired(
true);
1202 $desc_input->
setValue($this->layout_object->description);
1203 $desc_input->setRows(3);
1204 $desc_input->setCols(37);
1206 $ttype_input =
new ilSelectInputGUI($lng->txt(
"sty_based_on"),
"pgl_template");
1211 $options[
'-1'] = $lng->txt(
"none");
1213 foreach ($arr_templates as $templ) {
1214 $templ->readObject();
1215 $key = $templ->getId();
1216 $value = $templ->getTitle();
1217 $options[
$key] = $value;
1220 $ttype_input->setOptions($options);
1221 $ttype_input->setValue(-1);
1222 $ttype_input->setRequired(
true);
1224 $desc_input->setTitle($lng->txt(
"description"));
1225 $desc_input->setRequired(
false);
1227 $this->form_gui->addItem($title_input);
1228 $this->form_gui->addItem($desc_input);
1229 $this->form_gui->addItem($ttype_input);
1232 $this->form_gui->addCommandButton(
"createPg", $lng->txt(
"save"));
1233 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
1235 $this->tpl->setContent($this->form_gui->getHTML());
1243 if(
$_POST[
"pgl_title"] ==
"")
1245 $this->ilias->raiseError($this->lng->txt(
"no_title"),$this->ilias->error_obj->MESSAGE);
1251 $pg_object->setTitle(
$_POST[
'pgl_title']);
1252 $pg_object->setDescription(
$_POST[
'pgl_desc']);
1253 $pg_object->update();
1255 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1258 if(!is_object($pg_content))
1263 $this->pg_content->setId($pg_object->getId());
1265 if (
$_POST[
'pgl_template'] !=
"-1") {
1267 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
1268 $this->pg_content->create(
false);
1270 $this->pg_content->create(
false);
1273 $this->pg_id = $pg_object->getId();
1275 $ilCtrl->setCmdClass(
"ilpagelayoutgui");
1276 $ilCtrl->setCmd(
"edit");
1288 $ilCtrl->setCmdClass(
"ilpagelayoutgui");
1289 $ilCtrl->setCmd(
"edit");
1296 echo
"settings_setTabs";
1311 global $rbacsystem,
$lng, $ilTabs;
1313 if ($this->peditor_active) {
1314 $tabs_gui->setBackTarget($this->lng->txt(
"page_layouts"),
1315 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"));
1318 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()) && !$this->peditor_active)
1320 $tabs_gui->addTarget(
"basic_settings",
1321 $this->ctrl->getLinkTarget($this,
"editBasicSettings"), array(
"editBasicSettings",
"",
"view"),
"",
"");
1323 $tabs_gui->addTarget(
"system_styles",
1324 $this->ctrl->getLinkTarget($this,
"editSystemStyles"),
"editSystemStyles",
"",
"");
1326 $tabs_gui->addTarget(
"content_styles",
1327 $this->ctrl->getLinkTarget($this,
"editContentStyles"),
"editContentStyles",
"",
"");
1329 $tabs_gui->addTarget(
"page_layouts",
1330 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"),
"viewPageLayouts",
"",
"");
1335 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()) && !$this->peditor_active)
1337 $tabs_gui->addTarget(
"perm_settings",
1338 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');