16 require_once
"./Services/Object/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");
83 global $rbacsystem,
$lng,
$tpl, $ilHelp;
88 $ilHelp->setScreenIdComponent(
"sty");
93 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
95 $form->setFormAction($this->ctrl->getFormAction($this));
96 $form->setTitle($this->lng->txt(
"sty_create_new_stylesheet"));
102 $ti->setRequired(
true);
111 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
112 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
119 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
121 $form->setFormAction($this->ctrl->getFormAction($this));
122 $form->setTitle($this->lng->txt(
"sty_import_stylesheet"));
125 $ti =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"stylefile");
129 $form->addCommandButton(
"importStyle", $this->lng->txt(
"import"));
130 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
137 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
139 $form->setFormAction($this->ctrl->getFormAction($this));
140 $form->setTitle($this->lng->txt(
"sty_copy_other_stylesheet"));
148 $form->addCommandButton(
"copyStyle", $this->lng->txt(
"copy"));
149 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
163 $this->tpl->setCurrentBlock(
"ContentStyle");
164 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
165 $this->object->getContentStylePath($this->object->getId()));
166 $this->tpl->parseCurrentBlock();
180 $ctpl =
new ilTemplate(
"tpl.sty_classes.html",
true,
true,
"Services/Style");
183 $chars = $this->
object->getCharacteristics();
185 $style_type = ($this->super_type !=
"")
188 $ilCtrl->setParameter($this,
"style_type", $style_type);
189 $ilTabs->setSubTabActive(
"sty_".$style_type.
"_char");
192 if ($this->super_type ==
"rte")
194 $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
195 include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
196 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
201 $subtypes = $all_super_types[$style_type];
203 foreach ($subtypes as
$t)
210 if ($expandable && $rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
212 $ilToolbar->addButton($lng->txt(
"sty_add_characteristic"),
213 $ilCtrl->getLinkTarget($this,
"addCharacteristicForm"));
218 $style_cp = explode(
":::",
$_SESSION[
"sty_copy"]);
219 if ($style_cp[1] == $_GET[
"style_type"])
223 $ilToolbar->addSeparator();
225 $ilToolbar->addButton($lng->txt(
"sty_paste_style_classes"),
226 $ilCtrl->getLinkTarget($this,
"pasteCharacteristicsOverview"));
230 include_once(
"./Services/Style/classes/class.ilStyleTableGUI.php");
234 $ctpl->setCurrentBlock(
"style_table");
235 $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
236 $ctpl->parseCurrentBlock();
238 $this->tpl->setContent($ctpl->get());
246 global $rbacsystem,
$lng, $ilToolbar;
249 $this->tpl->setCurrentBlock(
"ContentStyle");
250 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
251 $this->object->getContentStylePath($this->object->getId()));
252 $this->tpl->parseCurrentBlock();
255 $ilToolbar->addButton($this->lng->txt(
"export"),
256 $this->ctrl->getLinkTarget($this,
"exportStyle"));
260 $this->tpl->setContent($this->form->getHTML());
271 $values[
"style_title"] = $this->
object->getTitle();
272 $values[
"style_description"] = $this->
object->getDescription();
273 $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
275 $this->form->setValuesByArray($values);
285 global
$lng, $rbacsystem;
287 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
291 $ti =
new ilTextInputGUI($this->lng->txt(
"title"),
"style_title");
294 $ti->setRequired(
true);
295 $this->form->addItem($ti);
301 $this->form->addItem($ta);
304 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"),
"disable_auto_margins");
305 $cb->
setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
306 $this->form->addItem($cb);
310 if ($a_mode ==
"create")
312 $this->form->addCommandButton(
"save", $lng->txt(
"save"));
313 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
317 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
319 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
323 $this->form->setTitle($lng->txt(
"edit_stylesheet"));
324 $this->form->setFormAction($this->ctrl->getFormAction($this));
336 if ($this->form->checkInput())
338 $this->
object->setTitle($this->form->getInput(
"style_title"));
339 $this->
object->setDescription($this->form->getInput(
"style_description"));
340 $this->
object->writeStyleSetting(
"disable_auto_margins",
341 $this->form->getInput(
"disable_auto_margins"));
342 $this->
object->update();
344 $ilCtrl->redirect($this,
"properties");
348 $this->form->setValuesByPost();
349 $tpl->setContent($this->form->getHtml());
360 $cur = explode(
".",
$_GET[
"tag"]);
362 $cur_class = $cur[1];
366 if ($this->form_gui->checkInput())
369 $ilCtrl->redirect($this,
"editTagStyle");
373 $this->form_gui->setValuesByPost();
385 $cur = explode(
".",
$_GET[
"tag"]);
387 $cur_class = $cur[1];
390 if ($this->form_gui->checkInput())
393 $ilCtrl->redirect($this,
"edit");
397 $this->form_gui->setValuesByPost();
407 $cur = explode(
".",
$_GET[
"tag"]);
409 $cur_class = $cur[1];
411 foreach ($avail_pars as $par => $v)
413 $var = str_replace(
"-",
"_", $par);
414 $basepar_arr = explode(
".", $par);
415 $basepar = $basepar_arr[0];
416 if ($basepar_arr[1] !=
"" && $basepar_arr[1] != $cur_tag)
424 case "numeric_no_perc":
426 case "background_image":
427 $in = $this->form_gui->getItemByPostVar($basepar);
433 $color = trim(
$_POST[$basepar]);
434 if ($color !=
"" && trim(substr($color,0,1) !=
"!"))
444 $in = $this->form_gui->getItemByPostVar($basepar);
445 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][0],
$in->getAllValue(),
$_GET[
"style_type"]);
446 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][1],
$in->getTopValue(),
$_GET[
"style_type"]);
447 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][2],
$in->getRightValue(),
$_GET[
"style_type"]);
448 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3],
$in->getBottomValue(),
$_GET[
"style_type"]);
449 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][4],
$in->getLeftValue(),
$_GET[
"style_type"]);
453 $in = $this->form_gui->getItemByPostVar($basepar);
454 $tblr_p = array (0 =>
"getAllValue", 1 =>
"getTopValue", 2 =>
"getRightValue",
455 3 =>
"getBottomValue", 4 =>
"getLeftValue");
456 foreach ($tblr_p as $k => $func)
458 $val = trim(
$in->$func());
459 $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) ==
"!")
463 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][$k], $val,
$_GET[
"style_type"]);
478 case "background_position":
479 $in = $this->form_gui->getItemByPostVar($basepar);
489 $this->
object->update();
501 $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type);
505 $this->
object->deleteStylePar($cur_tag, $cur_class, $par, $a_type);
519 if ($this->super_type ==
"rte")
521 $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
522 include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
523 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
526 $cur = explode(
".",
$_GET[
"tag"]);
528 $cur_class = $cur[1];
543 $tpl->setCurrentBlock(
"ContentStyle");
544 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
545 $this->object->getContentStylePath($this->object->getId()));
547 $ts_tpl =
new ilTemplate(
"tpl.style_tag_edit.html",
true,
true,
"Services/Style");
549 $cur = explode(
".",
$_GET[
"tag"]);
551 $cur_class = $cur[1];
553 $ts_tpl->setVariable(
"EXAMPLE",
556 $ts_tpl->setVariable(
"FORM",
557 $this->form_gui->getHtml());
559 $tpl->setTitle($cur_class.
" (".$lng->txt(
"sty_type_".$_GET[
"style_type"]).
")");
561 $tpl->setContent($ts_tpl->get());
574 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
577 $avail_pars = $this->
object->getAvailableParameters();
578 $groups = $this->
object->getStyleParameterGroups();
581 foreach ($groups as $k => $group)
586 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
592 $sh->setTitle($lng->txt(
"sty_".$k));
593 $this->form_gui->addItem($sh);
595 foreach ($group as $par)
597 $basepar = explode(
".", $par);
598 $basepar = $basepar[0];
600 $var = str_replace(
"-",
"_", $basepar);
601 $up_par = strtoupper($var);
608 foreach ($avail_pars[$par] as $p)
613 $this->form_gui->addItem($sel_input);
617 $text_input =
new ilTextInputGUI($lng->txt(
"sty_".$var), $basepar);
619 $text_input->setSize(20);
620 $this->form_gui->addItem($text_input);
624 include_once(
"./Services/Style/classes/class.ilFontSizeInputGUI.php");
626 $this->form_gui->addItem($fs_input);
629 case "numeric_no_perc":
631 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
637 $this->form_gui->addItem($num_input);
643 $per_input->setMaxValue(100);
644 $per_input->setMaxLength(3);
645 $per_input->setSize(3);
646 $this->form_gui->addItem($per_input);
653 $col_input->setAcceptNamedColors(
true);
654 $this->form_gui->addItem($col_input);
658 include_once(
"./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
664 $this->form_gui->addItem($num_input);
668 include_once(
"./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
670 $this->form_gui->addItem($bw_input);
674 include_once(
"./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
676 $this->form_gui->addItem($bw_input);
680 include_once(
"./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
683 $this->form_gui->addItem($col_input);
686 case "background_image":
687 include_once(
"./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
690 foreach ($this->object->getImages() as $entry)
692 $imgs[] = $entry[
"entry"];
695 $this->form_gui->addItem($im_input);
698 case "background_position":
699 include_once(
"./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
701 $this->form_gui->addItem($im_input);
708 $this->form_gui->addCommandButton(
"updateTagStyle", $lng->txt(
"save_return"));
709 $this->form_gui->addCommandButton(
"refreshTagStyle", $lng->txt(
"save_refresh"));
712 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
721 $style = $this->
object->getStyle();
722 $cur = explode(
".",
$_GET[
"tag"]);
724 $cur_class = $cur[1];
728 foreach($parameters as $p => $v)
731 if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]]))
735 $p = explode(
".", $p);
737 $input = $this->form_gui->getItemByPostVar($p);
747 $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
748 $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
749 $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
750 $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
751 $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
755 $input->setValue($cur_parameters[$p]);
766 $file = $this->
object->export();
773 $parameters = array();
774 foreach($a_style as $tag)
776 foreach($tag as $par)
778 if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
779 && $par[
"type"] == $a_type)
781 $parameters[$par[
"parameter"]] = $par[
"value"];
793 $this->
object->addParameter(
$_POST[
"tag"],
$_POST[
"parameter"]);
802 $this->
object->setTitle(
$_POST[
"style_title"]);
803 $this->
object->setDescription(
$_POST[
"style_description"]);
805 foreach(
$_POST[
"styval"] as $id => $value)
807 $this->
object->updateStyleParameter($id, $value);
809 $this->
object->update();
823 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
825 $cgui->setFormAction($this->ctrl->getFormAction($this));
826 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
827 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDelete");
828 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmedDelete");
831 " ".ilObject::_lookupTitle($this->object->getId());
833 $cgui->addItem(
"id[]",
"", $caption);
835 $this->tpl->setContent($cgui->getHTML());
844 $this->ctrl->returnToParent($this);
854 $this->
object->delete();
856 $this->ctrl->returnToParent($this);
864 if (is_array(
$_POST[
"sty_select"]))
866 foreach(
$_POST[
"sty_select"] as $id => $dummy)
868 $this->
object->deleteParameter($id);
871 $this->
object->read();
872 $this->
object->writeCSSFile();
881 if(!trim(
$_POST[
"style_title"]))
883 $this->ctrl->redirect($this,
"create");
887 $class_name =
"ilObjStyleSheet";
888 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
890 $newObj->setTitle(
"-");
898 if (
$_GET[
"ref_id"] > 0)
902 if ($fold->getType() ==
"stys")
904 $fold->addStyle($newObj->getId());
907 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
911 return $newObj->getId();
921 if (
$_POST[
"source_style"] > 0)
922 $style_obj =& $ilias->obj_factory->getInstanceByObjId(
$_POST[
"source_style"]);
923 $new_id = $style_obj->ilClone();
927 if (
$_GET[
"ref_id"] > 0)
931 if ($fold->getType() ==
"stys")
933 $fold->addStyle($new_id);
936 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
949 $source = $_FILES[
"stylefile"][
"tmp_name"];
950 if (($source ==
'none') || (!$source))
952 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
956 $info = pathinfo($_FILES[
"stylefile"][
"name"]);
957 if (strtolower($info[
"extension"]) !=
"zip" && strtolower($info[
"extension"]) !=
"xml")
959 $this->ilias->raiseError(
"File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
962 $class_name =
"ilObjStyleSheet";
963 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
967 $newObj->import($_FILES[
"stylefile"]);
972 if (
$_GET[
"ref_id"] > 0)
976 if ($fold->getType() ==
"stys")
978 $fold->addStyle($newObj->getId());
981 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
985 return $newObj->getId();
996 $this->ctrl->returnToParent($this);
1014 $this->
getTabs($this->tabs_gui);
1016 if (strtolower(get_class($this->
object)) ==
"ilobjstylesheet")
1018 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
1022 $this->tpl->setVariable(
"HEADER", $lng->txt(
"create_stylesheet"));
1035 $ilHelp->setScreenIdComponent(
"sty");
1037 if ($ilCtrl->getCmd() ==
"editTagStyle")
1040 $tabs_gui->setBackTarget($lng->txt(
"back"),
1041 $ilCtrl->getLinkTarget($this,
"edit"));
1043 $t = explode(
".",
$_GET[
"tag"]);
1044 $t2 = explode(
":",
$t[1]);
1045 $pc = $this->
object->_getPseudoClasses(
$t[0]);
1046 if (is_array($pc) && count($pc) > 0)
1049 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0]);
1050 $tabs_gui->addTarget(
"sty_tag_normal",
1051 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1055 $ilTabs->setTabActive(
"sty_tag_normal");
1061 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0].
":".$p);
1062 $tabs_gui->addTarget(
"sty_tag_".$p,
1063 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1067 $ilTabs->setTabActive(
"sty_tag_".$p);
1070 $ilCtrl->setParameter($this,
"tag",
$_GET[
"tag"]);
1076 $tabs_gui->setBackTarget($lng->txt(
"back"),
1077 $this->ctrl->getLinkTarget($this,
"returnToUpperContext"));
1080 $tabs_gui->addTarget(
"sty_style_chars",
1081 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1085 $tabs_gui->addTarget(
"sty_colors",
1086 $this->ctrl->getLinkTarget($this,
"listColors"),
"listColors",
1090 $tabs_gui->addTarget(
"sty_images",
1091 $this->ctrl->getLinkTarget($this,
"listImages"),
"listImages",
1095 $tabs_gui->addTarget(
"sty_templates",
1096 $this->ctrl->getLinkTarget($this,
"listTemplates"),
"listTemplates",
1100 $tabs_gui->addTarget(
"settings",
1101 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1124 foreach ($types as $super_type => $types)
1127 $ilCtrl->setParameter($this,
"style_type", $super_type);
1128 $ilTabs->addSubTabTarget(
"sty_".$super_type.
"_char",
1129 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1133 $ilCtrl->setParameter($this,
"style_type",
$_GET[
"style_type"]);
1147 foreach ($types as
$t => $c)
1149 $ilCtrl->setParameter($this,
"temp_type",
$t);
1150 $ilTabs->addSubTabTarget(
"sty_".
$t.
"_templates",
1151 $this->ctrl->getLinkTarget($this,
"listTemplates"), array(
"listTemplates",
""),
1155 $ilCtrl->setParameter($this,
"temp_type",
$_GET[
"temp_type"]);
1166 if (
$_GET[
"admin_mode"] ==
"settings")
1172 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
"view"));
1174 if (
$_GET[
"obj_id"] > 0)
1176 $ilLocator->addItem($this->object->getTitle(),
1177 $this->ctrl->getLinkTarget($this,
"edit"));
1191 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1194 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
1195 "editContentStyles"));
1210 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1212 $ilToolbar->addButton($lng->txt(
"sty_add_image"),
1213 $ilCtrl->getLinkTarget($this,
"addImage"));
1216 include_once(
"./Services/Style/classes/class.ilStyleImageTableGUI.php");
1219 $tpl->setContent($table_gui->getHTML());
1231 $tpl->setContent($this->form_gui->getHTML());
1241 $ilCtrl->redirect($this,
"listImages");
1253 if ($this->form_gui->checkInput())
1255 $this->
object->uploadImage($_FILES[
"image_file"]);
1256 $ilCtrl->redirect($this,
"listImages");
1261 $tpl->setContent($this->form_gui->getHTML());
1273 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1276 $this->form_gui->setTitle($lng->txt(
"sty_add_image"));
1280 $this->form_gui->addItem($file_input);
1282 $this->form_gui->addCommandButton(
"uploadImage", $lng->txt(
"upload"));
1283 $this->form_gui->addCommandButton(
"cancelUpload", $lng->txt(
"cancel"));
1284 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1294 $images = $this->
object->getImages();
1296 foreach ($images as $image)
1298 if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"],
$_POST[
"file"]))
1300 $this->
object->deleteImage($image[
"entry"]);
1303 $ilCtrl->redirect($this,
"listImages");
1315 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1318 $ilCtrl->redirect($this,
"edit");
1324 foreach (
$_POST[
"char"] as $char)
1326 if (!empty($core_styles[$char]))
1333 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1335 $cgui->setFormAction($ilCtrl->getFormAction($this));
1336 $cgui->setHeaderText($lng->txt(
"sty_confirm_char_deletion"));
1337 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1338 $cgui->setConfirm($lng->txt(
"delete"),
"deleteCharacteristic");
1340 foreach (
$_POST[
"char"] as $char)
1342 $char_comp = explode(
".", $char);
1343 $cgui->addItem(
"char[]", $char, $char_comp[2]);
1346 $tpl->setContent($cgui->getHTML());
1360 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1362 $cgui->setFormAction($ilCtrl->getFormAction($this));
1367 foreach (
$_POST[
"char"] as $char)
1369 if (!empty($core_styles[$char]))
1372 $char_comp = explode(
".", $char);
1373 $cgui->addItem(
"",
"", $char_comp[2]);
1377 $cgui->addHiddenItem(
"char[]", $char);
1380 $all_core_styles = ($cnt == count(
$_POST[
"char"]))
1384 if ($all_core_styles)
1386 $cgui->setHeaderText($lng->txt(
"sty_all_styles_obligatory"));
1387 $cgui->setCancel($lng->txt(
"back"),
"cancelCharacteristicDeletion");
1391 $cgui->setHeaderText($lng->txt(
"sty_some_styles_obligatory_delete_rest"));
1392 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1393 $cgui->setConfirm($lng->txt(
"sty_delete_other_selected"),
"deleteCharacteristicConfirmation");
1396 $tpl->setContent($cgui->getHTML());
1407 $ilCtrl->redirect($this,
"edit");
1417 if (is_array(
$_POST[
"char"]))
1419 foreach(
$_POST[
"char"] as $char)
1421 $char_comp = explode(
".", $char);
1422 $type = $char_comp[0];
1423 $tag = $char_comp[1];
1424 $class = $char_comp[2];
1426 $this->
object->deleteCharacteristic($type, $tag, $class);
1430 $ilCtrl->redirect($this,
"edit");
1441 $tpl->setContent($this->form_gui->getHTML());
1453 if ($this->form_gui->checkInput())
1455 if ($this->object->characteristicExists(
$_POST[
"new_characteristic"],
$_GET[
"style_type"]))
1457 $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
1458 $char_input->setAlert($lng->txt(
"sty_characteristic_already_exists"));
1462 $this->
object->addCharacteristic(
$_POST[
"type"],
$_POST[
"new_characteristic"]);
1464 $ilCtrl->setParameter($this,
"tag",
1466 $ilCtrl->setParameter($this,
"style_type", $_POST[
"type"]);
1467 $ilCtrl->redirect($this,
"editTagStyle");
1470 $this->form_gui->setValuesByPost();
1471 $tpl->setContent($this->form_gui->getHTML());
1483 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1487 $txt_input =
new ilRegExpInputGUI($lng->txt(
"title"),
"new_characteristic");
1488 $txt_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1489 $txt_input->setNoMatchMessage($lng->txt(
"sty_msg_characteristic_must_only_include").
" A-Z, a-z, 1-9");
1490 $txt_input->setRequired(
true);
1491 $this->form_gui->addItem($txt_input);
1495 $types = $all_super_types[$this->super_type];
1496 $exp_types = array();
1497 foreach($types as
$t)
1501 $exp_types[
$t] = $lng->txt(
"sty_type_".$t);
1504 if (count($exp_types) > 1)
1508 $type_input->setValue(key($exp_types));
1509 $this->form_gui->addItem($type_input);
1511 else if (count($exp_types) == 1)
1514 $hid_input->setValue(key($exp_types));
1515 $this->form_gui->addItem($hid_input);
1518 $this->form_gui->setTitle($lng->txt(
"sty_add_characteristic"));
1519 $this->form_gui->addCommandButton(
"saveCharacteristic", $lng->txt(
"save"));
1520 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"cancel"));
1521 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1531 $c = explode(
":", $a_class);
1534 $ex_tpl =
new ilTemplate(
"tpl.style_example.html",
true,
true,
"Services/Style");
1536 $ex_tpl->setCurrentBlock(
"Example_".$a_type);
1537 $ex_tpl->setVariable(
"EX_CLASS",
"ilc_".$a_type.
"_".$a_class);
1538 $ex_tpl->setVariable(
"EX_TEXT",
"ABC abc 123");
1539 if (in_array($a_type, array(
"media_cont",
"qimg")))
1543 if (in_array($a_type, array(
"table",
"table_caption")))
1545 $ex_tpl->setVariable(
"TXT_CAPTION", $lng->txt(
"sty_caption"));
1547 if (in_array($a_class, array(
"OrderListItemHorizontal",
"OrderListHorizontal")))
1549 $ex_tpl->setVariable(
"HOR",
"Horizontal");
1551 $ex_tpl->parseCurrentBlock();
1553 return $ex_tpl->get();
1565 foreach (
$_POST[
"all_chars"] as $char)
1567 $ca = explode(
".", $char);
1568 $this->
object->saveHideStatus($ca[0], $ca[2],
1569 (is_array(
$_POST[
"hide"]) && in_array($char,
$_POST[
"hide"])));
1573 $ilCtrl->redirect($this,
"edit");
1586 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1592 $style_cp = implode(
"::",
$_POST[
"char"]);
1593 $style_cp = $this->
object->getId().
":::".
$_GET[
"style_type"].
":::".$style_cp;
1597 $ilCtrl->redirect($this,
"edit");
1608 global
$tpl, $ilTabs;
1610 $ilTabs->clearTargets();
1612 include_once(
"./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1615 $tpl->setContent($table->getHTML());
1628 if (is_array(
$_POST[
"title"]))
1630 foreach (
$_POST[
"title"] as $from_char => $to_title)
1632 $fc = explode(
".", $from_char);
1634 if (
$_POST[
"conflict_action"][$from_char] ==
"overwrite" ||
1635 !$this->object->characteristicExists($to_title, $fc[0]))
1637 $this->
object->copyCharacteristic(
$_POST[
"from_style_id"],
1638 $fc[0], $fc[2], $to_title);
1646 $ilCtrl->redirect($this,
"edit");
1660 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1662 $ilToolbar->addButton($this->lng->txt(
"sty_add_color"),
1663 $ilCtrl->getLinkTarget($this,
"addColor"));
1666 include_once(
"./Services/Style/classes/class.ilStyleColorTableGUI.php");
1669 $tpl->setContent($table_gui->getHTML());
1681 $tpl->setContent($this->form_gui->getHTML());
1691 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1694 $tpl->setContent($this->form_gui->getHTML());
1705 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1708 $this->form_gui->setTitle($lng->txt(
"sty_add_color"));
1711 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_color_name"),
"color_name");
1712 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1713 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
1714 $name_input->setRequired(
true);
1715 $name_input->setSize(15);
1716 $name_input->setMaxLength(15);
1717 $this->form_gui->addItem($name_input);
1722 $color_input->setDefaultColor(
"");
1723 $this->form_gui->addItem($color_input);
1725 if ($a_mode ==
"create")
1727 $this->form_gui->addCommandButton(
"saveColor", $lng->txt(
"save"));
1728 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1732 $this->form_gui->addCommandButton(
"updateColor", $lng->txt(
"save"));
1733 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1735 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1743 if (
$_GET[
"c_name"] !=
"")
1745 $values[
"color_name"] =
$_GET[
"c_name"];
1746 $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
1747 $this->form_gui->setValuesByArray($values);
1758 $ilCtrl->redirect($this,
"listColors");
1770 if ($this->form_gui->checkInput())
1772 if ($this->object->colorExists(
$_POST[
"color_name"]))
1774 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1775 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1779 $this->
object->addColor(
$_POST[
"color_name"],
1781 $ilCtrl->redirect($this,
"listColors");
1784 $this->form_gui->setValuesByPost();
1785 $tpl->setContent($this->form_gui->getHTML());
1797 if ($this->form_gui->checkInput())
1799 if ($this->object->colorExists(
$_POST[
"color_name"]) &&
1802 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1803 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1807 $this->
object->updateColor(
$_GET[
"c_name"],
$_POST[
"color_name"],
1809 $ilCtrl->redirect($this,
"listColors");
1812 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1813 $this->form_gui->setValuesByPost();
1814 $tpl->setContent($this->form_gui->getHTML());
1824 if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0)
1827 $ilCtrl->redirect($this,
"listColors");
1831 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1833 $cgui->setFormAction($ilCtrl->getFormAction($this));
1834 $cgui->setHeaderText($lng->txt(
"sty_confirm_color_deletion"));
1835 $cgui->setCancel($lng->txt(
"cancel"),
"cancelColorDeletion");
1836 $cgui->setConfirm($lng->txt(
"delete"),
"deleteColor");
1838 foreach (
$_POST[
"color"] as $c)
1843 $tpl->setContent($cgui->getHTML());
1854 $ilCtrl->redirect($this,
"listColors");
1864 if (is_array(
$_POST[
"color"]))
1866 foreach (
$_POST[
"color"] as $c)
1868 $this->
object->removeColor($c);
1872 $ilCtrl->redirect($this,
"listColors");
1886 $ctype =
$_GET[
"temp_type"];
1890 $ilCtrl->setParameter($this,
"temp_type", $ctype);
1891 $_GET[
"temp_type"] = $ctype;
1895 $ilTabs->setSubTabActive(
"sty_".$ctype.
"_templates");
1898 include_once(
"./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
1901 $tpl->setContent($table_gui->getHTML());
1913 $tpl->setContent($this->form_gui->getHTML());
1923 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
1936 $this->
object, $a_type, $a_t_id, $a_small_mode);
1953 $ts = $a_style->getTemplate($a_t_id);
1954 $t = $ts[
"classes"];
1957 if ($a_type ==
"table")
1959 $p_content =
'<PageContent><Table DataTable="y"';
1960 if (
$t[
"row_head"] !=
"")
1962 $p_content.=
' HeaderRows="1"';
1964 if (
$t[
"row_foot"] !=
"")
1966 $p_content.=
' FooterRows="1"';
1968 if (
$t[
"col_head"] !=
"")
1970 $p_content.=
' HeaderCols="1"';
1972 if (
$t[
"col_foot"] !=
"")
1974 $p_content.=
' FooterCols="1"';
1976 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
1979 $p_content.=
'<Caption>'.$lng->txt(
"sty_caption").
'</Caption>';
1981 for($i = 1; $i<=$kr; $i++)
1983 $p_content.=
'<TableRow>';
1984 for($j = 1; $j<=$kc; $j++)
1988 $cell =
'<div style="height:2px;"></div>';
1994 $p_content.=
'<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.
'</Paragraph></PageContent></TableData>';
1996 $p_content.=
'</TableRow>';
1998 $p_content.=
'</Table></PageContent>';
2001 if ($a_type ==
"vaccordion" || $a_type ==
"haccordion")
2003 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2016 if ($a_type ==
"vaccordion")
2018 $p_content =
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2021 $p_content.=
' ContentWidth="70"';
2026 $p_content =
'<PageContent><Tabs Type="HorizontalAccordion"';
2029 $p_content.=
' ContentHeight="40"';
2030 $p_content.=
' ContentWidth="70"';
2031 $c =
'&nbsp;&nbsp;&nbsp;&nbsp;';
2035 $p_content.=
' ContentHeight="40"';
2038 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
2039 $p_content.=
'<Tab><PageContent><Paragraph>'.$c.
'</Paragraph></PageContent>';
2040 $p_content.=
'<TabCaption>'.$h.
'</TabCaption>';
2041 $p_content.=
'</Tab>';
2042 $p_content.=
'</Tabs></PageContent>';
2045 $txml = $a_style->getTemplateXML();
2048 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
2061 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2064 if ($a_mode ==
"create")
2066 $this->form_gui->setTitle($lng->txt(
"sty_add_template"));
2070 $this->form_gui->setTitle($lng->txt(
"sty_edit_template"));
2074 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2075 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2076 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2077 $name_input->setRequired(
true);
2078 $name_input->setSize(30);
2079 $name_input->setMaxLength(30);
2080 $this->form_gui->addItem($name_input);
2084 foreach ($scs as $sc => $st)
2086 $sc_input =
new ilSelectInputGUI($lng->txt(
"sty_".$sc.
"_class"), $sc.
"_class");
2087 $chars = $this->
object->getCharacteristics($st);
2089 foreach($chars as $char)
2094 $this->form_gui->addItem($sc_input);
2097 if ($a_mode ==
"create")
2099 $this->form_gui->addCommandButton(
"saveTemplate", $lng->txt(
"save"));
2100 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2104 $this->form_gui->addCommandButton(
"refreshTemplate", $lng->txt(
"save_refresh"));
2105 $this->form_gui->addCommandButton(
"updateTemplate", $lng->txt(
"save_return"));
2106 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2108 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2118 $ilCtrl->redirect($this,
"listTemplates");
2131 if ($this->form_gui->checkInput())
2133 if ($this->object->templateExists(
$_POST[
"name"]))
2135 $name_input = $this->form_gui->getItemByPostVar(
"name");
2136 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2143 $classes[$tct] =
$_POST[$tct.
"_class"];
2145 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
$_POST[
"name"], $classes);
2146 $this->
object->writeTemplatePreview($t_id,
2148 $ilCtrl->redirect($this,
"listTemplates");
2151 $this->form_gui->setValuesByPost();
2152 $tpl->setContent($this->form_gui->getHTML());
2162 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
2165 if ($this->form_gui->checkInput())
2167 if ($this->object->templateExists(
$_POST[
"name"]) &&
2170 $name_input = $this->form_gui->getItemByPostVar(
"name");
2171 $name_input->setAlert($lng->txt(
"sty_template_already_exists"));
2178 $classes[$tct] =
$_POST[$tct.
"_class"];
2181 $this->
object->updateTemplate(
$_GET[
"t_id"],
2182 $_POST[
"name"], $classes);
2183 $this->
object->writeTemplatePreview(
$_GET[
"t_id"],
2187 $ilCtrl->redirect($this,
"listTemplates");
2192 $this->form_gui->setValuesByPost();
2203 $a_tpl =
new ilTemplate(
"tpl.template_edit.html",
true,
true,
2206 $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
2208 $tpl->setContent($a_tpl->get());
2224 if (
$_GET[
"t_id"] > 0)
2226 $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
2228 $values[
"name"] =
$t[
"name"];
2230 foreach ($scs as $k => $type)
2232 $values[$k.
"_class"] =
$t[
"classes"][$k];
2234 $this->form_gui->setValuesByArray($values);
2245 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0)
2248 $ilCtrl->redirect($this,
"listTemplates");
2252 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2254 $cgui->setFormAction($ilCtrl->getFormAction($this));
2255 $cgui->setHeaderText($lng->txt(
"sty_confirm_template_deletion"));
2256 $cgui->setCancel($lng->txt(
"cancel"),
"cancelTemplateDeletion");
2257 $cgui->setConfirm($lng->txt(
"sty_del_template"),
"deleteTemplate");
2259 foreach (
$_POST[
"tid"] as $tid)
2261 $classes = $this->
object->getTemplateClasses($tid);
2264 foreach ($classes as $cl)
2266 if ($cl !=
"" && !$listed[$cl])
2268 $cl_str.=
'<div>- '.
2270 $listed[$cl] =
true;
2275 $cl_str =
'<div style="padding-left:30px;" class="small">'.
2276 "<div><i>".$lng->txt(
"sty_style_class").
"</i></div>".$cl_str.
"</div>";
2278 $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2281 $cgui->addButton($lng->txt(
"sty_del_template_keep_classes"),
"deleteTemplateKeepClasses");
2283 $tpl->setContent($cgui->getHTML());
2294 $ilCtrl->redirect($this,
"listTemplates");
2304 if (is_array(
$_POST[
"tid"]))
2306 foreach (
$_POST[
"tid"] as $tid)
2308 $this->
object->removeTemplate($tid);
2312 $ilCtrl->redirect($this,
"listTemplates");
2322 if (is_array(
$_POST[
"tid"]))
2324 foreach (
$_POST[
"tid"] as $tid)
2326 $cls = $this->
object->getTemplateClasses($tid);
2327 foreach ($cls as $k => $cls)
2329 $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
2331 $this->
object->deleteCharacteristic($ty, $ta, $cls);
2333 $this->
object->removeTemplate($tid);
2337 $ilCtrl->redirect($this,
"listTemplates");
2348 $tpl->setContent($this->form_gui->getHTML());
2358 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2361 $this->form_gui->setTitle($lng->txt(
"sty_generate_template"));
2364 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2365 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2366 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2367 $name_input->setRequired(
true);
2368 $name_input->setSize(30);
2369 $name_input->setMaxLength(30);
2370 $this->form_gui->addItem($name_input);
2373 $bl_input =
new ilSelectInputGUI($lng->txt(
"sty_template_layout"),
"layout");
2375 "coloredZebra" => $lng->txt(
"sty_table_template_colored_zebra"),
2376 "bwZebra" => $lng->txt(
"sty_table_template_bw_zebra"),
2377 "noZebra" => $lng->txt(
"sty_table_template_no_zebra")
2379 $bl_input->setOptions($options);
2380 $this->form_gui->addItem($bl_input);
2383 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2386 $num_input->setValue(
"3px");
2387 $this->form_gui->addItem($num_input);
2392 $num_input->setValue(
"10px");
2393 $this->form_gui->addItem($num_input);
2396 $bc_input =
new ilSelectInputGUI($lng->txt(
"sty_base_color"),
"base_color");
2397 $cs = $this->
object->getColors();
2401 $options[$c[
"name"]] = $c[
"name"];
2404 $this->form_gui->addItem($bc_input);
2407 $lss = array(
"border" => 90,
"header_text" => 70,
"header_bg" => 0,
2408 "cell1_text" => -60,
"cell1_bg" => 90,
"cell2_text" => -60,
"cell2_bg" => 75);
2409 foreach ($lss as $ls => $v)
2411 $l_input =
new ilNumberInputGUI($lng->txt(
"sty_lightness_".$ls),
"lightness_".$ls);
2413 $l_input->setMinValue(-100);
2414 $l_input->setValue($v);
2415 $l_input->setSize(4);
2416 $l_input->setMaxLength(4);
2417 $this->form_gui->addItem($l_input);
2420 $this->form_gui->addCommandButton(
"templateGeneration", $lng->txt(
"generate"));
2421 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2422 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2434 if ($this->form_gui->checkInput())
2436 if ($this->object->templateExists(
$_POST[
"name"]))
2438 $name_input = $this->form_gui->getItemByPostVar(
"name");
2439 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2446 $cells = array(
"H" =>
"header",
"C1" =>
"cell1",
"C2" =>
"cell2");
2447 $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
2448 $tb_padding = $tb_p->getValue();
2449 $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
2450 $lr_padding = $lr_p->getValue();
2451 $cell_color =
$_POST[
"base_color"];
2454 if (
$_POST[
"layout"] ==
"bwZebra")
2456 $cell_color =
"MidGray";
2457 if (!$this->object->colorExists($cell_color))
2459 $this->
object->addColor($cell_color,
"7F7F7F");
2461 $this->
object->updateColor($cell_color, $cell_color,
"7F7F7F");
2464 foreach ($cells as $k => $cell)
2466 $cell_class[$k] =
$_POST[
"name"].$k;
2467 if (!$this->object->characteristicExists($cell_class[$k],
"table_cell"))
2469 $this->
object->addCharacteristic(
"table_cell", $cell_class[$k],
true);
2471 if (
$_POST[
"layout"] ==
"bwZebra" && $k ==
"H")
2473 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2474 "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2475 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2476 "!".$_POST[
"base_color"].
"(".$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2480 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2481 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2482 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2483 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2485 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-top",
2486 $tb_padding,
"table_cell");
2487 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-bottom",
2488 $tb_padding,
"table_cell");
2489 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-left",
2490 $lr_padding,
"table_cell");
2491 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-right",
2492 $lr_padding,
"table_cell");
2493 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-width",
2494 "1px",
"table_cell");
2495 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-style",
2496 "solid",
"table_cell");
2497 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-color",
2498 "!".$cell_color.
"(".
$_POST[
"lightness_border"].
")",
"table_cell");
2499 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"font-weight",
2500 "normal",
"table_cell");
2504 $classes[
"table"] =
$_POST[
"name"].
"T";
2505 if (!$this->object->characteristicExists($classes[
"table"],
"table"))
2507 $this->
object->addCharacteristic(
"table", $classes[
"table"],
true);
2509 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"caption-side",
2511 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-collapse",
2512 "collapse",
"table");
2513 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-top",
2515 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-bottom",
2517 if (
$_POST[
"layout"] ==
"bwZebra")
2519 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-color",
2520 "!".
$_POST[
"base_color"],
"table");
2521 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-style",
2523 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-width",
2525 $sb = array(
"left",
"right",
"top");
2528 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-".$b.
"-width",
2533 switch (
$_POST[
"layout"])
2535 case "coloredZebra":
2536 $classes[
"row_head"] = $cell_class[
"H"];
2537 $classes[
"odd_row"] = $cell_class[
"C1"];
2538 $classes[
"even_row"] = $cell_class[
"C2"];
2542 $classes[
"row_head"] = $cell_class[
"H"];
2543 $classes[
"odd_row"] = $cell_class[
"C1"];
2544 $classes[
"even_row"] = $cell_class[
"C2"];
2548 $classes[
"row_head"] = $cell_class[
"H"];
2549 $classes[
"odd_row"] = $cell_class[
"C1"];
2550 $classes[
"even_row"] = $cell_class[
"C1"];
2551 $classes[
"col_head"] = $cell_class[
"C2"];
2556 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
2557 $_POST[
"name"], $classes);
2558 $this->
object->writeTemplatePreview($t_id,
2560 $ilCtrl->redirect($this,
"listTemplates");
2563 $this->form_gui->setValuesByPost();
2564 $tpl->setContent($this->form_gui->getHTML());
2571 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2574 $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2575 $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2579 $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2580 $ac2->addItem(
"Header 2", $acc->getHTML());
2583 $tpl->setContent($ac2->getHTML());
2593 if (
$_GET[
"baseClass"] ==
"ilAdministrationGUI")
2595 $ilCtrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
2597 $ilCtrl->returnToParent($this);