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";
124 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
126 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
129 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_basic_settings",
"tpl.stys_basic_settings.html");
132 $settings = $this->ilias->getAllSettings();
134 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
136 $this->tpl->setVariable(
"TXT_TREE_FRAME", $this->lng->txt(
"tree_frame"));
137 $this->tpl->setVariable(
"TXT_TREE_FRAME_INFO", $this->lng->txt(
"tree_frame_info"));
138 $this->tpl->setVariable(
"TXT_FRAME_LEFT", $this->lng->txt(
"tree_left"));
139 $this->tpl->setVariable(
"TXT_FRAME_RIGHT", $this->lng->txt(
"tree_right"));
141 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"basic_settings"));
142 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS", $this->lng->txt(
"icons_in_typed_lists"));
143 $this->tpl->setVariable(
"TXT_ICONS_IN_HEADER", $this->lng->txt(
"icons_in_header"));
144 $this->tpl->setVariable(
"TXT_ICONS_IN_ITEM_ROWS", $this->lng->txt(
"icons_in_item_rows"));
145 $this->tpl->setVariable(
"TXT_ICONS_IN_TYPED_LISTS_INFO", $this->lng->txt(
"icons_in_typed_lists_info"));
147 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS", $this->lng->txt(
"enable_custom_icons"));
148 $this->tpl->setVariable(
"TXT_ENABLE_CUSTOM_ICONS_INFO", $this->lng->txt(
"enable_custom_icons_info"));
149 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_BIG", $this->lng->txt(
"custom_icon_size_big"));
150 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_SMALL", $this->lng->txt(
"custom_icon_size_standard"));
151 $this->tpl->setVariable(
"TXT_CUSTOM_ICON_SIZE_TINY", $this->lng->txt(
"custom_icon_size_tiny"));
152 $this->tpl->setVariable(
"TXT_WIDTH_X_HEIGHT", $this->lng->txt(
"width_x_height"));
153 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
156 if ($settings[
"tree_frame"] ==
"right")
158 $this->tpl->setVariable(
"SEL_FRAME_RIGHT",
"selected=\"selected\"");
162 $this->tpl->setVariable(
"SEL_FRAME_LEFT",
"selected=\"selected\"");
165 if ($settings[
"custom_icons"])
167 $this->tpl->setVariable(
"CHK_CUSTOM_ICONS",
"checked=\"checked\"");
177 $this->tpl->setVariable(
"CUST_ICON_BIG_WIDTH", $settings[
"custom_icon_big_width"]);
178 $this->tpl->setVariable(
"CUST_ICON_BIG_HEIGHT", $settings[
"custom_icon_big_height"]);
179 $this->tpl->setVariable(
"CUST_ICON_SMALL_WIDTH", $settings[
"custom_icon_small_width"]);
180 $this->tpl->setVariable(
"CUST_ICON_SMALL_HEIGHT", $settings[
"custom_icon_small_height"]);
181 $this->tpl->setVariable(
"CUST_ICON_TINY_WIDTH", $settings[
"custom_icon_tiny_width"]);
182 $this->tpl->setVariable(
"CUST_ICON_TINY_HEIGHT", $settings[
"custom_icon_tiny_height"]);
192 $this->ilias->setSetting(
"tree_frame",
$_POST[
"tree_frame"]);
194 $this->ilias->setSetting(
"custom_icons",
$_POST[
"custom_icons"]);
195 $this->ilias->setSetting(
"custom_icon_big_width", (
int)
$_POST[
"custom_icon_big_width"]);
196 $this->ilias->setSetting(
"custom_icon_big_height", (
int) $_POST[
"custom_icon_big_height"]);
197 $this->ilias->setSetting(
"custom_icon_small_width", (
int) $_POST[
"custom_icon_small_width"]);
198 $this->ilias->setSetting(
"custom_icon_small_height", (
int) $_POST[
"custom_icon_small_height"]);
199 $this->ilias->setSetting(
"custom_icon_tiny_width", (
int) $_POST[
"custom_icon_tiny_width"]);
200 $this->ilias->setSetting(
"custom_icon_tiny_height", (
int) $_POST[
"custom_icon_tiny_height"]);
202 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editBasicSettings",
"",
false,
false));
210 global $rbacsystem,
$ilias;
212 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
214 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
217 include_once
"./Services/Table/classes/class.ilTableGUI.php";
220 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.styf_content_styles.html");
223 $this->tpl->addBlockfile(
"STYLE_TABLE",
"style_table",
"tpl.table.html");
226 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.styf_row.html");
230 $this->tpl->setVariable(
"FORMACTION",
231 $this->ctrl->getFormAction($this));
237 $tbl->setTitle($this->lng->txt(
"content_styles"),
"icon_sty.gif",
238 $this->lng->txt(
"content_styles"));
243 $header_names = array(
"", $this->lng->txt(
"title"),
244 $this->lng->txt(
"sty_nr_learning_modules"),
245 $this->lng->txt(
"purpose"), $this->lng->txt(
"sty_scope"),
246 $this->lng->txt(
"active"));
247 $tbl->setHeaderNames($header_names);
249 $header_params = array(
"ref_id" => $this->ref_id);
250 $tbl->setHeaderVars(array(
"",
"title",
"nr_lms",
"purpose",
"scope",
"active"), $header_params);
251 $tbl->setColumnWidth(array(
"1px",
"",
"",
"",
""));
254 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
255 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
256 $tbl->setLimit(
$_GET[
"limit"]);
257 $tbl->setOffset(
$_GET[
"offset"]);
258 $tbl->disable(
"sort");
261 $style_entries = array();
262 $styles = $this->
object->getStyles();
263 foreach($styles as $style)
265 $style_entries[$style[
"title"].
":".$style[
"id"]]
268 ksort($style_entries);
269 $from_styles = $to_styles = array();
271 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
274 if ($fixed_style <= 0)
277 array(
"title" => $this->lng->txt(
"sty_individual_styles"),
279 $from_styles[-1] = $this->lng->txt(
"sty_individual_styles");
283 if ($default_style <= 0 && $fixed_style <= 0)
286 array(
"title" => $this->lng->txt(
"sty_default_style"),
288 $from_styles[0] = $this->lng->txt(
"sty_default_style");
289 $to_styles[0] = $this->lng->txt(
"sty_default_style");
293 $tbl->setMaxCount(count($style_entries));
295 $this->tpl->setVariable(
"COLUMN_COUNTS", 6);
298 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
303 include_once (
"./Services/Style/classes/class.ilObjStyleSheet.php");
305 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
306 $default_style = $ilias->getSetting(
"default_content_style_id");
308 foreach ($style_entries as $style)
311 $css_row = ($css_row ==
"tblrow2")
316 if ($style[
"id"] > 0)
318 $this->tpl->setCurrentBlock(
"check_box");
319 $this->tpl->setVariable(
"CHECKBOX_ID", $style[
"id"]);
320 $this->tpl->parseCurrentBlock();
324 if ($fixed_style <= 0 && $style[
"id"] > 0)
326 $this->tpl->setCurrentBlock(
"active_box");
329 $this->tpl->setVariable(
"CHECKED_STY",
'checked="checked"');
331 $this->tpl->setVariable(
"ACTIVE_ID", $style[
"id"]);
332 $this->tpl->parseCurrentBlock();
336 if ($style[
"id"] > 0)
338 $this->ctrl->setParameterByClass(
"ilobjstylesheetgui",
"obj_id", $style[
"id"]);
339 $this->tpl->setCurrentBlock(
"linka");
340 $this->tpl->setVariable(
"TXT_TITLE", $style[
"title"]);
341 $this->tpl->setVariable(
"LINK_STYLE",
342 $this->ctrl->getLinkTargetByClass(
"ilobjstylesheetgui"),
"view");
343 $this->tpl->parseCurrentBlock();
347 $this->tpl->setCurrentBlock(
"texta");
348 $this->tpl->setVariable(
"TXT_TEXT", $style[
"title"]);
349 $this->tpl->parseCurrentBlock();
352 $this->tpl->setCurrentBlock(
"style_row");
355 if ($style[
"id"] > 0)
362 $from_styles[$style[
"id"]] = $style[
"title"];
366 $to_styles[$style[
"id"]] = $style[
"title"];
369 $this->tpl->setVariable(
"TXT_NR_LEARNING_MODULES", $nr_lm);
374 $this->tpl->setVariable(
"TXT_NR_LEARNING_MODULES", $style[
"nr"]);
377 $this->tpl->setVariable(
"ROWCOL", $css_row);
380 if ($style[
"id"] > 0)
382 if ($style[
"id"] == $fixed_style)
384 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_fixed"));
386 if ($style[
"id"] == $default_style)
388 $this->tpl->setVariable(
"TXT_PURPOSE", $this->lng->txt(
"global_default"));
390 if ($style[
"category"] > 0)
392 $this->tpl->setVariable(
"TXT_SCOPE",
398 $this->tpl->parseCurrentBlock();
400 $this->tpl->setCurrentBlock(
"tbl_content");
401 $this->tpl->parseCurrentBlock();
405 if (count($style_entries) == 0)
407 $tbl->disable(
"header");
408 $tbl->disable(
"footer");
410 $this->tpl->setCurrentBlock(
"text");
411 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"obj_not_found"));
412 $this->tpl->parseCurrentBlock();
414 $this->tpl->setCurrentBlock(
"tbl_content");
415 $this->tpl->parseCurrentBlock();
423 $this->tpl->setCurrentBlock(
"adm_content");
424 $this->tpl->setVariable(
"TXT_MOVE_LM_STYLE", $this->lng->txt(
"sty_move_lm_styles"));
425 $this->tpl->setVariable(
"TXT_FROM", $this->lng->txt(
"from"));
426 $this->tpl->setVariable(
"TXT_TO", $this->lng->txt(
"to"));
427 $this->tpl->setVariable(
"TXT_MOVE_LM_STYLE", $this->lng->txt(
"sty_move_lm_styles"));
428 $this->tpl->setVariable(
"TXT_MOVE_STYLE", $this->lng->txt(
"sty_move_style"));
429 $this->tpl->setVariable(
"SELECT_FROM",
431 $this->tpl->setVariable(
"SELECT_TO",
433 $this->tpl->setVariable(
"FORMACTION2", $this->ctrl->getFormAction($this));
434 $this->tpl->parseCurrentBlock();
442 if (
$_POST[
"from_style"] == -1)
448 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
450 $this->ctrl->redirect($this,
"editContentStyles");
459 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
461 $this->ctrl->redirect($this,
"editContentStyles");
471 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
472 $this->tpl->setVariable(
"CMD_OK",
"moveIndividualStyles");
473 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"ok"));
474 $this->tpl->setVariable(
"CMD_CANCEL",
"editContentStyles");
475 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
476 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"sty_confirm_del_ind_styles"));
477 $this->tpl->setVariable(
"TXT_CONTENT",
478 sprintf($this->lng->txt(
"sty_confirm_del_ind_styles_desc"),
480 $this->ctrl->setParameter($this,
"to_style",
$_POST[
"to_style"]);
481 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormaction($this));
482 $this->tpl->parseCurrentBlock();
491 global $rbacsystem,
$ilias, $styleDefinition;;
493 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
495 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
498 $this->tpl->addBlockfile(
"ADM_CONTENT",
"style_settings",
"tpl.stys_settings.html");
499 $this->tpl->setCurrentBlock(
"style_settings");
501 $settings = $this->ilias->getAllSettings();
503 $this->tpl->setVariable(
"FORMACTION_STYLESETTINGS", $this->ctrl->getFormAction($this));
504 $this->tpl->setVariable(
"TXT_STYLE_SETTINGS", $this->lng->txt(
"system_style_settings"));
505 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
506 $this->tpl->setVariable(
"TXT_DEFAULT_SKIN_STYLE", $this->lng->txt(
"default_skin_style"));
507 $this->tpl->setVariable(
"TXT_SKIN_STYLE_ACTIVATION", $this->lng->txt(
"style_activation"));
508 $this->tpl->setVariable(
"TXT_NUMBER_OF_USERS", $this->lng->txt(
"num_users"));
509 $this->tpl->setVariable(
"TXT_MOVE_USERS_TO_STYLE", $this->lng->txt(
"move_users_to_style"));
512 $templates = $styleDefinition->getAllTemplates();
514 $all_styles = array();
516 foreach ($templates as $template)
520 $styleDef->startParsing();
521 $styles = $styleDef->getStyles();
523 foreach ($styles as $style)
525 if ($this->ilias->ini->readVariable(
"layout",
"skin") == $template[
"id"] &&
526 $this->ilias->ini->readVariable(
"layout",
"style") == $style[
"id"])
528 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
532 $this->tpl->setCurrentBlock(
"selectskin");
533 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
534 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
535 $this->tpl->parseCurrentBlock();
538 foreach ($templates as $template2)
542 $styleDef2->startParsing();
543 $styles2 = $styleDef2->getStyles();
545 foreach ($styles2 as $style2)
549 $this->tpl->setCurrentBlock(
"move_to_skin");
550 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
551 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
552 $this->tpl->parseCurrentBlock();
558 $this->tpl->setCurrentBlock(
"activation_checkbox");
559 $this->tpl->setVariable(
"VAL_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
562 $this->tpl->setVariable(
"CHK_SKIN_STYLE",
" checked=\"1\" ");
564 $this->tpl->parseCurrentBlock();
567 $this->tpl->setCurrentBlock(
"style_activation");
568 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE", $template[
"id"].
":".$style[
"id"]);
569 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
570 $styleDef->getTemplateName().
" / ".$style[
"name"]);
572 $this->tpl->setVariable(
"VAL_NUM_USERS", $num_users);
573 $this->tpl->parseCurrentBlock();
575 $all_styles[] = $template[
"id"].
":".$style[
"id"];
584 $users_missing_styles = 0;
585 foreach($all_user_styles as $style)
587 if (!in_array($style, $all_styles))
589 $style_arr = explode(
":", $style);
594 if ($users_missing_styles > 0)
597 foreach ($templates as $template2)
601 $styleDef2->startParsing();
602 $styles2 = $styleDef2->getStyles();
604 foreach ($styles2 as $style2)
608 $this->tpl->setCurrentBlock(
"move_to_skin");
609 $this->tpl->setVariable(
"TOSKINVALUE", $template2[
"id"].
":".$style2[
"id"]);
610 $this->tpl->setVariable(
"TOSKINOPTION", $styleDef2->getTemplateName().
" / ".$style2[
"name"]);
611 $this->tpl->parseCurrentBlock();
616 $this->tpl->setCurrentBlock(
"style_activation");
617 $this->tpl->setVariable(
"TXT_SKIN_STYLE_TITLE",
618 $this->lng->txt(
"other"));
619 $this->tpl->setVariable(
"VAL_NUM_USERS",
620 $users_missing_styles);
621 $this->tpl->setVariable(
"VAL_MOVE_SKIN_STYLE",
"other");
622 $this->tpl->parseCurrentBlock();
625 $this->tpl->parseCurrentBlock();
634 global $styleDefinition,
$ilCtrl;
637 if (count(
$_POST[
"st_act"]) < 1)
639 $this->ilias->raiseError($this->lng->txt(
"at_least_one_style"), $this->ilias->error_obj->MESSAGE);
644 $templates = $styleDefinition->getAllTemplates();
645 $all_styles = array();
646 foreach ($templates as $template)
650 $styleDef->startParsing();
651 $styles = $styleDef->getStyles();
652 foreach ($styles as $style)
654 if (!isset(
$_POST[
"st_act"][$template[
"id"].
":".$style[
"id"]]))
658 $this->ilias->raiseError($this->lng->txt(
"cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
669 $all_styles[] = $template[
"id"].
":".$style[
"id"];
674 foreach(
$_POST[
"move_users"] as $key => $value)
678 $to = explode(
":", $value);
682 $from = explode(
":", $key);
692 foreach($all_user_styles as $style)
694 if (!in_array($style, $all_styles))
696 $style_arr = explode(
":", $style);
705 if (
$_POST[
"default_skin_style"] !=
"")
707 $sknst = explode(
":",
$_POST[
"default_skin_style"]);
709 if ($this->ilias->ini->readVariable(
"layout",
"style") != $sknst[1] ||
710 $this->ilias->ini->readVariable(
"layout",
"skin") != $sknst[0])
712 $this->ilias->ini->setVariable(
"layout",
"skin", $sknst[0]);
713 $this->ilias->ini->setVariable(
"layout",
"style",$sknst[1]);
716 $this->ilias->ini->write();
719 $ilCtrl->redirect($this ,
"editSystemStyles");
731 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
737 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
744 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
747 $this->tpl->setCurrentBlock(
"table_header");
748 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
749 $this->tpl->parseCurrentBlock();
756 foreach (
$_POST[
"id"] as $id)
758 $this->tpl->setCurrentBlock(
"table_row");
762 $this->tpl->parseCurrentBlock();
768 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
769 "cancelDelete" => $this->lng->txt(
"cancel"));
770 foreach ($buttons as
$name => $value)
772 $this->tpl->setCurrentBlock(
"operation_btn");
774 $this->tpl->setVariable(
"BTN_NAME",
$name);
775 $this->tpl->setVariable(
"BTN_VALUE",$value);
776 $this->tpl->parseCurrentBlock();
790 $this->
object->removeStyle($id);
791 $style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
792 $style_obj->delete();
794 $this->
object->update();
797 $this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false)));
812 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
814 if(count(
$_POST[
"id"]) > 1)
816 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
819 $ilias->deleteSetting(
"fixed_content_style_id");
820 $def_style = $ilias->getSetting(
"default_content_style_id");
822 if ($def_style !=
$_POST[
"id"][0])
824 $ilias->setSetting(
"default_content_style_id",
$_POST[
"id"][0]);
828 $ilias->deleteSetting(
"default_content_style_id");
831 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
845 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
847 if(count(
$_POST[
"id"]) > 1)
849 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
852 $ilias->deleteSetting(
"default_content_style_id");
853 $fixed_style = $ilias->getSetting(
"fixed_content_style_id");
854 if ($fixed_style ==
$_POST[
"id"][0])
856 $ilias->deleteSetting(
"fixed_content_style_id");
860 $ilias->setSetting(
"fixed_content_style_id",
$_POST[
"id"][0]);
862 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
871 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
872 $styles = $this->
object->getStyles();
873 foreach($styles as $style)
875 if (
$_POST[
"std_".$style[
"id"]] == 1)
884 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
897 $this->tpl->setCurrentBlock(
"tbl_action_btn");
898 $this->tpl->setVariable(
"BTN_NAME",
"deleteStyle");
899 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
900 $this->tpl->parseCurrentBlock();
903 $this->tpl->setCurrentBlock(
"tbl_action_btn");
904 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalDefault");
905 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalDefault"));
906 $this->tpl->parseCurrentBlock();
909 $this->tpl->setCurrentBlock(
"tbl_action_btn");
910 $this->tpl->setVariable(
"BTN_NAME",
"toggleGlobalFixed");
911 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"toggleGlobalFixed"));
912 $this->tpl->parseCurrentBlock();
915 $this->tpl->setCurrentBlock(
"tbl_action_btn");
916 $this->tpl->setVariable(
"BTN_NAME",
"setScope");
917 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_set_scope"));
918 $this->tpl->parseCurrentBlock();
921 $this->tpl->setCurrentBlock(
"tbl_action_btn");
922 $this->tpl->setVariable(
"BTN_NAME",
"saveActiveStyles");
923 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"sty_save_active_styles"));
924 $this->tpl->parseCurrentBlock();
926 if ($with_subobjects ===
true)
931 $this->tpl->setCurrentBlock(
"tbl_action_row");
933 $this->tpl->parseCurrentBlock();
943 session_unregister(
"saved_post");
946 $this->ctrl->redirect($this,
"editContentStyles");
954 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
961 include_once (
"./Services/Style/classes/class.ilStyleScopeExplorer.php");
963 $exp->setExpandTarget(
"repository.php?cmd=showTree");
964 $exp->setTargetGet(
"ref_id");
966 $exp->forceExpandAll(
true,
false);
967 $exp->addFilter(
"root");
968 $exp->addFilter(
"cat");
970 if (
$_GET[
"expand"] ==
"")
972 $expanded = $this->tree->readRootId();
976 $expanded =
$_GET[
"expand"];
979 $exp->setExpand($expanded);
983 $output = $exp->getOutput();
985 $this->tpl->setVariable(
"ADM_CONTENT", $output);
995 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
996 if (
$_GET[
"cat"] == 0)
1002 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"editContentStyles",
"",
false,
false));
1014 $ilTabs->setTabActive(
'page_layouts');
1016 $tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1018 $tpl->setCurrentBlock(
"btn_cell");
1019 $tpl->setVariable(
"BTN_LINK",
1020 $ilCtrl->getLinkTarget($this,
"createPgGUI"));
1021 $tpl->setVariable(
"BTN_TXT",$lng->txt(
"sty_add_pgl"));
1022 $tpl->parseCurrentBlock();
1024 $oa_tpl =
new ilTemplate(
"tpl.stys_pglayout.html",
true,
true,
"Services/Style");
1026 include_once(
"./Services/Style/classes/class.ilPageLayoutTableGUI.php");
1028 $oa_tpl->setVariable(
"PGLAYOUT_TABLE", $pglayout_table->getHTML());
1029 $tpl->setContent($oa_tpl->get());
1035 if (!isset(
$_POST[
"pglayout"]))
1040 foreach (
$_POST[
"pglayout"] as $item)
1043 $pg_layout->activate($a_activate);
1046 $this->ctrl->redirect($this,
"viewPageLayouts");
1062 if(!isset(
$_POST[
"pglayout"]))
1064 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1067 $ilTabs->setTabActive(
'page_layouts');
1073 $this->data[
"cols"] = array(
"type",
"title");
1075 foreach(
$_POST[
"pglayout"] as $id)
1078 $pg_obj->readObject();
1079 $this->data[
"data"][
"$id"] = array(
1081 "title" => $pg_obj->getTitle()
1086 $this->data[
"buttons"] = array(
"cancelDeletePg" => $this->lng->txt(
"cancel"),
1087 "confirmedDeletePg" => $this->lng->txt(
"confirm"));
1093 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1096 foreach ($this->data[
"cols"] as $key)
1098 $this->tpl->setCurrentBlock(
"table_header");
1099 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
1100 $this->tpl->parseCurrentBlock();
1107 foreach($this->data[
"data"] as $key => $value)
1110 foreach($value as $key => $cell_data)
1112 $this->tpl->setCurrentBlock(
"table_cell");
1121 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1123 $this->tpl->parseCurrentBlock();
1126 $this->tpl->setCurrentBlock(
"table_row");
1128 $this->tpl->parseCurrentBlock();
1134 foreach($this->data[
"buttons"] as
$name => $value)
1136 $this->tpl->setCurrentBlock(
"operation_btn");
1137 $this->tpl->setVariable(
"BTN_NAME",
$name);
1138 $this->tpl->setVariable(
"BTN_VALUE",$value);
1139 $this->tpl->parseCurrentBlock();
1149 session_unregister(
"pglayout_user_delete");
1151 $this->ctrl->redirect($this,
"viewPageLayouts");
1160 global
$ilDB, $ilUser;
1164 foreach (
$_SESSION[
"pglayout_user_delete"] as $id)
1171 $this->ctrl->redirect($this,
"viewPageLayouts");
1178 $ilTabs->setTabActive(
'page_layouts');
1180 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1182 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1183 $this->form_gui->setTitle($lng->txt(
"sty_create_pgl"));
1185 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
1188 $title_input =
new ilTextInputGUI($lng->txt(
"title"),
"pgl_title");
1190 $title_input->setMaxLength(128);
1191 $title_input->setValue($this->layout_object->title);
1192 $title_input->setTitle($lng->txt(
"title"));
1193 $title_input->setRequired(
true);
1196 $desc_input->
setValue($this->layout_object->description);
1197 $desc_input->setRows(3);
1198 $desc_input->setCols(37);
1200 $ttype_input =
new ilSelectInputGUI($lng->txt(
"sty_based_on"),
"pgl_template");
1205 $options[
'-1'] = $lng->txt(
"none");
1207 foreach ($arr_templates as $templ) {
1208 $templ->readObject();
1209 $key = $templ->getId();
1210 $value = $templ->getTitle();
1211 $options[$key] = $value;
1214 $ttype_input->setOptions($options);
1215 $ttype_input->setValue(-1);
1216 $ttype_input->setRequired(
true);
1218 $desc_input->setTitle($lng->txt(
"description"));
1219 $desc_input->setRequired(
false);
1221 $this->form_gui->addItem($title_input);
1222 $this->form_gui->addItem($desc_input);
1223 $this->form_gui->addItem($ttype_input);
1226 $this->form_gui->addCommandButton(
"createPg", $lng->txt(
"save"));
1227 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
1229 $this->tpl->setContent($this->form_gui->getHTML());
1237 if(
$_POST[
"pgl_title"] ==
"")
1239 $this->ilias->raiseError($this->lng->txt(
"no_title"),$this->ilias->error_obj->MESSAGE);
1245 $pg_object->setTitle(
$_POST[
'pgl_title']);
1246 $pg_object->setDescription(
$_POST[
'pgl_desc']);
1247 $pg_object->update();
1249 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1252 if(!is_object($pg_content))
1257 $this->pg_content->setId($pg_object->getId());
1259 if (
$_POST[
'pgl_template'] !=
"-1") {
1261 $this->pg_content->setXMLContent($layout_obj->getXMLContent());
1262 $this->pg_content->create(
false);
1264 $this->pg_content->create(
false);
1267 $this->pg_id = $pg_object->getId();
1269 $ilCtrl->setCmdClass(
"ilpagelayoutgui");
1270 $ilCtrl->setCmd(
"edit");
1282 $ilCtrl->setCmdClass(
"ilpagelayoutgui");
1283 $ilCtrl->setCmd(
"edit");
1290 echo
"settings_setTabs";
1305 global $rbacsystem,
$lng, $ilTabs;
1307 if ($this->peditor_active) {
1308 $tabs_gui->setBackTarget($this->lng->txt(
"page_layouts"),
1309 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"));
1312 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()) && !$this->peditor_active)
1314 $tabs_gui->addTarget(
"basic_settings",
1315 $this->ctrl->getLinkTarget($this,
"editBasicSettings"), array(
"editBasicSettings",
"",
"view"),
"",
"");
1317 $tabs_gui->addTarget(
"system_styles",
1318 $this->ctrl->getLinkTarget($this,
"editSystemStyles"),
"editSystemStyles",
"",
"");
1320 $tabs_gui->addTarget(
"content_styles",
1321 $this->ctrl->getLinkTarget($this,
"editContentStyles"),
"editContentStyles",
"",
"");
1323 $tabs_gui->addTarget(
"page_layouts",
1324 $this->ctrl->getLinkTarget($this,
"viewPageLayouts"),
"viewPageLayouts",
"",
"");
1329 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()) && !$this->peditor_active)
1331 $tabs_gui->addTarget(
"perm_settings",
1332 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');