16 require_once
"./classes/class.ilObjectGUI.php";
17 require_once
"./Services/Style/classes/class.ilObjStyleSheet.php";
36 $this->lng->loadLanguageModule(
"style");
37 $ilCtrl->saveParameter($this, array(
"tag",
"style_type",
"temp_type"));
38 if (
$_GET[
"style_type"] !=
"")
44 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
52 $next_class = $this->ctrl->getNextClass($this);
53 $cmd = $this->ctrl->getCmd(
"edit");
85 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"sty_create_new_stylesheet"));
87 $this->tpl->setVariable(
"TXT_STYLE_BY_IMPORT", $this->lng->txt(
"sty_import_stylesheet"));
88 $this->tpl->setVariable(
"TXT_STYLE_BY_COPY", $this->lng->txt(
"sty_copy_other_stylesheet"));
89 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"import_file"));
90 $this->tpl->setVariable(
"TXT_SOURCE", $this->lng->txt(
"sty_source"));
91 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
92 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"description"));
94 $this->ctrl->setParameter($this,
"new_type",
"sty");
95 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
96 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
97 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
98 $this->tpl->setVariable(
"TXT_COPY", $this->lng->txt(
"copy"));
99 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
100 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
105 $this->tpl->setVariable(
"SOURCE_SELECT", $select);
114 $this->tpl->setCurrentBlock(
"ContentStyle");
115 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
116 $this->object->getContentStylePath($this->object->getId()));
117 $this->tpl->parseCurrentBlock();
125 global $rbacsystem,
$lng, $ilTabs,
$ilCtrl, $ilToolbar;
131 $ctpl =
new ilTemplate(
"tpl.sty_classes.html",
true,
true,
"Services/Style");
134 $chars = $this->
object->getCharacteristics();
136 $style_type = ($this->super_type !=
"")
139 $ilCtrl->setParameter($this,
"style_type", $style_type);
140 $ilTabs->setSubTabActive(
"sty_".$style_type.
"_char");
144 $subtypes = $all_super_types[$style_type];
146 foreach ($subtypes as
$t)
155 $ilToolbar->addButton($lng->txt(
"sty_add_characteristic"),
156 $ilCtrl->getLinkTarget($this,
"addCharacteristicForm"));
161 $style_cp = explode(
":::",
$_SESSION[
"sty_copy"]);
162 if ($style_cp[1] ==
$_GET[
"style_type"])
166 $ilToolbar->addSeparator();
168 $ilToolbar->addButton($lng->txt(
"sty_paste_style_classes"),
169 $ilCtrl->getLinkTarget($this,
"pasteCharacteristicsOverview"));
173 include_once(
"./Services/Style/classes/class.ilStyleTableGUI.php");
177 $ctpl->setCurrentBlock(
"style_table");
178 $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
179 $ctpl->parseCurrentBlock();
181 $this->tpl->setContent($ctpl->get());
189 global $rbacsystem,
$lng;
192 $this->tpl->setCurrentBlock(
"ContentStyle");
193 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
194 $this->object->getContentStylePath($this->object->getId()));
195 $this->tpl->parseCurrentBlock();
198 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
201 $this->tpl->setCurrentBlock(
"btn_cell");
202 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportStyle"));
203 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"export"));
204 $this->tpl->parseCurrentBlock();
208 $this->tpl->setContent($this->form->getHTML());
236 $values[
"style_title"] = $this->
object->getTitle();
237 $values[
"style_description"] = $this->
object->getDescription();
238 $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
240 $this->form->setValuesByArray($values);
251 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
255 $ti =
new ilTextInputGUI($this->lng->txt(
"title"),
"style_title");
258 $ti->setRequired(
true);
259 $this->form->addItem($ti);
265 $this->form->addItem($ta);
268 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"),
"disable_auto_margins");
269 $cb->
setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
270 $this->form->addItem($cb);
274 if ($a_mode ==
"create")
276 $this->form->addCommandButton(
"save", $lng->txt(
"save"));
277 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
281 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
284 $this->form->setTitle($lng->txt(
"edit_stylesheet"));
285 $this->form->setFormAction($this->ctrl->getFormAction($this));
297 if ($this->form->checkInput())
299 $this->
object->setTitle($this->form->getInput(
"style_title"));
300 $this->
object->setDescription($this->form->getInput(
"style_description"));
301 $this->
object->writeStyleSetting(
"disable_auto_margins",
302 $this->form->getInput(
"disable_auto_margins"));
303 $this->
object->update();
305 $ilCtrl->redirect($this,
"properties");
309 $this->form->setValuesByPost();
310 $tpl->setContent($this->form->getHtml());
321 $cur = explode(
".",
$_GET[
"tag"]);
323 $cur_class = $cur[1];
327 if ($this->form_gui->checkInput())
330 $ilCtrl->redirect($this,
"editTagStyle");
334 $this->form_gui->setValuesByPost();
346 $cur = explode(
".",
$_GET[
"tag"]);
348 $cur_class = $cur[1];
351 if ($this->form_gui->checkInput())
354 $ilCtrl->redirect($this,
"edit");
358 $this->form_gui->setValuesByPost();
368 $cur = explode(
".",
$_GET[
"tag"]);
370 $cur_class = $cur[1];
372 foreach ($avail_pars as $par => $v)
374 $var = str_replace(
"-",
"_", $par);
375 $basepar_arr = explode(
".", $par);
376 $basepar = $basepar_arr[0];
378 if ($basepar_arr[1] !=
"" && $basepar_arr[1] != $cur_tag)
386 case "numeric_no_perc":
388 case "background_image":
389 $in = $this->form_gui->getItemByPostVar($basepar);
395 $color = trim(
$_POST[$basepar]);
396 if ($color !=
"" && trim(substr($color,0,1) !=
"!"))
406 $in = $this->form_gui->getItemByPostVar($basepar);
407 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][0],
$in->getAllValue(),
$_GET[
"style_type"]);
408 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][1],
$in->getTopValue(),
$_GET[
"style_type"]);
409 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][2],
$in->getRightValue(),
$_GET[
"style_type"]);
410 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3],
$in->getBottomValue(),
$_GET[
"style_type"]);
411 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][4],
$in->getLeftValue(),
$_GET[
"style_type"]);
415 $in = $this->form_gui->getItemByPostVar($basepar);
416 $tblr_p = array (0 =>
"getAllValue", 1 =>
"getTopValue", 2 =>
"getRightValue",
417 3 =>
"getBottomValue", 4 =>
"getLeftValue");
418 foreach ($tblr_p as $k => $func)
420 $val = trim(
$in->$func());
421 $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) ==
"!")
425 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][$k], $val,
$_GET[
"style_type"]);
440 case "background_position":
441 $in = $this->form_gui->getItemByPostVar($basepar);
451 $this->
object->update();
463 $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type);
467 $this->
object->deleteStylePar($cur_tag, $cur_class, $par, $a_type);
479 $cur = explode(
".",
$_GET[
"tag"]);
481 $cur_class = $cur[1];
496 $tpl->setCurrentBlock(
"ContentStyle");
497 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
498 $this->object->getContentStylePath($this->object->getId()));
500 $ts_tpl =
new ilTemplate(
"tpl.style_tag_edit.html",
true,
true,
"Services/Style");
502 $cur = explode(
".",
$_GET[
"tag"]);
504 $cur_class = $cur[1];
506 $ts_tpl->setVariable(
"EXAMPLE",
509 $ts_tpl->setVariable(
"FORM",
510 $this->form_gui->getHtml());
512 $tpl->setTitle($cur_class.
" (".$lng->txt(
"sty_type_".$_GET[
"style_type"]).
")");
514 $tpl->setContent($ts_tpl->get());
527 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
530 $avail_pars = $this->
object->getAvailableParameters();
531 $groups = $this->
object->getStyleParameterGroups();
534 foreach ($groups as $k => $group)
539 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
545 $sh->setTitle($lng->txt(
"sty_".$k));
546 $this->form_gui->addItem($sh);
548 foreach ($group as $par)
550 $basepar = explode(
".", $par);
551 $basepar = $basepar[0];
553 $var = str_replace(
"-",
"_", $basepar);
554 $up_par = strtoupper($var);
560 $options = array(
"" =>
"");
561 foreach ($avail_pars[$par] as $p)
566 $this->form_gui->addItem($sel_input);
570 $text_input =
new ilTextInputGUI($lng->txt(
"sty_".$var), $basepar);
572 $text_input->setSize(20);
573 $this->form_gui->addItem($text_input);
577 include_once(
"./Services/Style/classes/class.ilFontSizeInputGUI.php");
579 $this->form_gui->addItem($fs_input);
582 case "numeric_no_perc":
584 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
590 $this->form_gui->addItem($num_input);
596 $per_input->setMaxValue(100);
597 $per_input->setMaxLength(3);
598 $per_input->setSize(3);
599 $this->form_gui->addItem($per_input);
606 $col_input->setAcceptNamedColors(
true);
607 $this->form_gui->addItem($col_input);
611 include_once(
"./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
617 $this->form_gui->addItem($num_input);
621 include_once(
"./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
623 $this->form_gui->addItem($bw_input);
627 include_once(
"./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
629 $this->form_gui->addItem($bw_input);
633 include_once(
"./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
636 $this->form_gui->addItem($col_input);
639 case "background_image":
640 include_once(
"./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
643 foreach ($this->object->getImages() as $entry)
645 $imgs[] = $entry[
"entry"];
648 $this->form_gui->addItem($im_input);
651 case "background_position":
652 include_once(
"./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
654 $this->form_gui->addItem($im_input);
661 $this->form_gui->addCommandButton(
"updateTagStyle", $lng->txt(
"save_return"));
662 $this->form_gui->addCommandButton(
"refreshTagStyle", $lng->txt(
"save_refresh"));
665 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
674 $style = $this->
object->getStyle();
675 $cur = explode(
".",
$_GET[
"tag"]);
677 $cur_class = $cur[1];
681 foreach($parameters as $p => $v)
684 if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]]))
688 $p = explode(
".", $p);
690 $input = $this->form_gui->getItemByPostVar($p);
700 $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
701 $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
702 $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
703 $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
704 $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
708 $input->setValue($cur_parameters[$p]);
719 $file = $this->
object->export();
726 $parameters = array();
727 foreach($a_style as $tag)
729 foreach($tag as $par)
731 if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
732 && $par[
"type"] == $a_type)
734 $parameters[$par[
"parameter"]] = $par[
"value"];
746 $this->
object->addParameter(
$_POST[
"tag"],
$_POST[
"parameter"]);
757 $this->
object->setTitle(
$_POST[
"style_title"]);
758 $this->
object->setDescription(
$_POST[
"style_description"]);
760 foreach(
$_POST[
"styval"] as $id => $value)
762 $this->
object->updateStyleParameter($id, $value);
764 $this->
object->update();
777 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
784 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
787 $this->tpl->setCurrentBlock(
"table_header");
788 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
789 $this->tpl->parseCurrentBlock();
796 $this->tpl->setCurrentBlock(
"table_row");
800 $this->tpl->parseCurrentBlock();
805 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
806 "cancelDelete" => $this->lng->txt(
"cancel"));
807 foreach ($buttons as
$name => $value)
809 $this->tpl->setCurrentBlock(
"operation_btn");
811 $this->tpl->setVariable(
"BTN_NAME",
$name);
812 $this->tpl->setVariable(
"BTN_VALUE",$value);
813 $this->tpl->parseCurrentBlock();
823 $this->ctrl->returnToParent($this);
833 $this->
object->delete();
835 $this->ctrl->returnToParent($this);
843 if (is_array(
$_POST[
"sty_select"]))
845 foreach(
$_POST[
"sty_select"] as $id => $dummy)
847 $this->
object->deleteParameter($id);
850 $this->
object->read();
851 $this->
object->writeCSSFile();
861 $class_name =
"ilObjStyleSheet";
862 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
864 $newObj->setTitle(
"-");
872 if (
$_GET[
"ref_id"] > 0)
876 if ($fold->getType() ==
"stys")
878 $fold->addStyle($newObj->getId());
881 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
885 return $newObj->getId();
895 if (
$_POST[
"source_style"] > 0)
896 $style_obj =& $ilias->obj_factory->getInstanceByObjId(
$_POST[
"source_style"]);
897 $new_id = $style_obj->ilClone();
901 if (
$_GET[
"ref_id"] > 0)
905 if ($fold->getType() ==
"stys")
907 $fold->addStyle($new_id);
910 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
923 $source = $_FILES[
"stylefile"][
"tmp_name"];
924 if (($source ==
'none') || (!$source))
926 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
930 $info = pathinfo($_FILES[
"stylefile"][
"name"]);
931 if (strtolower($info[
"extension"]) !=
"zip" && strtolower($info[
"extension"]) !=
"xml")
933 $this->ilias->raiseError(
"File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
936 $class_name =
"ilObjStyleSheet";
937 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
941 $newObj->import($_FILES[
"stylefile"]);
946 if (
$_GET[
"ref_id"] > 0)
950 if ($fold->getType() ==
"stys")
952 $fold->addStyle($newObj->getId());
955 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
959 return $newObj->getId();
970 $this->ctrl->returnToParent($this);
988 $this->
getTabs($this->tabs_gui);
990 if (strtolower(get_class($this->
object)) ==
"ilobjstylesheet")
992 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
996 $this->tpl->setVariable(
"HEADER", $lng->txt(
"create_stylesheet"));
1009 if ($ilCtrl->getCmd() ==
"editTagStyle")
1012 $tabs_gui->setBackTarget($lng->txt(
"back"),
1013 $ilCtrl->getLinkTarget($this,
"edit"));
1015 $t = explode(
".",
$_GET[
"tag"]);
1016 $t2 = explode(
":",
$t[1]);
1017 $pc = $this->
object->_getPseudoClasses(
$t[0]);
1018 if (is_array($pc) && count($pc) > 0)
1021 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0]);
1022 $tabs_gui->addTarget(
"sty_tag_normal",
1023 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1027 $ilTabs->setTabActive(
"sty_tag_normal");
1033 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0].
":".$p);
1034 $tabs_gui->addTarget(
"sty_tag_".$p,
1035 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1039 $ilTabs->setTabActive(
"sty_tag_".$p);
1042 $ilCtrl->setParameter($this,
"tag",
$_GET[
"tag"]);
1048 $tabs_gui->setBackTarget($lng->txt(
"back"),
1049 $this->ctrl->getLinkTarget($this,
"returnToUpperContext"));
1052 $tabs_gui->addTarget(
"sty_style_chars",
1053 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1057 $tabs_gui->addTarget(
"sty_colors",
1058 $this->ctrl->getLinkTarget($this,
"listColors"),
"listColors",
1062 $tabs_gui->addTarget(
"sty_images",
1063 $this->ctrl->getLinkTarget($this,
"listImages"),
"listImages",
1067 $tabs_gui->addTarget(
"sty_templates",
1068 $this->ctrl->getLinkTarget($this,
"listTemplates"),
"listTemplates",
1072 $tabs_gui->addTarget(
"settings",
1073 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1096 foreach ($types as $super_type => $types)
1099 $ilCtrl->setParameter($this,
"style_type", $super_type);
1100 $ilTabs->addSubTabTarget(
"sty_".$super_type.
"_char",
1101 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1105 $ilCtrl->setParameter($this,
"style_type",
$_GET[
"style_type"]);
1119 foreach ($types as
$t => $c)
1121 $ilCtrl->setParameter($this,
"temp_type",
$t);
1122 $ilTabs->addSubTabTarget(
"sty_".
$t.
"_templates",
1123 $this->ctrl->getLinkTarget($this,
"listTemplates"), array(
"listTemplates",
""),
1127 $ilCtrl->setParameter($this,
"temp_type",
$_GET[
"temp_type"]);
1138 if (
$_GET[
"admin_mode"] ==
"settings")
1140 $ilLocator->addItem($this->lng->txt(
"administration"),
1141 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
1146 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
"view"));
1148 if (
$_GET[
"obj_id"] > 0)
1150 $ilLocator->addItem($this->object->getTitle(),
1151 $this->ctrl->getLinkTarget($this,
"edit"));
1165 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1168 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
1169 "editContentStyles"));
1184 include_once(
"./Services/Style/classes/class.ilStyleImageTableGUI.php");
1187 $tpl->setContent($table_gui->getHTML());
1199 $tpl->setContent($this->form_gui->getHTML());
1209 $ilCtrl->redirect($this,
"listImages");
1221 if ($this->form_gui->checkInput())
1223 $this->
object->uploadImage($_FILES[
"image_file"]);
1224 $ilCtrl->redirect($this,
"listImages");
1229 $tpl->setContent($this->form_gui->getHTML());
1241 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1244 $this->form_gui->setTitle($lng->txt(
"sty_add_image"));
1248 $this->form_gui->addItem($file_input);
1250 $this->form_gui->addCommandButton(
"uploadImage", $lng->txt(
"upload"));
1251 $this->form_gui->addCommandButton(
"cancelUpload", $lng->txt(
"cancel"));
1252 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1262 $images = $this->
object->getImages();
1264 foreach ($images as $image)
1266 if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"],
$_POST[
"file"]))
1268 $this->
object->deleteImage($image[
"entry"]);
1271 $ilCtrl->redirect($this,
"listImages");
1283 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1286 $ilCtrl->redirect($this,
"edit");
1292 foreach (
$_POST[
"char"] as $char)
1294 if (!empty($core_styles[$char]))
1301 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1303 $cgui->setFormAction($ilCtrl->getFormAction($this));
1304 $cgui->setHeaderText($lng->txt(
"sty_confirm_char_deletion"));
1305 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1306 $cgui->setConfirm($lng->txt(
"delete"),
"deleteCharacteristic");
1308 foreach (
$_POST[
"char"] as $char)
1310 $char_comp = explode(
".", $char);
1311 $cgui->addItem(
"char[]", $char, $char_comp[2]);
1314 $tpl->setContent($cgui->getHTML());
1328 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1330 $cgui->setFormAction($ilCtrl->getFormAction($this));
1335 foreach (
$_POST[
"char"] as $char)
1337 if (!empty($core_styles[$char]))
1340 $char_comp = explode(
".", $char);
1341 $cgui->addItem(
"",
"", $char_comp[2]);
1345 $cgui->addHiddenItem(
"char[]", $char);
1348 $all_core_styles = ($cnt == count(
$_POST[
"char"]))
1352 if ($all_core_styles)
1354 $cgui->setHeaderText($lng->txt(
"sty_all_styles_obligatory"));
1355 $cgui->setCancel($lng->txt(
"back"),
"cancelCharacteristicDeletion");
1359 $cgui->setHeaderText($lng->txt(
"sty_some_styles_obligatory_delete_rest"));
1360 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1361 $cgui->setConfirm($lng->txt(
"sty_delete_other_selected"),
"deleteCharacteristicConfirmation");
1364 $tpl->setContent($cgui->getHTML());
1375 $ilCtrl->redirect($this,
"edit");
1385 if (is_array(
$_POST[
"char"]))
1387 foreach(
$_POST[
"char"] as $char)
1389 $char_comp = explode(
".", $char);
1390 $type = $char_comp[0];
1391 $tag = $char_comp[1];
1392 $class = $char_comp[2];
1394 $this->
object->deleteCharacteristic(
$type, $tag, $class);
1398 $ilCtrl->redirect($this,
"edit");
1409 $tpl->setContent($this->form_gui->getHTML());
1421 if ($this->form_gui->checkInput())
1423 if ($this->object->characteristicExists(
$_POST[
"new_characteristic"],
$_GET[
"style_type"]))
1425 $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
1426 $char_input->setAlert($lng->txt(
"sty_characteristic_already_exists"));
1430 $this->
object->addCharacteristic(
$_POST[
"type"],
$_POST[
"new_characteristic"]);
1432 $ilCtrl->setParameter($this,
"tag",
1434 $ilCtrl->setParameter($this,
"style_type", $_POST[
"type"]);
1435 $ilCtrl->redirect($this,
"editTagStyle");
1438 $this->form_gui->setValuesByPost();
1439 $tpl->setContent($this->form_gui->getHTML());
1451 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1455 $txt_input =
new ilRegExpInputGUI($lng->txt(
"title"),
"new_characteristic");
1456 $txt_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1457 $txt_input->setNoMatchMessage($lng->txt(
"sty_msg_characteristic_must_only_include").
" A-Z, a-z, 1-9");
1458 $txt_input->setRequired(
true);
1459 $this->form_gui->addItem($txt_input);
1463 $types = $all_super_types[$this->super_type];
1464 $exp_types = array();
1465 foreach($types as
$t)
1469 $exp_types[
$t] = $lng->txt(
"sty_type_".$t);
1472 if (count($exp_types) > 1)
1476 $type_input->setValue(key($exp_types));
1477 $this->form_gui->addItem($type_input);
1479 else if (count($exp_types) == 1)
1482 $hid_input->setValue(key($exp_types));
1483 $this->form_gui->addItem($hid_input);
1486 $this->form_gui->setTitle($lng->txt(
"sty_add_characteristic"));
1487 $this->form_gui->addCommandButton(
"saveCharacteristic", $lng->txt(
"save"));
1488 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"cancel"));
1489 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1499 $c = explode(
":", $a_class);
1502 $ex_tpl =
new ilTemplate(
"tpl.style_example.html",
true,
true,
"Services/Style");
1504 $ex_tpl->setCurrentBlock(
"Example_".$a_type);
1505 $ex_tpl->setVariable(
"EX_CLASS",
"ilc_".$a_type.
"_".$a_class);
1506 $ex_tpl->setVariable(
"EX_TEXT",
"ABC abc 123");
1507 if ($a_type ==
"media_cont")
1511 if (in_array($a_type, array(
"table",
"table_caption")))
1513 $ex_tpl->setVariable(
"TXT_CAPTION", $lng->txt(
"sty_caption"));
1515 $ex_tpl->parseCurrentBlock();
1517 return $ex_tpl->get();
1529 foreach (
$_POST[
"all_chars"] as $char)
1531 $ca = explode(
".", $char);
1532 $this->
object->saveHideStatus($ca[0], $ca[2],
1533 (is_array(
$_POST[
"hide"]) && in_array($char,
$_POST[
"hide"])));
1537 $ilCtrl->redirect($this,
"edit");
1550 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1556 $style_cp = implode(
"::",
$_POST[
"char"]);
1557 $style_cp = $this->
object->getId().
":::".
$_GET[
"style_type"].
":::".$style_cp;
1561 $ilCtrl->redirect($this,
"edit");
1572 global
$tpl, $ilTabs;
1574 $ilTabs->clearTargets();
1576 include_once(
"./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1579 $tpl->setContent($table->getHTML());
1592 if (is_array(
$_POST[
"title"]))
1594 foreach (
$_POST[
"title"] as $from_char => $to_title)
1596 $fc = explode(
".", $from_char);
1598 if (
$_POST[
"conflict_action"][$from_char] ==
"overwrite" ||
1599 !$this->object->characteristicExists($to_title, $fc[0]))
1601 $this->
object->copyCharacteristic(
$_POST[
"from_style_id"],
1602 $fc[0], $fc[2], $to_title);
1610 $ilCtrl->redirect($this,
"edit");
1624 include_once(
"./Services/Style/classes/class.ilStyleColorTableGUI.php");
1627 $tpl->setContent($table_gui->getHTML());
1639 $tpl->setContent($this->form_gui->getHTML());
1649 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1652 $tpl->setContent($this->form_gui->getHTML());
1663 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1666 $this->form_gui->setTitle($lng->txt(
"sty_add_color"));
1669 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_color_name"),
"color_name");
1670 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1671 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
1672 $name_input->setRequired(
true);
1673 $name_input->setSize(15);
1674 $name_input->setMaxLength(15);
1675 $this->form_gui->addItem($name_input);
1680 $color_input->setDefaultColor(
"");
1681 $this->form_gui->addItem($color_input);
1683 if ($a_mode ==
"create")
1685 $this->form_gui->addCommandButton(
"saveColor", $lng->txt(
"save"));
1686 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1690 $this->form_gui->addCommandButton(
"updateColor", $lng->txt(
"save"));
1691 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1693 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1701 if (
$_GET[
"c_name"] !=
"")
1703 $values[
"color_name"] =
$_GET[
"c_name"];
1704 $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
1705 $this->form_gui->setValuesByArray($values);
1716 $ilCtrl->redirect($this,
"listColors");
1728 if ($this->form_gui->checkInput())
1730 if ($this->object->colorExists(
$_POST[
"color_name"]))
1732 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1733 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1737 $this->
object->addColor(
$_POST[
"color_name"],
1739 $ilCtrl->redirect($this,
"listColors");
1742 $this->form_gui->setValuesByPost();
1743 $tpl->setContent($this->form_gui->getHTML());
1755 if ($this->form_gui->checkInput())
1757 if ($this->object->colorExists(
$_POST[
"color_name"]) &&
1760 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1761 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1765 $this->
object->updateColor(
$_GET[
"c_name"],
$_POST[
"color_name"],
1767 $ilCtrl->redirect($this,
"listColors");
1770 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1771 $this->form_gui->setValuesByPost();
1772 $tpl->setContent($this->form_gui->getHTML());
1782 if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0)
1785 $ilCtrl->redirect($this,
"listColors");
1789 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1791 $cgui->setFormAction($ilCtrl->getFormAction($this));
1792 $cgui->setHeaderText($lng->txt(
"sty_confirm_color_deletion"));
1793 $cgui->setCancel($lng->txt(
"cancel"),
"cancelColorDeletion");
1794 $cgui->setConfirm($lng->txt(
"delete"),
"deleteColor");
1796 foreach (
$_POST[
"color"] as $c)
1801 $tpl->setContent($cgui->getHTML());
1812 $ilCtrl->redirect($this,
"listColors");
1822 if (is_array(
$_POST[
"color"]))
1824 foreach (
$_POST[
"color"] as $c)
1826 $this->
object->removeColor($c);
1830 $ilCtrl->redirect($this,
"listColors");
1844 $ctype =
$_GET[
"temp_type"];
1848 $ilCtrl->setParameter($this,
"temp_type", $ctype);
1849 $_GET[
"temp_type"] = $ctype;
1853 $ilTabs->setSubTabActive(
"sty_".$ctype.
"_templates");
1856 include_once(
"./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
1859 $tpl->setContent($table_gui->getHTML());
1871 $tpl->setContent($this->form_gui->getHTML());
1881 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
1894 $this->
object, $a_type, $a_t_id, $a_small_mode);
1911 $ts = $a_style->getTemplate($a_t_id);
1912 $t = $ts[
"classes"];
1915 if ($a_type ==
"table")
1917 $p_content =
'<PageContent><Table DataTable="y"';
1918 if (
$t[
"row_head"] !=
"")
1920 $p_content.=
' HeaderRows="1"';
1922 if (
$t[
"row_foot"] !=
"")
1924 $p_content.=
' FooterRows="1"';
1926 if (
$t[
"col_head"] !=
"")
1928 $p_content.=
' HeaderCols="1"';
1930 if (
$t[
"col_foot"] !=
"")
1932 $p_content.=
' FooterCols="1"';
1934 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
1937 $p_content.=
'<Caption>'.$lng->txt(
"sty_caption").
'</Caption>';
1939 for($i = 1; $i<=$kr; $i++)
1941 $p_content.=
'<TableRow>';
1942 for($j = 1; $j<=$kc; $j++)
1946 $cell =
'<div style="height:2px;"></div>';
1952 $p_content.=
'<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.
'</Paragraph></PageContent></TableData>';
1954 $p_content.=
'</TableRow>';
1956 $p_content.=
'</Table></PageContent>';
1959 if ($a_type ==
"vaccordion" || $a_type ==
"haccordion")
1961 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
1974 if ($a_type ==
"vaccordion")
1976 $p_content =
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
1979 $p_content.=
' ContentWidth="70"';
1984 $p_content =
'<PageContent><Tabs Type="HorizontalAccordion"';
1987 $p_content.=
' ContentHeight="40"';
1988 $p_content.=
' ContentWidth="70"';
1989 $c =
'&nbsp;&nbsp;&nbsp;&nbsp;';
1993 $p_content.=
' ContentHeight="40"';
1996 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
1997 $p_content.=
'<Tab><PageContent><Paragraph>'.$c.
'</Paragraph></PageContent>';
1998 $p_content.=
'<TabCaption>'.$h.
'</TabCaption>';
1999 $p_content.=
'</Tab>';
2000 $p_content.=
'</Tabs></PageContent>';
2003 $txml = $a_style->getTemplateXML();
2006 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
2019 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2022 if ($a_mode ==
"create")
2024 $this->form_gui->setTitle($lng->txt(
"sty_add_template"));
2028 $this->form_gui->setTitle($lng->txt(
"sty_edit_template"));
2032 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2033 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2034 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2035 $name_input->setRequired(
true);
2036 $name_input->setSize(30);
2037 $name_input->setMaxLength(30);
2038 $this->form_gui->addItem($name_input);
2042 foreach ($scs as $sc => $st)
2044 $sc_input =
new ilSelectInputGUI($lng->txt(
"sty_".$sc.
"_class"), $sc.
"_class");
2045 $chars = $this->
object->getCharacteristics($st);
2046 $options = array(
"" =>
"");
2047 foreach($chars as $char)
2049 $options[$char] = $char;
2051 $sc_input->setOptions($options);
2052 $this->form_gui->addItem($sc_input);
2055 if ($a_mode ==
"create")
2057 $this->form_gui->addCommandButton(
"saveTemplate", $lng->txt(
"save"));
2058 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2062 $this->form_gui->addCommandButton(
"refreshTemplate", $lng->txt(
"save_refresh"));
2063 $this->form_gui->addCommandButton(
"updateTemplate", $lng->txt(
"save_return"));
2064 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2066 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2076 $ilCtrl->redirect($this,
"listTemplates");
2089 if ($this->form_gui->checkInput())
2091 if ($this->object->templateExists(
$_POST[
"name"]))
2093 $name_input = $this->form_gui->getItemByPostVar(
"name");
2094 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2101 $classes[$tct] =
$_POST[$tct.
"_class"];
2103 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
$_POST[
"name"], $classes);
2104 $this->
object->writeTemplatePreview($t_id,
2106 $ilCtrl->redirect($this,
"listTemplates");
2109 $this->form_gui->setValuesByPost();
2110 $tpl->setContent($this->form_gui->getHTML());
2120 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
2123 if ($this->form_gui->checkInput())
2125 if ($this->object->templateExists(
$_POST[
"name"]) &&
2128 $name_input = $this->form_gui->getItemByPostVar(
"name");
2129 $name_input->setAlert($lng->txt(
"sty_template_already_exists"));
2136 $classes[$tct] =
$_POST[$tct.
"_class"];
2139 $this->
object->updateTemplate(
$_GET[
"t_id"],
2140 $_POST[
"name"], $classes);
2141 $this->
object->writeTemplatePreview(
$_GET[
"t_id"],
2145 $ilCtrl->redirect($this,
"listTemplates");
2150 $this->form_gui->setValuesByPost();
2161 $a_tpl =
new ilTemplate(
"tpl.template_edit.html",
true,
true,
2164 $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
2166 $tpl->setContent($a_tpl->get());
2182 if (
$_GET[
"t_id"] > 0)
2184 $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
2186 $values[
"name"] =
$t[
"name"];
2188 foreach ($scs as $k =>
$type)
2190 $values[$k.
"_class"] =
$t[
"classes"][$k];
2192 $this->form_gui->setValuesByArray($values);
2203 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0)
2206 $ilCtrl->redirect($this,
"listTemplates");
2210 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2212 $cgui->setFormAction($ilCtrl->getFormAction($this));
2213 $cgui->setHeaderText($lng->txt(
"sty_confirm_template_deletion"));
2214 $cgui->setCancel($lng->txt(
"cancel"),
"cancelTemplateDeletion");
2215 $cgui->setConfirm($lng->txt(
"sty_del_template"),
"deleteTemplate");
2217 foreach (
$_POST[
"tid"] as $tid)
2219 $classes = $this->
object->getTemplateClasses($tid);
2222 foreach ($classes as $cl)
2224 if ($cl !=
"" && !$listed[$cl])
2226 $cl_str.=
'<div>- '.
2228 $listed[$cl] =
true;
2233 $cl_str =
'<div style="padding-left:30px;" class="small">'.
2234 "<div><i>".$lng->txt(
"sty_style_class").
"</i></div>".$cl_str.
"</div>";
2236 $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2239 $cgui->addButton($lng->txt(
"sty_del_template_keep_classes"),
"deleteTemplateKeepClasses");
2241 $tpl->setContent($cgui->getHTML());
2252 $ilCtrl->redirect($this,
"listTemplates");
2262 if (is_array(
$_POST[
"tid"]))
2264 foreach (
$_POST[
"tid"] as $tid)
2266 $this->
object->removeTemplate($tid);
2270 $ilCtrl->redirect($this,
"listTemplates");
2280 if (is_array(
$_POST[
"tid"]))
2282 foreach (
$_POST[
"tid"] as $tid)
2284 $cls = $this->
object->getTemplateClasses($tid);
2285 foreach ($cls as $k => $cls)
2287 $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
2289 $this->
object->deleteCharacteristic($ty, $ta, $cls);
2291 $this->
object->removeTemplate($tid);
2295 $ilCtrl->redirect($this,
"listTemplates");
2306 $tpl->setContent($this->form_gui->getHTML());
2316 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2319 $this->form_gui->setTitle($lng->txt(
"sty_generate_template"));
2322 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2323 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2324 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2325 $name_input->setRequired(
true);
2326 $name_input->setSize(30);
2327 $name_input->setMaxLength(30);
2328 $this->form_gui->addItem($name_input);
2331 $bl_input =
new ilSelectInputGUI($lng->txt(
"sty_template_layout"),
"layout");
2333 "coloredZebra" => $lng->txt(
"sty_table_template_colored_zebra"),
2334 "bwZebra" => $lng->txt(
"sty_table_template_bw_zebra"),
2335 "noZebra" => $lng->txt(
"sty_table_template_no_zebra")
2338 $this->form_gui->addItem($bl_input);
2341 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2344 $num_input->setValue(
"3px");
2345 $this->form_gui->addItem($num_input);
2350 $num_input->setValue(
"10px");
2351 $this->form_gui->addItem($num_input);
2354 $bc_input =
new ilSelectInputGUI($lng->txt(
"sty_base_color"),
"base_color");
2355 $cs = $this->
object->getColors();
2359 $options[$c[
"name"]] = $c[
"name"];
2362 $this->form_gui->addItem($bc_input);
2365 $lss = array(
"border" => 90,
"header_text" => 70,
"header_bg" => 0,
2366 "cell1_text" => -60,
"cell1_bg" => 90,
"cell2_text" => -60,
"cell2_bg" => 75);
2367 foreach ($lss as $ls => $v)
2369 $l_input =
new ilNumberInputGUI($lng->txt(
"sty_lightness_".$ls),
"lightness_".$ls);
2371 $l_input->setMinValue(-100);
2372 $l_input->setValue($v);
2373 $l_input->setSize(4);
2374 $l_input->setMaxLength(4);
2375 $this->form_gui->addItem($l_input);
2378 $this->form_gui->addCommandButton(
"templateGeneration", $lng->txt(
"generate"));
2379 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2380 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2392 if ($this->form_gui->checkInput())
2394 if ($this->object->templateExists(
$_POST[
"name"]))
2396 $name_input = $this->form_gui->getItemByPostVar(
"name");
2397 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2404 $cells = array(
"H" =>
"header",
"C1" =>
"cell1",
"C2" =>
"cell2");
2405 $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
2406 $tb_padding = $tb_p->getValue();
2407 $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
2408 $lr_padding = $lr_p->getValue();
2409 $cell_color =
$_POST[
"base_color"];
2412 if (
$_POST[
"layout"] ==
"bwZebra")
2414 $cell_color =
"MidGray";
2415 if (!$this->object->colorExists($cell_color))
2417 $this->
object->addColor($cell_color,
"7F7F7F");
2419 $this->
object->updateColor($cell_color, $cell_color,
"7F7F7F");
2422 foreach ($cells as $k => $cell)
2424 $cell_class[$k] =
$_POST[
"name"].$k;
2425 if (!$this->object->characteristicExists($cell_class[$k],
"table_cell"))
2427 $this->
object->addCharacteristic(
"table_cell", $cell_class[$k],
true);
2429 if (
$_POST[
"layout"] ==
"bwZebra" && $k ==
"H")
2431 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2432 "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2433 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2434 "!".$_POST[
"base_color"].
"(".$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2438 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2439 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2440 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2441 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2443 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-top",
2444 $tb_padding,
"table_cell");
2445 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-bottom",
2446 $tb_padding,
"table_cell");
2447 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-left",
2448 $lr_padding,
"table_cell");
2449 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-right",
2450 $lr_padding,
"table_cell");
2451 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-width",
2452 "1px",
"table_cell");
2453 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-style",
2454 "solid",
"table_cell");
2455 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-color",
2456 "!".$cell_color.
"(".
$_POST[
"lightness_border"].
")",
"table_cell");
2457 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"font-weight",
2458 "normal",
"table_cell");
2462 $classes[
"table"] =
$_POST[
"name"].
"T";
2463 if (!$this->object->characteristicExists($classes[
"table"],
"table"))
2465 $this->
object->addCharacteristic(
"table", $classes[
"table"],
true);
2467 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"caption-side",
2469 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-collapse",
2470 "collapse",
"table");
2471 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-top",
2473 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-bottom",
2475 if (
$_POST[
"layout"] ==
"bwZebra")
2477 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-color",
2478 "!".
$_POST[
"base_color"],
"table");
2479 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-style",
2481 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-width",
2483 $sb = array(
"left",
"right",
"top");
2486 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-".$b.
"-width",
2491 switch (
$_POST[
"layout"])
2493 case "coloredZebra":
2494 $classes[
"row_head"] = $cell_class[
"H"];
2495 $classes[
"odd_row"] = $cell_class[
"C1"];
2496 $classes[
"even_row"] = $cell_class[
"C2"];
2500 $classes[
"row_head"] = $cell_class[
"H"];
2501 $classes[
"odd_row"] = $cell_class[
"C1"];
2502 $classes[
"even_row"] = $cell_class[
"C2"];
2506 $classes[
"row_head"] = $cell_class[
"H"];
2507 $classes[
"odd_row"] = $cell_class[
"C1"];
2508 $classes[
"even_row"] = $cell_class[
"C1"];
2509 $classes[
"col_head"] = $cell_class[
"C2"];
2514 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
2515 $_POST[
"name"], $classes);
2516 $this->
object->writeTemplatePreview($t_id,
2518 $ilCtrl->redirect($this,
"listTemplates");
2521 $this->form_gui->setValuesByPost();
2522 $tpl->setContent($this->form_gui->getHTML());
2529 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2532 $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2533 $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2537 $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2538 $ac2->addItem(
"Header 2", $acc->getHTML());
2541 $tpl->setContent($ac2->getHTML());
2551 if (
$_GET[
"baseClass"] ==
"ilAdministrationGUI")
2553 $ilCtrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
2555 $ilCtrl->returnToParent($this);