16require_once
"./Services/Object/classes/class.ilObjectGUI.php";
17require_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"));
100 $ti->setMaxLength(128);
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");
126 $ti->setRequired(
true);
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"));
144 $ti->setRequired(
true);
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"));
219 $style_cp = explode(
":::",
$_SESSION[
"sty_copy"]);
220 if ($style_cp[1] == $style_type)
225 $ilToolbar->addSeparator();
227 $ilToolbar->addButton(
$lng->txt(
"sty_paste_style_classes"),
228 $ilCtrl->getLinkTarget($this,
"pasteCharacteristicsOverview"));
232 include_once(
"./Services/Style/classes/class.ilStyleTableGUI.php");
236 $ctpl->setCurrentBlock(
"style_table");
237 $ctpl->setVariable(
"STYLE_TABLE", $table_gui->getHTML());
238 $ctpl->parseCurrentBlock();
240 $this->tpl->setContent($ctpl->get());
248 global $rbacsystem,
$lng, $ilToolbar;
251 $this->tpl->setCurrentBlock(
"ContentStyle");
252 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
253 $this->object->getContentStylePath($this->object->getId()));
254 $this->tpl->parseCurrentBlock();
257 $ilToolbar->addButton($this->lng->txt(
"export"),
258 $this->ctrl->getLinkTarget($this,
"exportStyle"));
262 $this->tpl->setContent($this->form->getHTML());
273 $values[
"style_title"] = $this->
object->getTitle();
274 $values[
"style_description"] = $this->
object->getDescription();
275 $values[
"disable_auto_margins"] = (int) $this->object->lookupStyleSetting(
"disable_auto_margins");
277 $this->form->setValuesByArray($values);
287 global
$lng, $rbacsystem;
289 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
293 $ti =
new ilTextInputGUI($this->lng->txt(
"title"),
"style_title");
294 $ti->setMaxLength(128);
296 $ti->setRequired(
true);
297 $this->form->addItem($ti);
303 $this->form->addItem($ta);
306 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"sty_disable_auto_margins"),
"disable_auto_margins");
307 $cb->setInfo($this->lng->txt(
"sty_disable_auto_margins_info"));
308 $this->form->addItem($cb);
312 if ($a_mode ==
"create")
314 $this->form->addCommandButton(
"save",
$lng->txt(
"save"));
315 $this->form->addCommandButton(
"cancelSave",
$lng->txt(
"cancel"));
319 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
321 $this->form->addCommandButton(
"update",
$lng->txt(
"save"));
325 $this->form->setTitle(
$lng->txt(
"edit_stylesheet"));
326 $this->form->setFormAction($this->ctrl->getFormAction($this));
338 if ($this->form->checkInput())
340 $this->
object->setTitle($this->form->getInput(
"style_title"));
341 $this->
object->setDescription($this->form->getInput(
"style_description"));
342 $this->
object->writeStyleSetting(
"disable_auto_margins",
343 $this->form->getInput(
"disable_auto_margins"));
344 $this->
object->update();
346 $ilCtrl->redirect($this,
"properties");
350 $this->form->setValuesByPost();
351 $tpl->setContent($this->form->getHtml());
362 $cur = explode(
".",
$_GET[
"tag"]);
364 $cur_class = $cur[1];
368 if ($this->form_gui->checkInput())
371 $ilCtrl->redirect($this,
"editTagStyle");
375 $this->form_gui->setValuesByPost();
387 $cur = explode(
".",
$_GET[
"tag"]);
389 $cur_class = $cur[1];
392 if ($this->form_gui->checkInput())
395 $ilCtrl->redirect($this,
"edit");
399 $this->form_gui->setValuesByPost();
409 $cur = explode(
".",
$_GET[
"tag"]);
411 $cur_class = $cur[1];
413 foreach ($avail_pars as $par => $v)
415 $var = str_replace(
"-",
"_", $par);
416 $basepar_arr = explode(
".", $par);
417 $basepar = $basepar_arr[0];
418 if ($basepar_arr[1] !=
"" && $basepar_arr[1] != $cur_tag)
426 case "numeric_no_perc":
428 case "background_image":
429 $in = $this->form_gui->getItemByPostVar($basepar);
435 $color = trim(
$_POST[$basepar]);
436 if ($color !=
"" && trim(substr($color,0,1) !=
"!"))
446 $in = $this->form_gui->getItemByPostVar($basepar);
450 $this->
writeStylePar($cur_tag, $cur_class, $v[
"subpar"][3],
$in->getBottomValue(),
$_GET[
"style_type"], (
int)
$_GET[
"mq_id"]);
455 $in = $this->form_gui->getItemByPostVar($basepar);
456 $tblr_p = array (0 =>
"getAllValue", 1 =>
"getTopValue", 2 =>
"getRightValue",
457 3 =>
"getBottomValue", 4 =>
"getLeftValue");
458 foreach ($tblr_p as $k => $func)
460 $val = trim(
$in->$func());
461 $val = ((
$in->getAcceptNamedColors() && substr($val, 0, 1) ==
"!")
469 case "background_position":
470 $in = $this->form_gui->getItemByPostVar($basepar);
481 $this->
object->deleteCustomStylePars($cur_tag, $cur_class,
$_GET[
"style_type"], (
int)
$_GET[
"mq_id"]);
482 if (is_array(
$_POST[
"custom_par"]))
484 foreach (
$_POST[
"custom_par"] as $cpar)
486 $par_arr = explode(
":", $cpar);
487 if (count($par_arr) == 2)
489 $par = trim($par_arr[0]);
490 $val = trim(str_replace(
";",
"", $par_arr[1]));
496 $this->
object->update();
499 function writeStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom =
false)
510 $this->
object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
514 $this->
object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
527 $mqs = $this->
object->getMediaQueries();
532 "" =>
$lng->txt(
"sty_default"),
534 foreach ($mqs as $mq)
536 $options[$mq[
"id"]] = $mq[
"mquery"];
538 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
541 $si->setValue((
int)
$_GET[
"mq_id"]);
542 $ilToolbar->addInputItem(
$si,
true);
543 $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
544 $ilToolbar->addFormButton(
$lng->txt(
"sty_switch"),
"switchMQuery");
549 if ($this->super_type ==
"rte")
551 $tpl->addCss(
"Modules/Scorm2004/templates/default/player.css");
552 include_once(
"./Modules/Scorm2004/classes/ilSCORM13Player.php");
553 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
556 $cur = explode(
".",
$_GET[
"tag"]);
558 $cur_class = $cur[1];
575 $ilCtrl->setParameter($this,
"mq_id", (
int)
$_POST[
"mq_id"]);
576 $ilCtrl->redirect($this,
"editTagStyle");
588 $tpl->setCurrentBlock(
"ContentStyle");
589 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
590 $this->object->getContentStylePath($this->object->getId()));
592 $ts_tpl =
new ilTemplate(
"tpl.style_tag_edit.html",
true,
true,
"Services/Style");
594 $cur = explode(
".",
$_GET[
"tag"]);
596 $cur_class = $cur[1];
598 $ts_tpl->setVariable(
"EXAMPLE",
601 $ts_tpl->setVariable(
"FORM",
602 $this->form_gui->getHtml());
604 $tpl->setTitle($cur_class.
" (".
$lng->txt(
"sty_type_".$_GET[
"style_type"]).
")");
606 $tpl->setContent($ts_tpl->get());
619 $ilCtrl->saveParameter($this, array(
"mq_id"));
621 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
624 $avail_pars = $this->
object->getAvailableParameters();
625 $groups = $this->
object->getStyleParameterGroups();
628 foreach ($groups as $k => $group)
633 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
639 $sh->setTitle(
$lng->txt(
"sty_".$k));
640 $this->form_gui->addItem($sh);
642 foreach ($group as $par)
644 $basepar = explode(
".", $par);
645 $basepar = $basepar[0];
647 $var = str_replace(
"-",
"_", $basepar);
648 $up_par = strtoupper($var);
655 foreach ($avail_pars[$par] as $p)
660 $this->form_gui->addItem($sel_input);
665 $text_input->setMaxLength(200);
666 $text_input->setSize(20);
667 $this->form_gui->addItem($text_input);
671 include_once(
"./Services/Style/classes/class.ilFontSizeInputGUI.php");
673 $this->form_gui->addItem($fs_input);
676 case "numeric_no_perc":
678 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
682 $num_input->setAllowPercentage(
false);
684 $this->form_gui->addItem($num_input);
689 $per_input->setMinValue(0);
690 $per_input->setMaxValue(100);
691 $per_input->setMaxLength(3);
692 $per_input->setSize(3);
693 $this->form_gui->addItem($per_input);
699 $col_input->setDefaultColor(
"");
700 $col_input->setAcceptNamedColors(
true);
701 $this->form_gui->addItem($col_input);
705 include_once(
"./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
709 $num_input->setAllowPercentage(
false);
711 $this->form_gui->addItem($num_input);
715 include_once(
"./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
717 $this->form_gui->addItem($bw_input);
721 include_once(
"./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
723 $this->form_gui->addItem($bw_input);
727 include_once(
"./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
729 $col_input->setAcceptNamedColors(
true);
730 $this->form_gui->addItem($col_input);
733 case "background_image":
734 include_once(
"./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
737 foreach ($this->object->getImages() as $entry)
739 $imgs[] = $entry[
"entry"];
741 $im_input->setImages($imgs);
742 $this->form_gui->addItem($im_input);
745 case "background_position":
746 include_once(
"./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
748 $this->form_gui->addItem($im_input);
756 $sh->setTitle(
$lng->txt(
"sty_custom"));
757 $this->form_gui->addItem($sh);
760 $ti =
new ilTextInputGUI($this->lng->txt(
"sty_custom_par"),
"custom_par");
761 $ti->setMaxLength(300);
764 $ti->setInfo($this->lng->txt(
"sty_custom_par_info"));
765 $this->form_gui->addItem($ti);
769 $this->form_gui->addCommandButton(
"updateTagStyle",
$lng->txt(
"save_return"));
770 $this->form_gui->addCommandButton(
"refreshTagStyle",
$lng->txt(
"save_refresh"));
773 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
782 $style = $this->
object->getStyle();
783 $cur = explode(
".",
$_GET[
"tag"]);
785 $cur_class = $cur[1];
787 (
int)
$_GET[
"mq_id"],
false);
789 foreach($parameters as $p => $v)
792 if (is_array($filtered_groups[$v[
"group"]]) && !in_array($cur_tag, $filtered_groups[$v[
"group"]]))
796 $p = explode(
".", $p);
798 $input = $this->form_gui->getItemByPostVar($p);
808 $input->setAllValue($cur_parameters[$v[
"subpar"][0]]);
809 $input->setTopValue($cur_parameters[$v[
"subpar"][1]]);
810 $input->setRightValue($cur_parameters[$v[
"subpar"][2]]);
811 $input->setBottomValue($cur_parameters[$v[
"subpar"][3]]);
812 $input->setLeftValue($cur_parameters[$v[
"subpar"][4]]);
816 $input->setValue($cur_parameters[$p]);
822 (
int)
$_GET[
"mq_id"],
true);
824 foreach ($cust_parameters as $k => $c)
826 $vals[] = $k.
": ".$c;
828 $input = $this->form_gui->getItemByPostVar(
"custom_par");
829 $input->setValue($vals);
837 $file = $this->
object->export();
844 $parameters = array();
845 foreach($a_style as $tag)
847 foreach($tag as $par)
849 if ($par[
"tag"] == $a_tag && $par[
"class"] == $a_class
850 && $par[
"type"] == $a_type && (
int) $a_mq_id == (
int) $par[
"mq_id"]
851 && (
int) $a_custom == (
int) $par[
"custom"])
853 $parameters[$par[
"parameter"]] = $par[
"value"];
865 $this->
object->addParameter(
$_POST[
"tag"],
$_POST[
"parameter"]);
874 $this->
object->setTitle(
$_POST[
"style_title"]);
875 $this->
object->setDescription(
$_POST[
"style_description"]);
877 foreach(
$_POST[
"styval"] as $id => $value)
879 $this->
object->updateStyleParameter($id, $value);
881 $this->
object->update();
895 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
897 $cgui->setFormAction($this->ctrl->getFormAction($this));
898 $cgui->setHeaderText($this->lng->txt(
"info_delete_sure"));
899 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDelete");
900 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmedDelete");
903 " ".ilObject::_lookupTitle($this->object->getId());
905 $cgui->addItem(
"id[]",
"", $caption);
907 $this->tpl->setContent($cgui->getHTML());
916 $this->ctrl->returnToParent($this);
926 $this->
object->delete();
928 $this->ctrl->returnToParent($this);
936 if (is_array(
$_POST[
"sty_select"]))
938 foreach(
$_POST[
"sty_select"] as $id => $dummy)
940 $this->
object->deleteParameter($id);
943 $this->
object->read();
944 $this->
object->writeCSSFile();
953 if(!trim(
$_POST[
"style_title"]))
955 $this->ctrl->redirect($this,
"create");
959 $class_name =
"ilObjStyleSheet";
960 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
962 $newObj->setTitle(
"-");
970 if (
$_GET[
"ref_id"] > 0)
974 if ($fold->getType() ==
"stys")
976 $fold->addStyle($newObj->getId());
979 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
983 return $newObj->getId();
993 if (
$_POST[
"source_style"] > 0)
994 $style_obj =&
$ilias->obj_factory->getInstanceByObjId(
$_POST[
"source_style"]);
995 $new_id = $style_obj->ilClone();
999 if (
$_GET[
"ref_id"] > 0)
1003 if ($fold->getType() ==
"stys")
1005 $fold->addStyle($new_id);
1008 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
1021 $source = $_FILES[
"stylefile"][
"tmp_name"];
1022 if (($source ==
'none') || (!$source))
1024 $this->
ilias->raiseError(
"No file selected!",$this->
ilias->error_obj->MESSAGE);
1028 $info = pathinfo($_FILES[
"stylefile"][
"name"]);
1029 if (strtolower($info[
"extension"]) !=
"zip" && strtolower($info[
"extension"]) !=
"xml")
1031 $this->
ilias->raiseError(
"File must be a zip or xml file!",$this->
ilias->error_obj->MESSAGE);
1034 $class_name =
"ilObjStyleSheet";
1035 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1039 $newObj->import($_FILES[
"stylefile"]);
1044 if (
$_GET[
"ref_id"] > 0)
1048 if ($fold->getType() ==
"stys")
1050 $fold->addStyle($newObj->getId());
1053 $this->ctrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
1057 return $newObj->getId();
1068 $this->ctrl->returnToParent($this);
1086 $this->
getTabs($this->tabs_gui);
1088 if (strtolower(get_class($this->
object)) ==
"ilobjstylesheet")
1090 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
1094 $this->tpl->setVariable(
"HEADER",
$lng->txt(
"create_stylesheet"));
1107 $ilHelp->setScreenIdComponent(
"sty");
1109 if (
$ilCtrl->getCmd() ==
"editTagStyle")
1112 $tabs_gui->setBackTarget(
$lng->txt(
"back"),
1113 $ilCtrl->getLinkTarget($this,
"edit"));
1115 $t = explode(
".",
$_GET[
"tag"]);
1116 $t2 = explode(
":",
$t[1]);
1117 $pc = $this->
object->_getPseudoClasses(
$t[0]);
1118 if (is_array($pc) && count($pc) > 0)
1121 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0]);
1122 $tabs_gui->addTarget(
"sty_tag_normal",
1123 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1127 $ilTabs->setTabActive(
"sty_tag_normal");
1133 $ilCtrl->setParameter($this,
"tag",
$t[0].
".".$t2[0].
":".$p);
1134 $tabs_gui->addTarget(
"sty_tag_".$p,
1135 $this->ctrl->getLinkTarget($this,
"editTagStyle"), array(
"editTagStyle",
""),
1139 $ilTabs->setTabActive(
"sty_tag_".$p);
1148 $tabs_gui->setBackTarget(
$lng->txt(
"back"),
1149 $this->ctrl->getLinkTarget($this,
"returnToUpperContext"));
1152 $tabs_gui->addTarget(
"sty_style_chars",
1153 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1157 $tabs_gui->addTarget(
"sty_colors",
1158 $this->ctrl->getLinkTarget($this,
"listColors"),
"listColors",
1162 $tabs_gui->addTarget(
"sty_media_queries",
1163 $this->ctrl->getLinkTarget($this,
"listMediaQueries"),
"listMediaQueries",
1167 $tabs_gui->addTarget(
"sty_images",
1168 $this->ctrl->getLinkTarget($this,
"listImages"),
"listImages",
1172 $tabs_gui->addTarget(
"sty_templates",
1173 $this->ctrl->getLinkTarget($this,
"listTemplates"),
"listTemplates",
1177 $tabs_gui->addTarget(
"settings",
1178 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1201 foreach ($types as $super_type => $types)
1204 $ilCtrl->setParameter($this,
"style_type", $super_type);
1205 $ilTabs->addSubTabTarget(
"sty_".$super_type.
"_char",
1206 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
""),
1210 $ilCtrl->setParameter($this,
"style_type",
$_GET[
"style_type"]);
1224 foreach ($types as
$t => $c)
1226 $ilCtrl->setParameter($this,
"temp_type",
$t);
1227 $ilTabs->addSubTabTarget(
"sty_".
$t.
"_templates",
1228 $this->ctrl->getLinkTarget($this,
"listTemplates"), array(
"listTemplates",
""),
1232 $ilCtrl->setParameter($this,
"temp_type",
$_GET[
"temp_type"]);
1243 if (
$_GET[
"admin_mode"] ==
"settings")
1245 parent::addAdminLocatorItems(
true);
1249 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
"view"));
1251 if (
$_GET[
"obj_id"] > 0)
1253 $ilLocator->addItem($this->object->getTitle(),
1254 $this->ctrl->getLinkTarget($this,
"edit"));
1268 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1271 $this->ctrl->getLinkTargetByClass(
"ilobjstylesettingsgui",
1272 "editContentStyles"));
1287 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1289 $ilToolbar->addButton(
$lng->txt(
"sty_add_image"),
1290 $ilCtrl->getLinkTarget($this,
"addImage"));
1293 include_once(
"./Services/Style/classes/class.ilStyleImageTableGUI.php");
1296 $tpl->setContent($table_gui->getHTML());
1308 $tpl->setContent($this->form_gui->getHTML());
1318 $ilCtrl->redirect($this,
"listImages");
1330 if ($this->form_gui->checkInput())
1332 $this->
object->uploadImage($_FILES[
"image_file"]);
1333 $ilCtrl->redirect($this,
"listImages");
1338 $tpl->setContent($this->form_gui->getHTML());
1350 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1353 $this->form_gui->setTitle(
$lng->txt(
"sty_add_image"));
1356 $file_input->setRequired(
true);
1357 $this->form_gui->addItem($file_input);
1359 $this->form_gui->addCommandButton(
"uploadImage",
$lng->txt(
"upload"));
1360 $this->form_gui->addCommandButton(
"cancelUpload",
$lng->txt(
"cancel"));
1361 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1371 $images = $this->
object->getImages();
1373 foreach ($images as $image)
1375 if (is_array(
$_POST[
"file"]) && in_array($image[
"entry"],
$_POST[
"file"]))
1377 $this->
object->deleteImage($image[
"entry"]);
1380 $ilCtrl->redirect($this,
"listImages");
1392 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1395 $ilCtrl->redirect($this,
"edit");
1401 foreach (
$_POST[
"char"] as $char)
1403 if (!empty($core_styles[$char]))
1410 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1412 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
1413 $cgui->setHeaderText(
$lng->txt(
"sty_confirm_char_deletion"));
1414 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1415 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteCharacteristic");
1417 foreach (
$_POST[
"char"] as $char)
1419 $char_comp = explode(
".", $char);
1420 $cgui->addItem(
"char[]", $char, $char_comp[2]);
1423 $tpl->setContent($cgui->getHTML());
1437 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1439 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
1444 foreach (
$_POST[
"char"] as $char)
1446 if (!empty($core_styles[$char]))
1449 $char_comp = explode(
".", $char);
1450 $cgui->addItem(
"",
"", $char_comp[2]);
1454 $cgui->addHiddenItem(
"char[]", $char);
1457 $all_core_styles = ($cnt == count(
$_POST[
"char"]))
1461 if ($all_core_styles)
1463 $cgui->setHeaderText(
$lng->txt(
"sty_all_styles_obligatory"));
1464 $cgui->setCancel(
$lng->txt(
"back"),
"cancelCharacteristicDeletion");
1468 $cgui->setHeaderText(
$lng->txt(
"sty_some_styles_obligatory_delete_rest"));
1469 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelCharacteristicDeletion");
1470 $cgui->setConfirm(
$lng->txt(
"sty_delete_other_selected"),
"deleteCharacteristicConfirmation");
1473 $tpl->setContent($cgui->getHTML());
1484 $ilCtrl->redirect($this,
"edit");
1494 if (is_array(
$_POST[
"char"]))
1496 foreach(
$_POST[
"char"] as $char)
1498 $char_comp = explode(
".", $char);
1499 $type = $char_comp[0];
1500 $tag = $char_comp[1];
1501 $class = $char_comp[2];
1503 $this->
object->deleteCharacteristic($type, $tag, $class);
1507 $ilCtrl->redirect($this,
"edit");
1518 $tpl->setContent($this->form_gui->getHTML());
1530 if ($this->form_gui->checkInput())
1532 if ($this->object->characteristicExists(
$_POST[
"new_characteristic"],
$_GET[
"style_type"]))
1534 $char_input = $this->form_gui->getItemByPostVar(
"new_characteristic");
1535 $char_input->setAlert(
$lng->txt(
"sty_characteristic_already_exists"));
1539 $this->
object->addCharacteristic(
$_POST[
"type"],
$_POST[
"new_characteristic"]);
1541 $ilCtrl->setParameter($this,
"tag",
1544 $ilCtrl->redirect($this,
"editTagStyle");
1547 $this->form_gui->setValuesByPost();
1548 $tpl->setContent($this->form_gui->getHTML());
1560 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1565 $txt_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1566 $txt_input->setNoMatchMessage(
$lng->txt(
"sty_msg_characteristic_must_only_include").
" A-Z, a-z, 1-9");
1567 $txt_input->setRequired(
true);
1568 $this->form_gui->addItem($txt_input);
1572 $types = $all_super_types[$this->super_type];
1573 $exp_types = array();
1574 foreach($types as
$t)
1578 $exp_types[
$t] =
$lng->txt(
"sty_type_".
$t);
1581 if (count($exp_types) > 1)
1584 $type_input->setOptions($exp_types);
1585 $type_input->setValue(key($exp_types));
1586 $this->form_gui->addItem($type_input);
1588 else if (count($exp_types) == 1)
1591 $hid_input->setValue(key($exp_types));
1592 $this->form_gui->addItem($hid_input);
1595 $this->form_gui->setTitle(
$lng->txt(
"sty_add_characteristic"));
1596 $this->form_gui->addCommandButton(
"saveCharacteristic",
$lng->txt(
"save"));
1597 $this->form_gui->addCommandButton(
"edit",
$lng->txt(
"cancel"));
1598 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1608 $c = explode(
":", $a_class);
1611 $ex_tpl =
new ilTemplate(
"tpl.style_example.html",
true,
true,
"Services/Style");
1613 $ex_tpl->setCurrentBlock(
"Example_".$a_type);
1614 $ex_tpl->setVariable(
"EX_CLASS",
"ilc_".$a_type.
"_".$a_class);
1615 $ex_tpl->setVariable(
"EX_TEXT",
"ABC abc 123");
1616 if (in_array($a_type, array(
"media_cont",
"qimg")))
1620 if (in_array($a_type, array(
"table",
"table_caption")))
1622 $ex_tpl->setVariable(
"TXT_CAPTION",
$lng->txt(
"sty_caption"));
1624 if (in_array($a_class, array(
"OrderListItemHorizontal",
"OrderListHorizontal")))
1626 $ex_tpl->setVariable(
"HOR",
"Horizontal");
1628 $ex_tpl->parseCurrentBlock();
1630 return $ex_tpl->get();
1642 foreach (
$_POST[
"all_chars"] as $char)
1644 $ca = explode(
".", $char);
1645 $this->
object->saveHideStatus($ca[0], $ca[2],
1646 (is_array(
$_POST[
"hide"]) && in_array($char,
$_POST[
"hide"])));
1650 $ilCtrl->redirect($this,
"edit");
1663 if (!is_array(
$_POST[
"char"]) || count(
$_POST[
"char"]) == 0)
1669 $style_cp = implode(
"::",
$_POST[
"char"]);
1670 $style_cp = $this->
object->getId().
":::".
$_GET[
"style_type"].
":::".$style_cp;
1674 $ilCtrl->redirect($this,
"edit");
1685 global
$tpl, $ilTabs;
1687 $ilTabs->clearTargets();
1689 include_once(
"./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1692 $tpl->setContent($table->getHTML());
1705 if (is_array(
$_POST[
"title"]))
1707 foreach (
$_POST[
"title"] as $from_char => $to_title)
1709 $fc = explode(
".", $from_char);
1711 if (
$_POST[
"conflict_action"][$from_char] ==
"overwrite" ||
1712 !$this->object->characteristicExists($to_title, $fc[0]))
1714 $this->
object->copyCharacteristic(
$_POST[
"from_style_id"],
1715 $fc[0], $fc[2], $to_title);
1723 $ilCtrl->redirect($this,
"edit");
1737 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1739 $ilToolbar->addButton($this->lng->txt(
"sty_add_color"),
1740 $ilCtrl->getLinkTarget($this,
"addColor"));
1743 include_once(
"./Services/Style/classes/class.ilStyleColorTableGUI.php");
1746 $tpl->setContent($table_gui->getHTML());
1758 $tpl->setContent($this->form_gui->getHTML());
1768 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1771 $tpl->setContent($this->form_gui->getHTML());
1782 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1785 $this->form_gui->setTitle(
$lng->txt(
"sty_add_color"));
1789 $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1790 $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
1791 $name_input->setRequired(
true);
1792 $name_input->setSize(15);
1793 $name_input->setMaxLength(15);
1794 $this->form_gui->addItem($name_input);
1798 $color_input->setRequired(
true);
1799 $color_input->setDefaultColor(
"");
1800 $this->form_gui->addItem($color_input);
1802 if ($a_mode ==
"create")
1804 $this->form_gui->addCommandButton(
"saveColor",
$lng->txt(
"save"));
1805 $this->form_gui->addCommandButton(
"cancelColorSaving",
$lng->txt(
"cancel"));
1809 $this->form_gui->addCommandButton(
"updateColor",
$lng->txt(
"save"));
1810 $this->form_gui->addCommandButton(
"cancelColorSaving",
$lng->txt(
"cancel"));
1812 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1820 if (
$_GET[
"c_name"] !=
"")
1822 $values[
"color_name"] =
$_GET[
"c_name"];
1823 $values[
"color_code"] = $this->
object->getColorCodeForName(
$_GET[
"c_name"]);
1824 $this->form_gui->setValuesByArray($values);
1835 $ilCtrl->redirect($this,
"listColors");
1847 if ($this->form_gui->checkInput())
1849 if ($this->object->colorExists(
$_POST[
"color_name"]))
1851 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1852 $col_input->setAlert(
$lng->txt(
"sty_color_already_exists"));
1856 $this->
object->addColor(
$_POST[
"color_name"],
1858 $ilCtrl->redirect($this,
"listColors");
1861 $this->form_gui->setValuesByPost();
1862 $tpl->setContent($this->form_gui->getHTML());
1874 if ($this->form_gui->checkInput())
1876 if ($this->object->colorExists(
$_POST[
"color_name"]) &&
1879 $col_input = $this->form_gui->getItemByPostVar(
"color_name");
1880 $col_input->setAlert(
$lng->txt(
"sty_color_already_exists"));
1884 $this->
object->updateColor(
$_GET[
"c_name"],
$_POST[
"color_name"],
1886 $ilCtrl->redirect($this,
"listColors");
1889 $ilCtrl->setParameter($this,
"c_name",
$_GET[
"c_name"]);
1890 $this->form_gui->setValuesByPost();
1891 $tpl->setContent($this->form_gui->getHTML());
1901 if (!is_array(
$_POST[
"color"]) || count(
$_POST[
"color"]) == 0)
1904 $ilCtrl->redirect($this,
"listColors");
1908 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1910 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
1911 $cgui->setHeaderText(
$lng->txt(
"sty_confirm_color_deletion"));
1912 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelColorDeletion");
1913 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteColor");
1915 foreach (
$_POST[
"color"] as $c)
1920 $tpl->setContent($cgui->getHTML());
1931 $ilCtrl->redirect($this,
"listColors");
1941 if (is_array(
$_POST[
"color"]))
1943 foreach (
$_POST[
"color"] as $c)
1945 $this->
object->removeColor($c);
1949 $ilCtrl->redirect($this,
"listColors");
1963 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]))
1965 $ilToolbar->addButton($this->lng->txt(
"sty_add_media_query"),
1966 $ilCtrl->getLinkTarget($this,
"addMediaQuery"));
1969 include_once(
"./Services/Style/classes/class.ilStyleMediaQueryTableGUI.php");
1972 $tpl->setContent($table_gui->getHTML());
1983 $tpl->setContent($this->form_gui->getHTML());
1996 $tpl->setContent($this->form_gui->getHTML());
2007 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2010 $this->form_gui->setTitle(
$lng->txt(
"sty_add_media_query"));
2014 $ti->setMaxLength(2000);
2015 $this->form_gui->addItem($ti);
2018 if ($a_mode ==
"create")
2020 $this->form_gui->addCommandButton(
"saveMediaQuery",
$lng->txt(
"save"));
2021 $this->form_gui->addCommandButton(
"listMediaQueries",
$lng->txt(
"cancel"));
2025 $this->form_gui->addCommandButton(
"updateMediaQuery",
$lng->txt(
"save"));
2026 $this->form_gui->addCommandButton(
"listMediaQueries",
$lng->txt(
"cancel"));
2028 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
2036 if (
$_GET[
"mq_id"] !=
"")
2038 foreach ($this->object->getMediaQueries() as $mq)
2040 if ($mq[
"id"] == (
int)
$_GET[
"mq_id"])
2042 $values[
"mquery"] = $mq[
"mquery"];
2045 $this->form_gui->setValuesByArray($values);
2058 if ($this->form_gui->checkInput())
2060 $this->
object->addMediaQuery(
$_POST[
"mquery"]);
2061 $ilCtrl->redirect($this,
"listMediaQueries");
2063 $this->form_gui->setValuesByPost();
2064 $tpl->setContent($this->form_gui->getHTML());
2076 if ($this->form_gui->checkInput())
2078 $this->
object->updateMediaQuery((
int)
$_GET[
"mq_id"],
$_POST[
"mquery"]);
2079 $ilCtrl->redirect($this,
"listMediaQueries");
2082 $this->form_gui->setValuesByPost();
2083 $tpl->setContent($this->form_gui->getHTML());
2093 if (!is_array(
$_POST[
"mq_id"]) || count(
$_POST[
"mq_id"]) == 0)
2096 $ilCtrl->redirect($this,
"listMediaQueries");
2100 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2102 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
2103 $cgui->setHeaderText(
$lng->txt(
"sty_sure_del_mqueries"));
2104 $cgui->setCancel(
$lng->txt(
"cancel"),
"listMediaQueries");
2105 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteMediaQueries");
2107 foreach (
$_POST[
"mq_id"] as $i)
2109 $mq = $this->
object->getMediaQueryForId($i);
2110 $cgui->addItem(
"mq_id[]", $i, $mq[
"mquery"]);
2113 $tpl->setContent($cgui->getHTML());
2127 if ($rbacsystem->checkAccess(
"write", (
int)
$_GET[
"ref_id"]) && is_array(
$_POST[
"mq_id"]))
2129 foreach (
$_POST[
"mq_id"] as $id)
2131 $this->
object->deleteMediaQuery($id);
2134 $ilCtrl->redirect($this,
"listMediaQueries");
2147 if (is_array(
$_POST[
"order"]))
2149 $this->
object->saveMediaQueryOrder(
$_POST[
"order"]);
2151 $ilCtrl->redirect($this,
"listMediaQueries");
2166 $ctype =
$_GET[
"temp_type"];
2170 $ilCtrl->setParameter($this,
"temp_type", $ctype);
2171 $_GET[
"temp_type"] = $ctype;
2175 $ilTabs->setSubTabActive(
"sty_".$ctype.
"_templates");
2178 include_once(
"./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
2181 $tpl->setContent($table_gui->getHTML());
2193 $tpl->setContent($this->form_gui->getHTML());
2216 $this->
object, $a_type, $a_t_id, $a_small_mode);
2233 $ts = $a_style->getTemplate($a_t_id);
2234 $t = $ts[
"classes"];
2237 if ($a_type ==
"table")
2239 $p_content =
'<PageContent><Table DataTable="y"';
2240 if (
$t[
"row_head"] !=
"")
2242 $p_content.=
' HeaderRows="1"';
2244 if (
$t[
"row_foot"] !=
"")
2246 $p_content.=
' FooterRows="1"';
2248 if (
$t[
"col_head"] !=
"")
2250 $p_content.=
' HeaderCols="1"';
2252 if (
$t[
"col_foot"] !=
"")
2254 $p_content.=
' FooterCols="1"';
2256 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
2259 $p_content.=
'<Caption>'.$lng->txt(
"sty_caption").
'</Caption>';
2261 for($i = 1; $i<=$kr; $i++)
2263 $p_content.=
'<TableRow>';
2264 for($j = 1; $j<=$kc; $j++)
2268 $cell =
'<div style="height:2px;"></div>';
2274 $p_content.=
'<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.
'</Paragraph></PageContent></TableData>';
2276 $p_content.=
'</TableRow>';
2278 $p_content.=
'</Table></PageContent>';
2281 if ($a_type ==
"vaccordion" || $a_type ==
"haccordion")
2283 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2296 if ($a_type ==
"vaccordion")
2298 $p_content =
'<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2301 $p_content.=
' ContentWidth="70"';
2306 $p_content =
'<PageContent><Tabs Type="HorizontalAccordion"';
2309 $p_content.=
' ContentHeight="40"';
2310 $p_content.=
' ContentWidth="70"';
2311 $c =
'&nbsp;&nbsp;&nbsp;&nbsp;';
2315 $p_content.=
' ContentHeight="40"';
2318 $p_content.=
' Template="'.$a_style->lookupTemplateName($a_t_id).
'">';
2319 $p_content.=
'<Tab><PageContent><Paragraph>'.$c.
'</Paragraph></PageContent>';
2320 $p_content.=
'<TabCaption>'.$h.
'</TabCaption>';
2321 $p_content.=
'</Tab>';
2322 $p_content.=
'</Tabs></PageContent>';
2325 $txml = $a_style->getTemplateXML();
2328 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
2341 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2344 if ($a_mode ==
"create")
2346 $this->form_gui->setTitle(
$lng->txt(
"sty_add_template"));
2350 $this->form_gui->setTitle(
$lng->txt(
"sty_edit_template"));
2355 $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2356 $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2357 $name_input->setRequired(
true);
2358 $name_input->setSize(30);
2359 $name_input->setMaxLength(30);
2360 $this->form_gui->addItem($name_input);
2364 foreach ($scs as $sc => $st)
2367 $chars = $this->
object->getCharacteristics($st);
2369 foreach($chars as $char)
2374 $this->form_gui->addItem($sc_input);
2377 if ($a_mode ==
"create")
2379 $this->form_gui->addCommandButton(
"saveTemplate",
$lng->txt(
"save"));
2380 $this->form_gui->addCommandButton(
"cancelTemplateSaving",
$lng->txt(
"cancel"));
2384 $this->form_gui->addCommandButton(
"refreshTemplate",
$lng->txt(
"save_refresh"));
2385 $this->form_gui->addCommandButton(
"updateTemplate",
$lng->txt(
"save_return"));
2386 $this->form_gui->addCommandButton(
"cancelTemplateSaving",
$lng->txt(
"cancel"));
2388 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
2398 $ilCtrl->redirect($this,
"listTemplates");
2411 if ($this->form_gui->checkInput())
2413 if ($this->object->templateExists(
$_POST[
"name"]))
2415 $name_input = $this->form_gui->getItemByPostVar(
"name");
2416 $name_input->setAlert(
$lng->txt(
"sty_table_template_already_exists"));
2423 $classes[$tct] =
$_POST[$tct.
"_class"];
2425 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
$_POST[
"name"], $classes);
2426 $this->
object->writeTemplatePreview($t_id,
2428 $ilCtrl->redirect($this,
"listTemplates");
2431 $this->form_gui->setValuesByPost();
2432 $tpl->setContent($this->form_gui->getHTML());
2445 if ($this->form_gui->checkInput())
2447 if ($this->object->templateExists(
$_POST[
"name"]) &&
2450 $name_input = $this->form_gui->getItemByPostVar(
"name");
2451 $name_input->setAlert(
$lng->txt(
"sty_template_already_exists"));
2458 $classes[$tct] =
$_POST[$tct.
"_class"];
2461 $this->
object->updateTemplate(
$_GET[
"t_id"],
2462 $_POST[
"name"], $classes);
2463 $this->
object->writeTemplatePreview(
$_GET[
"t_id"],
2467 $ilCtrl->redirect($this,
"listTemplates");
2472 $this->form_gui->setValuesByPost();
2483 $a_tpl =
new ilTemplate(
"tpl.template_edit.html",
true,
true,
2486 $a_tpl->setVariable(
"FORM", $this->form_gui->getHTML());
2488 $tpl->setContent($a_tpl->get());
2504 if (
$_GET[
"t_id"] > 0)
2506 $t = $this->
object->getTemplate(
$_GET[
"t_id"]);
2508 $values[
"name"] =
$t[
"name"];
2510 foreach ($scs as $k => $type)
2512 $values[$k.
"_class"] =
$t[
"classes"][$k];
2514 $this->form_gui->setValuesByArray($values);
2525 if (!is_array(
$_POST[
"tid"]) || count(
$_POST[
"tid"]) == 0)
2528 $ilCtrl->redirect($this,
"listTemplates");
2532 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2534 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
2535 $cgui->setHeaderText(
$lng->txt(
"sty_confirm_template_deletion"));
2536 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelTemplateDeletion");
2537 $cgui->setConfirm(
$lng->txt(
"sty_del_template"),
"deleteTemplate");
2539 foreach (
$_POST[
"tid"] as $tid)
2541 $classes = $this->
object->getTemplateClasses($tid);
2544 foreach ($classes as $cl)
2546 if ($cl !=
"" && !$listed[$cl])
2548 $cl_str.=
'<div>- '.
2550 $listed[$cl] =
true;
2555 $cl_str =
'<div style="padding-left:30px;" class="small">'.
2556 "<div><i>".$lng->txt(
"sty_style_class").
"</i></div>".$cl_str.
"</div>";
2558 $cgui->addItem(
"tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2561 $cgui->addButton(
$lng->txt(
"sty_del_template_keep_classes"),
"deleteTemplateKeepClasses");
2563 $tpl->setContent($cgui->getHTML());
2574 $ilCtrl->redirect($this,
"listTemplates");
2584 if (is_array(
$_POST[
"tid"]))
2586 foreach (
$_POST[
"tid"] as $tid)
2588 $this->
object->removeTemplate($tid);
2592 $ilCtrl->redirect($this,
"listTemplates");
2602 if (is_array(
$_POST[
"tid"]))
2604 foreach (
$_POST[
"tid"] as $tid)
2606 $cls = $this->
object->getTemplateClasses($tid);
2607 foreach ($cls as $k => $cls)
2609 $ty = $this->
object->determineTemplateStyleClassType(
$_GET[
"temp_type"], $k);
2611 $this->
object->deleteCharacteristic($ty, $ta, $cls);
2613 $this->
object->removeTemplate($tid);
2617 $ilCtrl->redirect($this,
"listTemplates");
2628 $tpl->setContent($this->form_gui->getHTML());
2638 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2641 $this->form_gui->setTitle(
$lng->txt(
"sty_generate_template"));
2645 $name_input->setPattern(
"/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2646 $name_input->setNoMatchMessage(
$lng->txt(
"sty_msg_color_must_only_include").
" A-Z, a-z, 1-9");
2647 $name_input->setRequired(
true);
2648 $name_input->setSize(30);
2649 $name_input->setMaxLength(30);
2650 $this->form_gui->addItem($name_input);
2655 "coloredZebra" =>
$lng->txt(
"sty_table_template_colored_zebra"),
2656 "bwZebra" =>
$lng->txt(
"sty_table_template_bw_zebra"),
2657 "noZebra" =>
$lng->txt(
"sty_table_template_no_zebra")
2660 $this->form_gui->addItem($bl_input);
2663 include_once(
"./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2665 $num_input->setAllowPercentage(
false);
2666 $num_input->setValue(
"3px");
2667 $this->form_gui->addItem($num_input);
2671 $num_input->setAllowPercentage(
false);
2672 $num_input->setValue(
"10px");
2673 $this->form_gui->addItem($num_input);
2677 $cs = $this->
object->getColors();
2684 $this->form_gui->addItem($bc_input);
2687 $lss = array(
"border" => 90,
"header_text" => 70,
"header_bg" => 0,
2688 "cell1_text" => -60,
"cell1_bg" => 90,
"cell2_text" => -60,
"cell2_bg" => 75);
2689 foreach ($lss as $ls => $v)
2692 $l_input->setMaxValue(100);
2693 $l_input->setMinValue(-100);
2694 $l_input->setValue($v);
2695 $l_input->setSize(4);
2696 $l_input->setMaxLength(4);
2697 $this->form_gui->addItem($l_input);
2700 $this->form_gui->addCommandButton(
"templateGeneration",
$lng->txt(
"generate"));
2701 $this->form_gui->addCommandButton(
"cancelTemplateSaving",
$lng->txt(
"cancel"));
2702 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
2714 if ($this->form_gui->checkInput())
2716 if ($this->object->templateExists(
$_POST[
"name"]))
2718 $name_input = $this->form_gui->getItemByPostVar(
"name");
2719 $name_input->setAlert(
$lng->txt(
"sty_table_template_already_exists"));
2726 $cells = array(
"H" =>
"header",
"C1" =>
"cell1",
"C2" =>
"cell2");
2727 $tb_p = $this->form_gui->getItemByPostVar(
"tb_padding");
2728 $tb_padding = $tb_p->getValue();
2729 $lr_p = $this->form_gui->getItemByPostVar(
"lr_padding");
2730 $lr_padding = $lr_p->getValue();
2731 $cell_color =
$_POST[
"base_color"];
2734 if (
$_POST[
"layout"] ==
"bwZebra")
2736 $cell_color =
"MidGray";
2737 if (!$this->object->colorExists($cell_color))
2739 $this->
object->addColor($cell_color,
"7F7F7F");
2741 $this->
object->updateColor($cell_color, $cell_color,
"7F7F7F");
2744 foreach ($cells as $k => $cell)
2746 $cell_class[$k] =
$_POST[
"name"].$k;
2747 if (!$this->object->characteristicExists($cell_class[$k],
"table_cell"))
2749 $this->
object->addCharacteristic(
"table_cell", $cell_class[$k],
true);
2751 if (
$_POST[
"layout"] ==
"bwZebra" && $k ==
"H")
2753 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2754 "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2755 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2756 "!".
$_POST[
"base_color"].
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2760 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"color",
2761 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_text"].
")",
"table_cell");
2762 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"background-color",
2763 "!".$cell_color.
"(".
$_POST[
"lightness_".$cell.
"_bg"].
")",
"table_cell");
2765 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-top",
2766 $tb_padding,
"table_cell");
2767 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-bottom",
2768 $tb_padding,
"table_cell");
2769 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-left",
2770 $lr_padding,
"table_cell");
2771 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"padding-right",
2772 $lr_padding,
"table_cell");
2773 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-width",
2774 "1px",
"table_cell");
2775 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-style",
2776 "solid",
"table_cell");
2777 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"border-color",
2778 "!".$cell_color.
"(".
$_POST[
"lightness_border"].
")",
"table_cell");
2779 $this->
object->replaceStylePar(
"td", $cell_class[$k],
"font-weight",
2780 "normal",
"table_cell");
2784 $classes[
"table"] =
$_POST[
"name"].
"T";
2785 if (!$this->object->characteristicExists($classes[
"table"],
"table"))
2787 $this->
object->addCharacteristic(
"table", $classes[
"table"],
true);
2789 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"caption-side",
2791 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-collapse",
2792 "collapse",
"table");
2793 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-top",
2795 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"margin-bottom",
2797 if (
$_POST[
"layout"] ==
"bwZebra")
2799 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-color",
2800 "!".
$_POST[
"base_color"],
"table");
2801 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-style",
2803 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-bottom-width",
2805 $sb = array(
"left",
"right",
"top");
2808 $this->
object->replaceStylePar(
"table", $classes[
"table"],
"border-".$b.
"-width",
2813 switch (
$_POST[
"layout"])
2815 case "coloredZebra":
2816 $classes[
"row_head"] = $cell_class[
"H"];
2817 $classes[
"odd_row"] = $cell_class[
"C1"];
2818 $classes[
"even_row"] = $cell_class[
"C2"];
2822 $classes[
"row_head"] = $cell_class[
"H"];
2823 $classes[
"odd_row"] = $cell_class[
"C1"];
2824 $classes[
"even_row"] = $cell_class[
"C2"];
2828 $classes[
"row_head"] = $cell_class[
"H"];
2829 $classes[
"odd_row"] = $cell_class[
"C1"];
2830 $classes[
"even_row"] = $cell_class[
"C1"];
2831 $classes[
"col_head"] = $cell_class[
"C2"];
2836 $t_id = $this->
object->addTemplate(
$_GET[
"temp_type"],
2837 $_POST[
"name"], $classes);
2838 $this->
object->writeTemplatePreview($t_id,
2840 $ilCtrl->redirect($this,
"listTemplates");
2843 $this->form_gui->setValuesByPost();
2844 $tpl->setContent($this->form_gui->getHTML());
2851 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2854 $acc->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2855 $acc->addItem(
"Header 2", str_repeat(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2859 $ac2->addItem(
"Header 1", str_repeat(
"bla bla bla bla bla bla", 30));
2860 $ac2->addItem(
"Header 2", $acc->getHTML());
2863 $tpl->setContent($ac2->getHTML());
2873 if (
$_GET[
"baseClass"] ==
"ilAdministrationGUI")
2875 $ilCtrl->redirectByClass(
"ilobjstylesettingsgui",
"editContentStyles");
2877 $ilCtrl->returnToParent($this);
Accordion user interface class.
static addCss()
Add required css.
Confirmation screen class.
Class ilObjStyleSheetGUI.
editTemplateObject()
Edit table template.
listImagesObject()
List images of style.
updateMediaQueryObject()
Update media query.
saveMediaQueryOrderObject()
Save media query order.
cancelCharacteristicDeletionObject()
Cancel characteristic deletion.
generateTemplateObject()
Generate table template.
initTagStyleForm($a_mode, $a_cur_tag)
Init tag style editing form.
templateGenerationObject()
Table template generation.
getValues()
FORM: Get current values from persistent object.
refreshObject()
refresh style sheet
cancelUploadObject()
Cancel Upload.
cancelObject()
update style sheet
deleteImageObject()
Delete images.
exportStyleObject()
export style
deleteMediaQueryConfirmationObject()
Confirm media query deletion.
listMediaQueriesObject()
List media queries of style.
deleteCharacteristicConfirmationObject()
Characteristic deletion confirmation screen.
cancelTemplateDeletionObject()
Cancel table template deletion.
getAdminTabs(&$tabs_gui)
admin and normal tabs are equal for roles
deleteColorObject()
Delete colors.
getPropertiesValues()
Get current values for properties from.
getTemplatePreview($a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
newStyleParameterObject()
add style parameter
addCharacteristicFormObject()
Add characteristic.
pasteCharacteristicsObject()
Paste characteristics.
editObject()
edit style sheet
deleteObject($a_error=false)
display deletion confirmation screen
refreshTemplateObject()
Refresh table template.
deleteTemplateObject()
Delete table template.
deleteColorConfirmationObject()
Delete color confirmation.
cancelColorDeletionObject()
Cancel color deletion.
deleteTemplateKeepClassesObject()
Delete table template.
getColorFormValues()
Set values for color editing.
getTabs(&$tabs_gui)
adds tabs to tab gui object
addAdminLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
getTemplateFormValues()
Set values for table template editing.
updateTagStyleObject()
save and refresh tag editing
initTemplateGenerationForm()
Init table template generation form.
deleteTemplateConfirmationObject()
Delete table template confirmation.
pasteCharacteristicsOverviewObject()
Paste characteristics overview.
saveHideStatusObject()
Save hide status for characteristics.
writeStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom=false)
initColorForm($a_mode="create")
Init color form.
cancelColorSavingObject()
Cancel color saving.
copyStyleObject()
save style sheet
outputTagStyleEditScreen()
Output tag style edit screen.
switchMQueryObject()
Switch media query.
addMediaQueryObject()
Add a media query.
updateObject()
Update properties.
addColorObject()
Add a color.
initTemplateForm($a_mode="create")
Init table template form.
deleteStyleParameterObject()
delete style parameters
displayTemplateEditForm()
Display table tempalte edit form.
updateTemplateObject($a_refresh=false)
Update table template.
addTemplateObject()
Add template.
importStyleObject()
import style sheet
deleteMediaQueriesObject()
Delete Media Queries.
initMediaQueryForm($a_mode="create")
Init media query form.
saveCharacteristicObject()
Save Characteristic.
copyCharacteristicsObject()
Copy style classes.
cancelDeleteObject()
cancel oobject deletion
refreshTagStyleObject()
save and refresh tag editing
saveTagStyle()
Save tag style.
editMediaQueryObject()
Edit media query.
initImageForm()
Init image form.
editTagStyleObject()
Edit tag style.
confirmedDeleteObject()
delete selected style objects
saveObject()
save style sheet
saveColorObject()
Save color.
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
listColorsObject()
List colors of style.
setTemplatesSubTabs()
adds tabs to tab gui object
saveTemplateObject()
Save table template.
updateColorObject()
Update color.
getMediaQueryFormValues()
Set values for media query editing.
ilObjStyleSheetGUI($a_data, $a_id, $a_call_by_reference, $a_prep=true)
Constructor @access public.
static getStyleExampleHTML($a_type, $a_class)
Get style example HTML.
viewObject()
list childs of current object
deleteCoreCharMessage()
Message that appears, when user tries to delete core characteristics.
uploadImageObject()
Upload image.
includeCSS()
Include CSS in output.
returnToUpperContextObject()
return to upper context
_getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode=false)
Get table template preview.
initCharacteristicForm($a_mode)
Init tag style editing form.
extractParametersOfTag($a_tag, $a_class, $a_style, $a_type, $a_mq_id=0, $a_custom=false)
propertiesObject()
Properties.
& executeCommand()
execute command
setSubTabs()
adds tabs to tab gui object
saveMediaQueryObject()
Save media query.
addImageObject()
Add an image.
listTemplatesObject()
List templates.
editColorObject()
Edit color.
cancelTemplateSavingObject()
Cancel color saving.
deleteCharacteristicObject()
Delete one or multiple style characteristic.
static _getStyleParameterInputType($par)
static _getTemplateClassTypes($a_template_type="")
Get template class types.
static _getFilteredGroups()
static _getStyleParameters($a_tag="")
lookupTemplateName($a_t_id)
Lookup table template name for template ID.
static _isExpandable($a_type)
_writeStandard($a_id, $a_std)
Write standard flag.
static _determineTag($a_type)
static _getStyleSuperTypeForType($a_type)
_getClonableContentStyles()
Get all clonable styles (active standard styles and individual learning module styles with write perm...
_writeUpToDate($a_id, $a_up_to_date)
Write up to date.
static _getStyleSuperTypes()
static _getCoreStyles()
Get core styles.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
prepareOutput()
prepare output
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _renderTable($content, $a_mode="table_edit", $a_submode="", $a_table_obj=null)
Static render table function.
Paste style overview table.
TableGUI class for style editor (image list)
TableGUI class for style editor (image list)
TableGUI class for style editor.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
redirection script todo: (a better solution should control the processing via a xml file)
if(!is_array($argv)) $options