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();
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");
143 if ($this->super_type ==
"rte")
145 $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
146 include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
147 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
152 $subtypes = $all_super_types[$style_type];
154 foreach ($subtypes as
$t)
161 if ($expandable && $rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
163 $ilToolbar->addButton($lng->txt(
"sty_add_characteristic"),
164 $ilCtrl->getLinkTarget($this,
"addCharacteristicForm"));
169 $style_cp = explode(
":::",
$_SESSION[
"sty_copy"]);
170 if ($style_cp[1] == $_GET[
"style_type"])
174 $ilToolbar->addSeparator();
176 $ilToolbar->addButton($lng->txt(
"sty_paste_style_classes"),
177 $ilCtrl->getLinkTarget($this,
"pasteCharacteristicsOverview"));
181 include_once(
"./Services/Style/classes/class.ilStyleTableGUI.php");
185 $ctpl->setCurrentBlock(
"style_table");
186 $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
187 $ctpl->parseCurrentBlock();
189 $this->tpl->setContent($ctpl->get());
197 global $rbacsystem,
$lng, $ilToolbar;
200 $this->tpl->setCurrentBlock(
"ContentStyle");
201 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
202 $this->object->getContentStylePath($this->object->getId()));
203 $this->tpl->parseCurrentBlock();
206 $ilToolbar->addButton($this->lng->txt(
"export"),
207 $this->ctrl->getLinkTarget($this,
"exportStyle"));
211 $this->tpl->setContent($this->form->getHTML());
223 $values[
"style_title"] = $this->
object->getTitle();
224 $values[
"style_description"] = $this->
object->getDescription();
225 $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
227 $this->form->setValuesByArray($values);
237 global
$lng, $rbacsystem;
239 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
243 $ti =
new ilTextInputGUI($this->lng->txt(
"title"),
"style_title");
246 $ti->setRequired(
true);
247 $this->form->addItem($ti);
253 $this->form->addItem($ta);
256 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"),
"disable_auto_margins");
257 $cb->
setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
258 $this->form->addItem($cb);
262 if ($a_mode ==
"create")
264 $this->form->addCommandButton(
"save", $lng->txt(
"save"));
265 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
269 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
271 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
275 $this->form->setTitle($lng->txt(
"edit_stylesheet"));
276 $this->form->setFormAction($this->ctrl->getFormAction($this));
288 if ($this->form->checkInput())
290 $this->
object->setTitle($this->form->getInput(
"style_title"));
291 $this->
object->setDescription($this->form->getInput(
"style_description"));
292 $this->
object->writeStyleSetting(
"disable_auto_margins",
293 $this->form->getInput(
"disable_auto_margins"));
294 $this->
object->update();
296 $ilCtrl->redirect($this,
"properties");
300 $this->form->setValuesByPost();
301 $tpl->setContent($this->form->getHtml());
312 $cur = explode(
".",
$_GET[
"tag"]);
314 $cur_class = $cur[1];
318 if ($this->form_gui->checkInput())
321 $ilCtrl->redirect($this,
"editTagStyle");
325 $this->form_gui->setValuesByPost();
337 $cur = explode(
".",
$_GET[
"tag"]);
339 $cur_class = $cur[1];
342 if ($this->form_gui->checkInput())
345 $ilCtrl->redirect($this,
"edit");
349 $this->form_gui->setValuesByPost();
359 $cur = explode(
".",
$_GET[
"tag"]);
361 $cur_class = $cur[1];
363 foreach ($avail_pars as $par => $v)
365 $var = str_replace(
"-",
"_", $par);
366 $basepar_arr = explode(
".", $par);
367 $basepar = $basepar_arr[0];
368 if ($basepar_arr[1] !=
"" && $basepar_arr[1] != $cur_tag)
376 case "numeric_no_perc":
378 case "background_image":
379 $in = $this->form_gui->getItemByPostVar($basepar);
385 $color = trim(
$_POST[$basepar]);
386 if ($color !=
"" && trim(substr($color,0,1) !=
"!"))
396 $in = $this->form_gui->getItemByPostVar($basepar);
397 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][0],
$in->getAllValue(),
$_GET[
"style_type"]);
398 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][1],
$in->getTopValue(),
$_GET[
"style_type"]);
399 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][2],
$in->getRightValue(),
$_GET[
"style_type"]);
400 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3],
$in->getBottomValue(),
$_GET[
"style_type"]);
401 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][4],
$in->getLeftValue(),
$_GET[
"style_type"]);
405 $in = $this->form_gui->getItemByPostVar($basepar);
406 $tblr_p = array (0 =>
"getAllValue", 1 =>
"getTopValue", 2 =>
"getRightValue",
407 3 =>
"getBottomValue", 4 =>
"getLeftValue");
408 foreach ($tblr_p as $k => $func)
410 $val = trim(
$in->$func());
411 $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) ==
"!")
415 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][$k], $val,
$_GET[
"style_type"]);
430 case "background_position":
431 $in = $this->form_gui->getItemByPostVar($basepar);
441 $this->
object->update();
453 $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type);
457 $this->
object->deleteStylePar($cur_tag, $cur_class, $par, $a_type);
471 if ($this->super_type ==
"rte")
473 $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
474 include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
475 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
478 $cur = explode(
".",
$_GET[
"tag"]);
480 $cur_class = $cur[1];
495 $tpl->setCurrentBlock(
"ContentStyle");
496 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
497 $this->object->getContentStylePath($this->object->getId()));
499 $ts_tpl =
new ilTemplate(
"tpl.style_tag_edit.html",
true,
true,
"Services/Style");
501 $cur = explode(
".",
$_GET[
"tag"]);
503 $cur_class = $cur[1];
505 $ts_tpl->setVariable(
"EXAMPLE",
508 $ts_tpl->setVariable(
"FORM",
509 $this->form_gui->getHtml());
511 $tpl->setTitle($cur_class.
" (".$lng->txt(
"sty_type_".$_GET[
"style_type"]).
")");
513 $tpl->setContent($ts_tpl->get());
526 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
529 $avail_pars = $this->
object->getAvailableParameters();
530 $groups = $this->
object->getStyleParameterGroups();
533 foreach ($groups as $k => $group)
538 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
544 $sh->setTitle($lng->txt(
"sty_".$k));
545 $this->form_gui->addItem($sh);
547 foreach ($group as $par)
549 $basepar = explode(
".", $par);
550 $basepar = $basepar[0];
552 $var = str_replace(
"-",
"_", $basepar);
553 $up_par = strtoupper($var);
559 $options = array(
"" =>
"");
560 foreach ($avail_pars[$par] as $p)
565 $this->form_gui->addItem($sel_input);
569 $text_input =
new ilTextInputGUI($lng->txt(
"sty_".$var), $basepar);
571 $text_input->setSize(20);
572 $this->form_gui->addItem($text_input);
576 include_once(
"./Services/Style/classes/class.ilFontSizeInputGUI.php");
578 $this->form_gui->addItem($fs_input);
581 case "numeric_no_perc":
583 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
589 $this->form_gui->addItem($num_input);
595 $per_input->setMaxValue(100);
596 $per_input->setMaxLength(3);
597 $per_input->setSize(3);
598 $this->form_gui->addItem($per_input);
605 $col_input->setAcceptNamedColors(
true);
606 $this->form_gui->addItem($col_input);
610 include_once(
"./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
616 $this->form_gui->addItem($num_input);
620 include_once(
"./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
622 $this->form_gui->addItem($bw_input);
626 include_once(
"./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
628 $this->form_gui->addItem($bw_input);
632 include_once(
"./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
635 $this->form_gui->addItem($col_input);
638 case "background_image":
639 include_once(
"./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
642 foreach ($this->object->getImages() as $entry)
644 $imgs[] = $entry[
"entry"];
647 $this->form_gui->addItem($im_input);
650 case "background_position":
651 include_once(
"./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
653 $this->form_gui->addItem($im_input);
660 $this->form_gui->addCommandButton(
"updateTagStyle", $lng->txt(
"save_return"));
661 $this->form_gui->addCommandButton(
"refreshTagStyle", $lng->txt(
"save_refresh"));
664 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
673 $style = $this->
object->getStyle();
674 $cur = explode(
".",
$_GET[
"tag"]);
676 $cur_class = $cur[1];
680 foreach($parameters as $p => $v)
683 if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]]))
687 $p = explode(
".", $p);
689 $input = $this->form_gui->getItemByPostVar($p);
699 $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
700 $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
701 $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
702 $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
703 $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
707 $input->setValue($cur_parameters[$p]);
718 $file = $this->
object->export();
725 $parameters = array();
726 foreach($a_style as $tag)
728 foreach($tag as $par)
730 if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
731 && $par[
"type"] == $a_type)
733 $parameters[$par[
"parameter"]] = $par[
"value"];
745 $this->
object->addParameter(
$_POST[
"tag"],
$_POST[
"parameter"]);
756 $this->
object->setTitle(
$_POST[
"style_title"]);
757 $this->
object->setDescription(
$_POST[
"style_description"]);
759 foreach(
$_POST[
"styval"] as $id => $value)
761 $this->
object->updateStyleParameter($id, $value);
763 $this->
object->update();
776 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html");
783 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
786 $this->tpl->setCurrentBlock(
"table_header");
787 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"objects"));
788 $this->tpl->parseCurrentBlock();
795 $this->tpl->setCurrentBlock(
"table_row");
799 $this->tpl->parseCurrentBlock();
804 $buttons = array(
"confirmedDelete" => $this->lng->txt(
"confirm"),
805 "cancelDelete" => $this->lng->txt(
"cancel"));
806 foreach ($buttons as $name => $value)
808 $this->tpl->setCurrentBlock(
"operation_btn");
810 $this->tpl->setVariable(
"BTN_NAME",$name);
811 $this->tpl->setVariable(
"BTN_VALUE",$value);
812 $this->tpl->parseCurrentBlock();
822 $this->ctrl->returnToParent($this);
832 $this->
object->delete();
834 $this->ctrl->returnToParent($this);
842 if (is_array(
$_POST[
"sty_select"]))
844 foreach(
$_POST[
"sty_select"] as $id => $dummy)
846 $this->
object->deleteParameter($id);
849 $this->
object->read();
850 $this->
object->writeCSSFile();
860 $class_name =
"ilObjStyleSheet";
861 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
863 $newObj->setTitle(
"-");
871 if (
$_GET[
"ref_id"] > 0)
875 if ($fold->getType() ==
"stys")
877 $fold->addStyle($newObj->getId());
880 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
884 return $newObj->getId();
894 if (
$_POST[
"source_style"] > 0)
895 $style_obj =& $ilias->obj_factory->getInstanceByObjId(
$_POST[
"source_style"]);
896 $new_id = $style_obj->ilClone();
900 if (
$_GET[
"ref_id"] > 0)
904 if ($fold->getType() ==
"stys")
906 $fold->addStyle($new_id);
909 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
922 $source = $_FILES[
"stylefile"][
"tmp_name"];
923 if (($source ==
'none') || (!$source))
925 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
929 $info = pathinfo($_FILES[
"stylefile"][
"name"]);
930 if (strtolower($info[
"extension"]) !=
"zip" && strtolower($info[
"extension"]) !=
"xml")
932 $this->ilias->raiseError(
"File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
935 $class_name =
"ilObjStyleSheet";
936 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
940 $newObj->import($_FILES[
"stylefile"]);
945 if (
$_GET[
"ref_id"] > 0)
949 if ($fold->getType() ==
"stys")
951 $fold->addStyle($newObj->getId());
954 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
958 return $newObj->getId();
969 $this->ctrl->returnToParent($this);
987 $this->
getTabs($this->tabs_gui);
989 if (strtolower(get_class($this->
object)) ==
"ilobjstylesheet")
991 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
995 $this->tpl->setVariable(
"HEADER", $lng->txt(
"create_stylesheet"));
1008 if ($ilCtrl->getCmd() ==
"editTagStyle")
1011 $tabs_gui->setBackTarget($lng->txt(
"back"),
1012 $ilCtrl->getLinkTarget($this,
"edit"));
1014 $t = explode(
".",
$_GET[
"tag"]);
1015 $t2 = explode(
":",
$t[1]);
1016 $pc = $this->
object->_getPseudoClasses(
$t[0]);
1017 if (is_array($pc) && count($pc) > 0)
1020 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0]);
1021 $tabs_gui->addTarget(
"sty_tag_normal",
1022 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1026 $ilTabs->setTabActive(
"sty_tag_normal");
1032 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0].
":".$p);
1033 $tabs_gui->addTarget(
"sty_tag_".$p,
1034 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1038 $ilTabs->setTabActive(
"sty_tag_".$p);
1041 $ilCtrl->setParameter($this,
"tag",
$_GET[
"tag"]);
1047 $tabs_gui->setBackTarget($lng->txt(
"back"),
1048 $this->ctrl->getLinkTarget($this,
"returnToUpperContext"));
1051 $tabs_gui->addTarget(
"sty_style_chars",
1052 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1056 $tabs_gui->addTarget(
"sty_colors",
1057 $this->ctrl->getLinkTarget($this,
"listColors"),
"listColors",
1061 $tabs_gui->addTarget(
"sty_images",
1062 $this->ctrl->getLinkTarget($this,
"listImages"),
"listImages",
1066 $tabs_gui->addTarget(
"sty_templates",
1067 $this->ctrl->getLinkTarget($this,
"listTemplates"),
"listTemplates",
1071 $tabs_gui->addTarget(
"settings",
1072 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1095 foreach ($types as $super_type => $types)
1098 $ilCtrl->setParameter($this,
"style_type", $super_type);
1099 $ilTabs->addSubTabTarget(
"sty_".$super_type.
"_char",
1100 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1104 $ilCtrl->setParameter($this,
"style_type",
$_GET[
"style_type"]);
1118 foreach ($types as
$t => $c)
1120 $ilCtrl->setParameter($this,
"temp_type",
$t);
1121 $ilTabs->addSubTabTarget(
"sty_".
$t.
"_templates",
1122 $this->ctrl->getLinkTarget($this,
"listTemplates"), array(
"listTemplates",
""),
1126 $ilCtrl->setParameter($this,
"temp_type",
$_GET[
"temp_type"]);
1137 if (
$_GET[
"admin_mode"] ==
"settings")
1139 $ilLocator->addItem($this->lng->txt(
"administration"),
1140 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
1145 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
"view"));
1147 if (
$_GET[
"obj_id"] > 0)
1149 $ilLocator->addItem($this->object->getTitle(),
1150 $this->ctrl->getLinkTarget($this,
"edit"));
1164 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1167 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
1168 "editContentStyles"));
1183 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1185 $ilToolbar->addButton($lng->txt(
"sty_add_image"),
1186 $ilCtrl->getLinkTarget($this,
"addImage"));
1189 include_once(
"./Services/Style/classes/class.ilStyleImageTableGUI.php");
1192 $tpl->setContent($table_gui->getHTML());
1204 $tpl->setContent($this->form_gui->getHTML());
1214 $ilCtrl->redirect($this,
"listImages");
1226 if ($this->form_gui->checkInput())
1228 $this->
object->uploadImage($_FILES[
"image_file"]);
1229 $ilCtrl->redirect($this,
"listImages");
1234 $tpl->setContent($this->form_gui->getHTML());
1246 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1249 $this->form_gui->setTitle($lng->txt(
"sty_add_image"));
1253 $this->form_gui->addItem($file_input);
1255 $this->form_gui->addCommandButton(
"uploadImage", $lng->txt(
"upload"));
1256 $this->form_gui->addCommandButton(
"cancelUpload", $lng->txt(
"cancel"));
1257 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1267 $images = $this->
object->getImages();
1269 foreach ($images as $image)
1271 if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"],
$_POST[
"file"]))
1273 $this->
object->deleteImage($image[
"entry"]);
1276 $ilCtrl->redirect($this,
"listImages");
1288 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1291 $ilCtrl->redirect($this,
"edit");
1297 foreach (
$_POST[
"char"] as $char)
1299 if (!empty($core_styles[$char]))
1306 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1308 $cgui->setFormAction($ilCtrl->getFormAction($this));
1309 $cgui->setHeaderText($lng->txt(
"sty_confirm_char_deletion"));
1310 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1311 $cgui->setConfirm($lng->txt(
"delete"),
"deleteCharacteristic");
1313 foreach (
$_POST[
"char"] as $char)
1315 $char_comp = explode(
".", $char);
1316 $cgui->addItem(
"char[]", $char, $char_comp[2]);
1319 $tpl->setContent($cgui->getHTML());
1333 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1335 $cgui->setFormAction($ilCtrl->getFormAction($this));
1340 foreach (
$_POST[
"char"] as $char)
1342 if (!empty($core_styles[$char]))
1345 $char_comp = explode(
".", $char);
1346 $cgui->addItem(
"",
"", $char_comp[2]);
1350 $cgui->addHiddenItem(
"char[]", $char);
1353 $all_core_styles = ($cnt == count(
$_POST[
"char"]))
1357 if ($all_core_styles)
1359 $cgui->setHeaderText($lng->txt(
"sty_all_styles_obligatory"));
1360 $cgui->setCancel($lng->txt(
"back"),
"cancelCharacteristicDeletion");
1364 $cgui->setHeaderText($lng->txt(
"sty_some_styles_obligatory_delete_rest"));
1365 $cgui->setCancel($lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1366 $cgui->setConfirm($lng->txt(
"sty_delete_other_selected"),
"deleteCharacteristicConfirmation");
1369 $tpl->setContent($cgui->getHTML());
1380 $ilCtrl->redirect($this,
"edit");
1390 if (is_array(
$_POST[
"char"]))
1392 foreach(
$_POST[
"char"] as $char)
1394 $char_comp = explode(
".", $char);
1395 $type = $char_comp[0];
1396 $tag = $char_comp[1];
1397 $class = $char_comp[2];
1399 $this->
object->deleteCharacteristic($type, $tag, $class);
1403 $ilCtrl->redirect($this,
"edit");
1414 $tpl->setContent($this->form_gui->getHTML());
1426 if ($this->form_gui->checkInput())
1428 if ($this->object->characteristicExists(
$_POST[
"new_characteristic"],
$_GET[
"style_type"]))
1430 $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
1431 $char_input->setAlert($lng->txt(
"sty_characteristic_already_exists"));
1435 $this->
object->addCharacteristic(
$_POST[
"type"],
$_POST[
"new_characteristic"]);
1437 $ilCtrl->setParameter($this,
"tag",
1439 $ilCtrl->setParameter($this,
"style_type", $_POST[
"type"]);
1440 $ilCtrl->redirect($this,
"editTagStyle");
1443 $this->form_gui->setValuesByPost();
1444 $tpl->setContent($this->form_gui->getHTML());
1456 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1460 $txt_input =
new ilRegExpInputGUI($lng->txt(
"title"),
"new_characteristic");
1461 $txt_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1462 $txt_input->setNoMatchMessage($lng->txt(
"sty_msg_characteristic_must_only_include").
" A-Z, a-z, 1-9");
1463 $txt_input->setRequired(
true);
1464 $this->form_gui->addItem($txt_input);
1468 $types = $all_super_types[$this->super_type];
1469 $exp_types = array();
1470 foreach($types as
$t)
1474 $exp_types[
$t] = $lng->txt(
"sty_type_".$t);
1477 if (count($exp_types) > 1)
1481 $type_input->setValue(key($exp_types));
1482 $this->form_gui->addItem($type_input);
1484 else if (count($exp_types) == 1)
1487 $hid_input->setValue(key($exp_types));
1488 $this->form_gui->addItem($hid_input);
1491 $this->form_gui->setTitle($lng->txt(
"sty_add_characteristic"));
1492 $this->form_gui->addCommandButton(
"saveCharacteristic", $lng->txt(
"save"));
1493 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"cancel"));
1494 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1504 $c = explode(
":", $a_class);
1507 $ex_tpl =
new ilTemplate(
"tpl.style_example.html",
true,
true,
"Services/Style");
1509 $ex_tpl->setCurrentBlock(
"Example_".$a_type);
1510 $ex_tpl->setVariable(
"EX_CLASS",
"ilc_".$a_type.
"_".$a_class);
1511 $ex_tpl->setVariable(
"EX_TEXT",
"ABC abc 123");
1512 if (in_array($a_type, array(
"media_cont",
"qimg")))
1516 if (in_array($a_type, array(
"table",
"table_caption")))
1518 $ex_tpl->setVariable(
"TXT_CAPTION", $lng->txt(
"sty_caption"));
1520 if (in_array($a_class, array(
"OrderListItemHorizontal",
"OrderListHorizontal")))
1522 $ex_tpl->setVariable(
"HOR",
"Horizontal");
1524 $ex_tpl->parseCurrentBlock();
1526 return $ex_tpl->get();
1538 foreach (
$_POST[
"all_chars"] as $char)
1540 $ca = explode(
".", $char);
1541 $this->
object->saveHideStatus($ca[0], $ca[2],
1542 (is_array(
$_POST[
"hide"]) && in_array($char,
$_POST[
"hide"])));
1546 $ilCtrl->redirect($this,
"edit");
1559 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1565 $style_cp = implode(
"::",
$_POST[
"char"]);
1566 $style_cp = $this->
object->getId().
":::".
$_GET[
"style_type"].
":::".$style_cp;
1570 $ilCtrl->redirect($this,
"edit");
1581 global
$tpl, $ilTabs;
1583 $ilTabs->clearTargets();
1585 include_once(
"./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1588 $tpl->setContent($table->getHTML());
1601 if (is_array(
$_POST[
"title"]))
1603 foreach (
$_POST[
"title"] as $from_char => $to_title)
1605 $fc = explode(
".", $from_char);
1607 if (
$_POST[
"conflict_action"][$from_char] ==
"overwrite" ||
1608 !$this->object->characteristicExists($to_title, $fc[0]))
1610 $this->
object->copyCharacteristic(
$_POST[
"from_style_id"],
1611 $fc[0], $fc[2], $to_title);
1619 $ilCtrl->redirect($this,
"edit");
1633 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1635 $ilToolbar->addButton($this->lng->txt(
"sty_add_color"),
1636 $ilCtrl->getLinkTarget($this,
"addColor"));
1639 include_once(
"./Services/Style/classes/class.ilStyleColorTableGUI.php");
1642 $tpl->setContent($table_gui->getHTML());
1654 $tpl->setContent($this->form_gui->getHTML());
1664 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1667 $tpl->setContent($this->form_gui->getHTML());
1678 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1681 $this->form_gui->setTitle($lng->txt(
"sty_add_color"));
1684 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_color_name"),
"color_name");
1685 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1686 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
1687 $name_input->setRequired(
true);
1688 $name_input->setSize(15);
1689 $name_input->setMaxLength(15);
1690 $this->form_gui->addItem($name_input);
1695 $color_input->setDefaultColor(
"");
1696 $this->form_gui->addItem($color_input);
1698 if ($a_mode ==
"create")
1700 $this->form_gui->addCommandButton(
"saveColor", $lng->txt(
"save"));
1701 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1705 $this->form_gui->addCommandButton(
"updateColor", $lng->txt(
"save"));
1706 $this->form_gui->addCommandButton(
"cancelColorSaving", $lng->txt(
"cancel"));
1708 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1716 if (
$_GET[
"c_name"] !=
"")
1718 $values[
"color_name"] =
$_GET[
"c_name"];
1719 $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
1720 $this->form_gui->setValuesByArray($values);
1731 $ilCtrl->redirect($this,
"listColors");
1743 if ($this->form_gui->checkInput())
1745 if ($this->object->colorExists(
$_POST[
"color_name"]))
1747 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1748 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1752 $this->
object->addColor(
$_POST[
"color_name"],
1754 $ilCtrl->redirect($this,
"listColors");
1757 $this->form_gui->setValuesByPost();
1758 $tpl->setContent($this->form_gui->getHTML());
1770 if ($this->form_gui->checkInput())
1772 if ($this->object->colorExists(
$_POST[
"color_name"]) &&
1775 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1776 $col_input->setAlert($lng->txt(
"sty_color_already_exists"));
1780 $this->
object->updateColor(
$_GET[
"c_name"],
$_POST[
"color_name"],
1782 $ilCtrl->redirect($this,
"listColors");
1785 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1786 $this->form_gui->setValuesByPost();
1787 $tpl->setContent($this->form_gui->getHTML());
1797 if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0)
1800 $ilCtrl->redirect($this,
"listColors");
1804 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1806 $cgui->setFormAction($ilCtrl->getFormAction($this));
1807 $cgui->setHeaderText($lng->txt(
"sty_confirm_color_deletion"));
1808 $cgui->setCancel($lng->txt(
"cancel"),
"cancelColorDeletion");
1809 $cgui->setConfirm($lng->txt(
"delete"),
"deleteColor");
1811 foreach (
$_POST[
"color"] as $c)
1816 $tpl->setContent($cgui->getHTML());
1827 $ilCtrl->redirect($this,
"listColors");
1837 if (is_array(
$_POST[
"color"]))
1839 foreach (
$_POST[
"color"] as $c)
1841 $this->
object->removeColor($c);
1845 $ilCtrl->redirect($this,
"listColors");
1859 $ctype =
$_GET[
"temp_type"];
1863 $ilCtrl->setParameter($this,
"temp_type", $ctype);
1864 $_GET[
"temp_type"] = $ctype;
1868 $ilTabs->setSubTabActive(
"sty_".$ctype.
"_templates");
1871 include_once(
"./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
1874 $tpl->setContent($table_gui->getHTML());
1886 $tpl->setContent($this->form_gui->getHTML());
1896 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
1909 $this->
object, $a_type, $a_t_id, $a_small_mode);
1926 $ts = $a_style->getTemplate($a_t_id);
1927 $t = $ts[
"classes"];
1930 if ($a_type ==
"table")
1932 $p_content =
'<PageContent><Table DataTable="y"';
1933 if (
$t[
"row_head"] !=
"")
1935 $p_content.=
' HeaderRows="1"';
1937 if (
$t[
"row_foot"] !=
"")
1939 $p_content.=
' FooterRows="1"';
1941 if (
$t[
"col_head"] !=
"")
1943 $p_content.=
' HeaderCols="1"';
1945 if (
$t[
"col_foot"] !=
"")
1947 $p_content.=
' FooterCols="1"';
1949 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
1952 $p_content.=
'<Caption>'.$lng->txt(
"sty_caption").
'</Caption>';
1954 for($i = 1; $i<=$kr; $i++)
1956 $p_content.=
'<TableRow>';
1957 for($j = 1; $j<=$kc; $j++)
1961 $cell =
'<div style="height:2px;"></div>';
1967 $p_content.=
'<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.
'</Paragraph></PageContent></TableData>';
1969 $p_content.=
'</TableRow>';
1971 $p_content.=
'</Table></PageContent>';
1974 if ($a_type ==
"vaccordion" || $a_type ==
"haccordion")
1976 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
1989 if ($a_type ==
"vaccordion")
1991 $p_content =
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
1994 $p_content.=
' ContentWidth="70"';
1999 $p_content =
'<PageContent><Tabs Type="HorizontalAccordion"';
2002 $p_content.=
' ContentHeight="40"';
2003 $p_content.=
' ContentWidth="70"';
2004 $c =
'&nbsp;&nbsp;&nbsp;&nbsp;';
2008 $p_content.=
' ContentHeight="40"';
2011 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
2012 $p_content.=
'<Tab><PageContent><Paragraph>'.$c.
'</Paragraph></PageContent>';
2013 $p_content.=
'<TabCaption>'.$h.
'</TabCaption>';
2014 $p_content.=
'</Tab>';
2015 $p_content.=
'</Tabs></PageContent>';
2018 $txml = $a_style->getTemplateXML();
2021 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
2034 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2037 if ($a_mode ==
"create")
2039 $this->form_gui->setTitle($lng->txt(
"sty_add_template"));
2043 $this->form_gui->setTitle($lng->txt(
"sty_edit_template"));
2047 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2048 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2049 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2050 $name_input->setRequired(
true);
2051 $name_input->setSize(30);
2052 $name_input->setMaxLength(30);
2053 $this->form_gui->addItem($name_input);
2057 foreach ($scs as $sc => $st)
2059 $sc_input =
new ilSelectInputGUI($lng->txt(
"sty_".$sc.
"_class"), $sc.
"_class");
2060 $chars = $this->
object->getCharacteristics($st);
2061 $options = array(
"" =>
"");
2062 foreach($chars as $char)
2064 $options[$char] = $char;
2066 $sc_input->setOptions($options);
2067 $this->form_gui->addItem($sc_input);
2070 if ($a_mode ==
"create")
2072 $this->form_gui->addCommandButton(
"saveTemplate", $lng->txt(
"save"));
2073 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2077 $this->form_gui->addCommandButton(
"refreshTemplate", $lng->txt(
"save_refresh"));
2078 $this->form_gui->addCommandButton(
"updateTemplate", $lng->txt(
"save_return"));
2079 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2081 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2091 $ilCtrl->redirect($this,
"listTemplates");
2104 if ($this->form_gui->checkInput())
2106 if ($this->object->templateExists(
$_POST[
"name"]))
2108 $name_input = $this->form_gui->getItemByPostVar(
"name");
2109 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2116 $classes[$tct] =
$_POST[$tct.
"_class"];
2118 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
$_POST[
"name"], $classes);
2119 $this->
object->writeTemplatePreview($t_id,
2121 $ilCtrl->redirect($this,
"listTemplates");
2124 $this->form_gui->setValuesByPost();
2125 $tpl->setContent($this->form_gui->getHTML());
2135 $ilCtrl->setParameter($this,
"t_id",
$_GET[
"t_id"]);
2138 if ($this->form_gui->checkInput())
2140 if ($this->object->templateExists(
$_POST[
"name"]) &&
2143 $name_input = $this->form_gui->getItemByPostVar(
"name");
2144 $name_input->setAlert($lng->txt(
"sty_template_already_exists"));
2151 $classes[$tct] =
$_POST[$tct.
"_class"];
2154 $this->
object->updateTemplate(
$_GET[
"t_id"],
2155 $_POST[
"name"], $classes);
2156 $this->
object->writeTemplatePreview(
$_GET[
"t_id"],
2160 $ilCtrl->redirect($this,
"listTemplates");
2165 $this->form_gui->setValuesByPost();
2176 $a_tpl =
new ilTemplate(
"tpl.template_edit.html",
true,
true,
2179 $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
2181 $tpl->setContent($a_tpl->get());
2197 if (
$_GET[
"t_id"] > 0)
2199 $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
2201 $values[
"name"] =
$t[
"name"];
2203 foreach ($scs as $k => $type)
2205 $values[$k.
"_class"] =
$t[
"classes"][$k];
2207 $this->form_gui->setValuesByArray($values);
2218 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0)
2221 $ilCtrl->redirect($this,
"listTemplates");
2225 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2227 $cgui->setFormAction($ilCtrl->getFormAction($this));
2228 $cgui->setHeaderText($lng->txt(
"sty_confirm_template_deletion"));
2229 $cgui->setCancel($lng->txt(
"cancel"),
"cancelTemplateDeletion");
2230 $cgui->setConfirm($lng->txt(
"sty_del_template"),
"deleteTemplate");
2232 foreach (
$_POST[
"tid"] as $tid)
2234 $classes = $this->
object->getTemplateClasses($tid);
2237 foreach ($classes as $cl)
2239 if ($cl !=
"" && !$listed[$cl])
2241 $cl_str.=
'<div>- '.
2243 $listed[$cl] =
true;
2248 $cl_str =
'<div style="padding-left:30px;" class="small">'.
2249 "<div><i>".$lng->txt(
"sty_style_class").
"</i></div>".$cl_str.
"</div>";
2251 $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2254 $cgui->addButton($lng->txt(
"sty_del_template_keep_classes"),
"deleteTemplateKeepClasses");
2256 $tpl->setContent($cgui->getHTML());
2267 $ilCtrl->redirect($this,
"listTemplates");
2277 if (is_array(
$_POST[
"tid"]))
2279 foreach (
$_POST[
"tid"] as $tid)
2281 $this->
object->removeTemplate($tid);
2285 $ilCtrl->redirect($this,
"listTemplates");
2295 if (is_array(
$_POST[
"tid"]))
2297 foreach (
$_POST[
"tid"] as $tid)
2299 $cls = $this->
object->getTemplateClasses($tid);
2300 foreach ($cls as $k => $cls)
2302 $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
2304 $this->
object->deleteCharacteristic($ty, $ta, $cls);
2306 $this->
object->removeTemplate($tid);
2310 $ilCtrl->redirect($this,
"listTemplates");
2321 $tpl->setContent($this->form_gui->getHTML());
2331 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2334 $this->form_gui->setTitle($lng->txt(
"sty_generate_template"));
2337 $name_input =
new ilRegExpInputGUI($lng->txt(
"sty_template_name"),
"name");
2338 $name_input->
setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2339 $name_input->setNoMatchMessage($lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2340 $name_input->setRequired(
true);
2341 $name_input->setSize(30);
2342 $name_input->setMaxLength(30);
2343 $this->form_gui->addItem($name_input);
2346 $bl_input =
new ilSelectInputGUI($lng->txt(
"sty_template_layout"),
"layout");
2348 "coloredZebra" => $lng->txt(
"sty_table_template_colored_zebra"),
2349 "bwZebra" => $lng->txt(
"sty_table_template_bw_zebra"),
2350 "noZebra" => $lng->txt(
"sty_table_template_no_zebra")
2353 $this->form_gui->addItem($bl_input);
2356 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2359 $num_input->setValue(
"3px");
2360 $this->form_gui->addItem($num_input);
2365 $num_input->setValue(
"10px");
2366 $this->form_gui->addItem($num_input);
2369 $bc_input =
new ilSelectInputGUI($lng->txt(
"sty_base_color"),
"base_color");
2370 $cs = $this->
object->getColors();
2374 $options[$c[
"name"]] = $c[
"name"];
2377 $this->form_gui->addItem($bc_input);
2380 $lss = array(
"border" => 90,
"header_text" => 70,
"header_bg" => 0,
2381 "cell1_text" => -60,
"cell1_bg" => 90,
"cell2_text" => -60,
"cell2_bg" => 75);
2382 foreach ($lss as $ls => $v)
2384 $l_input =
new ilNumberInputGUI($lng->txt(
"sty_lightness_".$ls),
"lightness_".$ls);
2386 $l_input->setMinValue(-100);
2387 $l_input->setValue($v);
2388 $l_input->setSize(4);
2389 $l_input->setMaxLength(4);
2390 $this->form_gui->addItem($l_input);
2393 $this->form_gui->addCommandButton(
"templateGeneration", $lng->txt(
"generate"));
2394 $this->form_gui->addCommandButton(
"cancelTemplateSaving", $lng->txt(
"cancel"));
2395 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2407 if ($this->form_gui->checkInput())
2409 if ($this->object->templateExists(
$_POST[
"name"]))
2411 $name_input = $this->form_gui->getItemByPostVar(
"name");
2412 $name_input->setAlert($lng->txt(
"sty_table_template_already_exists"));
2419 $cells = array(
"H" =>
"header",
"C1" =>
"cell1",
"C2" =>
"cell2");
2420 $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
2421 $tb_padding = $tb_p->getValue();
2422 $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
2423 $lr_padding = $lr_p->getValue();
2424 $cell_color =
$_POST[
"base_color"];
2427 if (
$_POST[
"layout"] ==
"bwZebra")
2429 $cell_color =
"MidGray";
2430 if (!$this->object->colorExists($cell_color))
2432 $this->
object->addColor($cell_color,
"7F7F7F");
2434 $this->
object->updateColor($cell_color, $cell_color,
"7F7F7F");
2437 foreach ($cells as $k => $cell)
2439 $cell_class[$k] =
$_POST[
"name"].$k;
2440 if (!$this->object->characteristicExists($cell_class[$k],
"table_cell"))
2442 $this->
object->addCharacteristic(
"table_cell", $cell_class[$k],
true);
2444 if (
$_POST[
"layout"] ==
"bwZebra" && $k ==
"H")
2446 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2447 "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2448 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2449 "!".$_POST[
"base_color"].
"(".$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2453 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2454 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2455 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2456 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2458 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-top",
2459 $tb_padding,
"table_cell");
2460 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-bottom",
2461 $tb_padding,
"table_cell");
2462 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-left",
2463 $lr_padding,
"table_cell");
2464 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-right",
2465 $lr_padding,
"table_cell");
2466 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-width",
2467 "1px",
"table_cell");
2468 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-style",
2469 "solid",
"table_cell");
2470 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-color",
2471 "!".$cell_color.
"(".
$_POST[
"lightness_border"].
")",
"table_cell");
2472 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"font-weight",
2473 "normal",
"table_cell");
2477 $classes[
"table"] =
$_POST[
"name"].
"T";
2478 if (!$this->object->characteristicExists($classes[
"table"],
"table"))
2480 $this->
object->addCharacteristic(
"table", $classes[
"table"],
true);
2482 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"caption-side",
2484 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-collapse",
2485 "collapse",
"table");
2486 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-top",
2488 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-bottom",
2490 if (
$_POST[
"layout"] ==
"bwZebra")
2492 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-color",
2493 "!".
$_POST[
"base_color"],
"table");
2494 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-style",
2496 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-width",
2498 $sb = array(
"left",
"right",
"top");
2501 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-".$b.
"-width",
2506 switch (
$_POST[
"layout"])
2508 case "coloredZebra":
2509 $classes[
"row_head"] = $cell_class[
"H"];
2510 $classes[
"odd_row"] = $cell_class[
"C1"];
2511 $classes[
"even_row"] = $cell_class[
"C2"];
2515 $classes[
"row_head"] = $cell_class[
"H"];
2516 $classes[
"odd_row"] = $cell_class[
"C1"];
2517 $classes[
"even_row"] = $cell_class[
"C2"];
2521 $classes[
"row_head"] = $cell_class[
"H"];
2522 $classes[
"odd_row"] = $cell_class[
"C1"];
2523 $classes[
"even_row"] = $cell_class[
"C1"];
2524 $classes[
"col_head"] = $cell_class[
"C2"];
2529 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
2530 $_POST[
"name"], $classes);
2531 $this->
object->writeTemplatePreview($t_id,
2533 $ilCtrl->redirect($this,
"listTemplates");
2536 $this->form_gui->setValuesByPost();
2537 $tpl->setContent($this->form_gui->getHTML());
2544 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2547 $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2548 $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2552 $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2553 $ac2->addItem(
"Header 2", $acc->getHTML());
2556 $tpl->setContent($ac2->getHTML());
2566 if (
$_GET[
"baseClass"] ==
"ilAdministrationGUI")
2568 $ilCtrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
2570 $ilCtrl->returnToParent($this);