ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjStyleSheetGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "./Services/Object/classes/class.ilObjectGUI.php";
5require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
6
17{
22
27 function ilObjStyleSheetGUI($a_data,$a_id,$a_call_by_reference, $a_prep = true)
28 {
29 global $ilCtrl, $lng, $tpl;
30
31 $this->ctrl =& $ilCtrl;
32 $this->lng =& $lng;
33 $this->lng->loadLanguageModule("style");
34 $ilCtrl->saveParameter($this, array("tag", "style_type", "temp_type"));
35 if ($_GET["style_type"] != "")
36 {
37 $this->super_type = ilObjStyleSheet::_getStyleSuperTypeForType($_GET["style_type"]);
38 }
39
40 $this->type = "sty";
41 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
42 }
43
47 function &executeCommand()
48 {
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd("edit");
51
52 // #9440/#9489: prepareOutput will fail if not set properly
53 if(!$this->object)
54 {
55 $this->setCreationMode(true);
56 }
57
58 $this->prepareOutput();
59 switch($next_class)
60 {
61 default:
62 $cmd.= "Object";
63 $ret =& $this->$cmd();
64 break;
65 }
66
67 return $ret;
68 }
69
70 function viewObject()
71 {
72 $this->editObject();
73 }
74
78 function createObject()
79 {
80 global $rbacsystem, $lng, $tpl, $ilHelp;
81
82 $forms = array();
83
84
85 $ilHelp->setScreenIdComponent("sty");
86 $ilHelp->setDefaultScreenId(ilHelpGUI::ID_PART_SCREEN, "create");
87
88 // --- create
89
90 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
91 $form = new ilPropertyFormGUI();
92 $form->setFormAction($this->ctrl->getFormAction($this));
93 $form->setTitle($this->lng->txt("sty_create_new_stylesheet"));
94
95 // title
96 $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
97 $ti->setMaxLength(128);
98 $ti->setSize(40);
99 $ti->setRequired(true);
100 $form->addItem($ti);
101
102 // description
103 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
104 $ta->setCols(40);
105 $ta->setRows(2);
106 $form->addItem($ta);
107
108 $form->addCommandButton("save", $this->lng->txt("save"));
109 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
110
111 $forms[] = $form;
112
113
114 // --- import
115
116 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
117 $form = new ilPropertyFormGUI();
118 $form->setFormAction($this->ctrl->getFormAction($this));
119 $form->setTitle($this->lng->txt("sty_import_stylesheet"));
120
121 // title
122 $ti = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
123 $ti->setRequired(true);
124 $form->addItem($ti);
125
126 $form->addCommandButton("importStyle", $this->lng->txt("import"));
127 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
128
129 $forms[] = $form;
130
131
132 // --- clone
133
134 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
135 $form = new ilPropertyFormGUI();
136 $form->setFormAction($this->ctrl->getFormAction($this));
137 $form->setTitle($this->lng->txt("sty_copy_other_stylesheet"));
138
139 // source
140 $ti = new ilSelectInputGUI($this->lng->txt("sty_source"), "source_style");
141 $ti->setRequired(true);
143 $form->addItem($ti);
144
145 $form->addCommandButton("copyStyle", $this->lng->txt("copy"));
146 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
147
148 $forms[] = $form;
149
150
151 $this->tpl->setContent($this->getCreationFormsHTML($forms));
152 }
153
157 function includeCSS()
158 {
159 // set style sheet
160 $this->tpl->setCurrentBlock("ContentStyle");
161 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
162 $this->object->getContentStylePath($this->object->getId()));
163 $this->tpl->parseCurrentBlock();
164 }
165
169 function editObject()
170 {
171 global $rbacsystem, $lng, $ilTabs, $ilCtrl, $ilToolbar, $tpl;
172
173 $this->setSubTabs();
174
175 $this->includeCSS();
176
177 $ctpl = new ilTemplate("tpl.sty_classes.html", true, true, "Services/Style");
178
179 // output characteristics
180 $chars = $this->object->getCharacteristics();
181
182 $style_type = ($this->super_type != "")
183 ? $this->super_type
184 : "text_block";
185 $ilCtrl->setParameter($this, "style_type", $style_type);
186 $ilTabs->setSubTabActive("sty_".$style_type."_char");
187
188 // workaround to include default rte styles
189 if ($this->super_type == "rte")
190 {
191 $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
192 include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
193 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
194 }
195
196 // add new style?
197 $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
198 $subtypes = $all_super_types[$style_type];
199 $expandable = false;
200 foreach ($subtypes as $t)
201 {
203 {
204 $expandable = true;
205 }
206 }
207 if ($expandable && $rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
208 {
209 $ilToolbar->addButton($lng->txt("sty_add_characteristic"),
210 $ilCtrl->getLinkTarget($this, "addCharacteristicForm"));
211 }
212
213 if ($_SESSION["sty_copy"] != "")
214 {
215
216 $style_cp = explode(":::", $_SESSION["sty_copy"]);
217 if ($style_cp[1] == $style_type)
218 {
219
220 if ($expandable)
221 {
222 $ilToolbar->addSeparator();
223 }
224 $ilToolbar->addButton($lng->txt("sty_paste_style_classes"),
225 $ilCtrl->getLinkTarget($this, "pasteCharacteristicsOverview"));
226 }
227 }
228
229 include_once("./Services/Style/classes/class.ilStyleTableGUI.php");
230 $table_gui = new ilStyleTableGUI($this, "edit", $chars, $style_type,
231 $this->object);
232
233 $ctpl->setCurrentBlock("style_table");
234 $ctpl->setVariable("STYLE_TABLE", $table_gui->getHTML());
235 $ctpl->parseCurrentBlock();
236
237 $this->tpl->setContent($ctpl->get());
238 }
239
244 {
245 global $rbacsystem, $lng, $ilToolbar;
246
247 // set style sheet
248 $this->tpl->setCurrentBlock("ContentStyle");
249 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
250 $this->object->getContentStylePath($this->object->getId()));
251 $this->tpl->parseCurrentBlock();
252
253 // export button
254 $ilToolbar->addButton($this->lng->txt("export"),
255 $this->ctrl->getLinkTarget($this, "exportStyle"));
256
257 $this->initPropertiesForm();
258 $this->getPropertiesValues();
259 $this->tpl->setContent($this->form->getHTML());
260 }
261
266 public function getPropertiesValues()
267 {
268 $values = array();
269
270 $values["style_title"] = $this->object->getTitle();
271 $values["style_description"] = $this->object->getDescription();
272 $values["disable_auto_margins"] = (int) $this->object->lookupStyleSetting("disable_auto_margins");
273
274 $this->form->setValuesByArray($values);
275 }
276
282 public function initPropertiesForm($a_mode = "edit")
283 {
284 global $lng, $rbacsystem;
285
286 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
287 $this->form = new ilPropertyFormGUI();
288
289 // title
290 $ti = new ilTextInputGUI($this->lng->txt("title"), "style_title");
291 $ti->setMaxLength(128);
292 $ti->setSize(40);
293 $ti->setRequired(true);
294 $this->form->addItem($ti);
295
296 // description
297 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "style_description");
298 //$ta->setCols();
299 //$ta->setRows();
300 $this->form->addItem($ta);
301
302 // disable automatic margins for left/right alignment
303 $cb = new ilCheckboxInputGUI($this->lng->txt("sty_disable_auto_margins"), "disable_auto_margins");
304 $cb->setInfo($this->lng->txt("sty_disable_auto_margins_info"));
305 $this->form->addItem($cb);
306
307 // save and cancel commands
308
309 if ($a_mode == "create")
310 {
311 $this->form->addCommandButton("save", $lng->txt("save"));
312 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
313 }
314 else
315 {
316 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
317 {
318 $this->form->addCommandButton("update", $lng->txt("save"));
319 }
320 }
321
322 $this->form->setTitle($lng->txt("edit_stylesheet"));
323 $this->form->setFormAction($this->ctrl->getFormAction($this));
324
325 }
326
330 function updateObject()
331 {
332 global $lng, $ilCtrl, $tpl;
333
334 $this->initPropertiesForm("edit");
335 if ($this->form->checkInput())
336 {
337 $this->object->setTitle($this->form->getInput("style_title"));
338 $this->object->setDescription($this->form->getInput("style_description"));
339 $this->object->writeStyleSetting("disable_auto_margins",
340 $this->form->getInput("disable_auto_margins"));
341 $this->object->update();
342 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
343 $ilCtrl->redirect($this, "properties");
344 }
345 else
346 {
347 $this->form->setValuesByPost();
348 $tpl->setContent($this->form->getHtml());
349 }
350 }
351
356 {
357 global $ilCtrl;
358
359 $cur = explode(".",$_GET["tag"]);
360 $cur_tag = $cur[0];
361 $cur_class = $cur[1];
362
363 $this->initTagStyleForm("edit", $cur_tag);
364
365 if ($this->form_gui->checkInput())
366 {
367 $this->saveTagStyle();
368 $ilCtrl->redirect($this, "editTagStyle");
369 }
370 else
371 {
372 $this->form_gui->setValuesByPost();
374 }
375 }
376
381 {
382 global $ilCtrl;
383
384 $cur = explode(".",$_GET["tag"]);
385 $cur_tag = $cur[0];
386 $cur_class = $cur[1];
387
388 $this->initTagStyleForm("edit", $cur_tag);
389 if ($this->form_gui->checkInput())
390 {
391 $this->saveTagStyle();
392 $ilCtrl->redirect($this, "edit");
393 }
394 else
395 {
396 $this->form_gui->setValuesByPost();
398 }
399 }
400
404 function saveTagStyle()
405 {
406 $cur = explode(".", $_GET["tag"]);
407 $cur_tag = $cur[0];
408 $cur_class = $cur[1];
409 $avail_pars = ilObjStyleSheet::_getStyleParameters($cur_tag);
410 foreach ($avail_pars as $par => $v)
411 {
412 $var = str_replace("-", "_", $par);
413 $basepar_arr = explode(".", $par);
414 $basepar = $basepar_arr[0];
415 if ($basepar_arr[1] != "" && $basepar_arr[1] != $cur_tag)
416 {
417 continue;
418 }
419
420 switch ($v["input"])
421 {
422 case "fontsize":
423 case "numeric_no_perc":
424 case "numeric":
425 case "background_image":
426 $in = $this->form_gui->getItemByPostVar($basepar);
427//echo "<br>-".$cur_tag."-".$cur_class."-".$basepar."-".$_GET["style_type"]."-";
428 $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
429 break;
430
431 case "color":
432 $color = trim($_POST[$basepar]);
433 if ($color != "" && trim(substr($color,0,1) != "!"))
434 {
435 $color = "#".$color;
436 }
437 $this->writeStylePar($cur_tag, $cur_class, $basepar, $color, $_GET["style_type"], (int) $_GET["mq_id"]);
438 break;
439
440 case "trbl_numeric":
441 case "border_width":
442 case "border_style":
443 $in = $this->form_gui->getItemByPostVar($basepar);
444 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][0], $in->getAllValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
445 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][1], $in->getTopValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
446 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][2], $in->getRightValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
447 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][3], $in->getBottomValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
448 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][4], $in->getLeftValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
449 break;
450
451 case "trbl_color":
452 $in = $this->form_gui->getItemByPostVar($basepar);
453 $tblr_p = array (0 => "getAllValue", 1 => "getTopValue", 2 => "getRightValue",
454 3 => "getBottomValue", 4 => "getLeftValue");
455 foreach ($tblr_p as $k => $func)
456 {
457 $val = trim($in->$func());
458 $val = (($in->getAcceptNamedColors() && substr($val, 0, 1) == "!")
459 || $val == "")
460 ? $val
461 : "#".$val;
462 $this->writeStylePar($cur_tag, $cur_class, $v["subpar"][$k], $val, $_GET["style_type"], (int) $_GET["mq_id"]);
463 }
464 break;
465
466 case "background_position":
467 $in = $this->form_gui->getItemByPostVar($basepar);
468 $this->writeStylePar($cur_tag, $cur_class, $basepar, $in->getValue(), $_GET["style_type"], (int) $_GET["mq_id"]);
469 break;
470
471 default:
472 $this->writeStylePar($cur_tag, $cur_class, $basepar, $_POST[$basepar], $_GET["style_type"], (int) $_GET["mq_id"]);
473 break;
474 }
475 }
476
477 // write custom parameter
478 $this->object->deleteCustomStylePars($cur_tag, $cur_class, $_GET["style_type"], (int) $_GET["mq_id"]);
479 if (is_array($_POST["custom_par"]))
480 {
481 foreach ($_POST["custom_par"] as $cpar)
482 {
483 $par_arr = explode(":", $cpar);
484 if (count($par_arr) == 2)
485 {
486 $par = trim($par_arr[0]);
487 $val = trim(str_replace(";", "", $par_arr[1]));
488 $this->writeStylePar($cur_tag, $cur_class, $par, $val, $_GET["style_type"], (int) $_GET["mq_id"], true);
489 }
490 }
491 }
492
493 $this->object->update();
494 }
495
496 function writeStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom = false)
497 {
498// echo $_GET["mq_id"]."-";
499// echo $a_mq_id."-"; exit;
500 if ($a_type == "")
501 {
502 return;
503 }
504
505 if ($value != "")
506 {
507 $this->object->replaceStylePar($cur_tag, $cur_class, $par, $value, $a_type, $a_mq_id, $a_custom);
508 }
509 else
510 {
511 $this->object->deleteStylePar($cur_tag, $cur_class, $par, $a_type, $a_mq_id, $a_custom);
512 }
513 }
514
520 {
521 global $tpl, $ilToolbar, $lng, $ilCtrl;
522
523 // media query selector
524 $mqs = $this->object->getMediaQueries();
525 if (count($mqs) > 0)
526 {
527 //
528 $options = array(
529 "" => $lng->txt("sty_default"),
530 );
531 foreach ($mqs as $mq)
532 {
533 $options[$mq["id"]] = $mq["mquery"];
534 }
535 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
536 $si = new ilSelectInputGUI("@media", "mq_id");
537 $si->setOptions($options);
538 $si->setValue((int) $_GET["mq_id"]);
539 $ilToolbar->addInputItem($si, true);
540 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
541 $ilToolbar->addFormButton($lng->txt("sty_switch"), "switchMQuery");
542 }
543
544 // workaround to include default rte styles
545 //if (in_array($_GET["style_type"], array("rte_menu")))
546 if ($this->super_type == "rte")
547 {
548 $tpl->addCss("Modules/Scorm2004/templates/default/player.css");
549 include_once("./Modules/Scorm2004/classes/ilSCORM13Player.php");
550 $tpl->addInlineCss(ilSCORM13Player::getInlineCss());
551 }
552
553 $cur = explode(".",$_GET["tag"]);
554 $cur_tag = $cur[0];
555 $cur_class = $cur[1];
556
557 $this->initTagStyleForm("edit", $cur_tag);
558 $this->getValues();
560 }
561
569 {
570 global $ilCtrl;
571
572 $ilCtrl->setParameter($this, "mq_id", (int) $_POST["mq_id"]);
573 $ilCtrl->redirect($this, "editTagStyle");
574 }
575
576
581 {
582 global $tpl, $ilCtrl, $lng;
583
584 // set style sheet
585 $tpl->setCurrentBlock("ContentStyle");
586 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
587 $this->object->getContentStylePath($this->object->getId()));
588
589 $ts_tpl = new ilTemplate("tpl.style_tag_edit.html", true, true, "Services/Style");
590
591 $cur = explode(".",$_GET["tag"]);
592 $cur_tag = $cur[0];
593 $cur_class = $cur[1];
594
595 $ts_tpl->setVariable("EXAMPLE",
596 ilObjStyleSheetGUI::getStyleExampleHTML($_GET["style_type"], $cur_class));
597
598 $ts_tpl->setVariable("FORM",
599 $this->form_gui->getHtml());
600
601 $tpl->setTitle($cur_class." (".$lng->txt("sty_type_".$_GET["style_type"]).")");
602
603 $tpl->setContent($ts_tpl->get());
604 }
605
606
612 public function initTagStyleForm($a_mode, $a_cur_tag)
613 {
614 global $lng, $ilCtrl;
615
616 $ilCtrl->saveParameter($this, array("mq_id"));
617
618 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
619 $this->form_gui = new ilPropertyFormGUI();
620
621 $avail_pars = $this->object->getAvailableParameters();
622 $groups = $this->object->getStyleParameterGroups();
623
624 // output select lists
625 foreach ($groups as $k => $group)
626 {
627 // filter groups of properties that should only be
628 // displayed with matching tag
629 $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
630 if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k]))
631 {
632 continue;
633 }
634
635 $sh = new ilFormSectionHeaderGUI();
636 $sh->setTitle($lng->txt("sty_".$k));
637 $this->form_gui->addItem($sh);
638
639 foreach ($group as $par)
640 {
641 $basepar = explode(".", $par);
642 $basepar = $basepar[0];
643
644 $var = str_replace("-", "_", $basepar);
645 $up_par = strtoupper($var);
646
648 {
649 case "select":
650 $sel_input = new ilSelectInputGUI($lng->txt("sty_".$var), $basepar);
651 $options = array("" => "");
652 foreach ($avail_pars[$par] as $p)
653 {
654 $options[$p] = $p;
655 }
656 $sel_input->setOptions($options);
657 $this->form_gui->addItem($sel_input);
658 break;
659
660 case "text":
661 $text_input = new ilTextInputGUI($lng->txt("sty_".$var), $basepar);
662 $text_input->setMaxLength(200);
663 $text_input->setSize(20);
664 $this->form_gui->addItem($text_input);
665 break;
666
667 case "fontsize":
668 include_once("./Services/Style/classes/class.ilFontSizeInputGUI.php");
669 $fs_input = new ilFontSizeInputGUI($lng->txt("sty_".$var), $basepar);
670 $this->form_gui->addItem($fs_input);
671 break;
672
673 case "numeric_no_perc":
674 case "numeric":
675 include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
676 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
677 if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc")
678 {
679 $num_input->setAllowPercentage(false);
680 }
681 $this->form_gui->addItem($num_input);
682 break;
683
684 case "percentage":
685 $per_input = new ilNumberInputGUI($lng->txt("sty_".$var), $basepar);
686 $per_input->setMinValue(0);
687 $per_input->setMaxValue(100);
688 $per_input->setMaxLength(3);
689 $per_input->setSize(3);
690 $this->form_gui->addItem($per_input);
691 break;
692
693 case "color":
694 //include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
695 $col_input = new ilColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
696 $col_input->setDefaultColor("");
697 $col_input->setAcceptNamedColors(true);
698 $this->form_gui->addItem($col_input);
699 break;
700
701 case "trbl_numeric":
702 include_once("./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php");
703 $num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_".$var), $basepar);
704 if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc")
705 {
706 $num_input->setAllowPercentage(false);
707 }
708 $this->form_gui->addItem($num_input);
709 break;
710
711 case "border_width":
712 include_once("./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php");
713 $bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_".$var), $basepar);
714 $this->form_gui->addItem($bw_input);
715 break;
716
717 case "border_style":
718 include_once("./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php");
719 $bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_".$var), $basepar);
720 $this->form_gui->addItem($bw_input);
721 break;
722
723 case "trbl_color":
724 include_once("./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php");
725 $col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_".$var), $basepar);
726 $col_input->setAcceptNamedColors(true);
727 $this->form_gui->addItem($col_input);
728 break;
729
730 case "background_image":
731 include_once("./Services/Style/classes/class.ilBackgroundImageInputGUI.php");
732 $im_input = new ilBackgroundImageInputGUI($lng->txt("sty_".$var), $basepar);
733 $imgs = array();
734 foreach ($this->object->getImages() as $entry)
735 {
736 $imgs[] = $entry["entry"];
737 }
738 $im_input->setImages($imgs);
739 $this->form_gui->addItem($im_input);
740 break;
741
742 case "background_position":
743 include_once("./Services/Style/classes/class.ilBackgroundPositionInputGUI.php");
744 $im_input = new ilBackgroundPositionInputGUI($lng->txt("sty_".$var), $basepar);
745 $this->form_gui->addItem($im_input);
746 break;
747 }
748 }
749 }
750
751 // custom parameters
752 $sh = new ilFormSectionHeaderGUI();
753 $sh->setTitle($lng->txt("sty_custom"));
754 $this->form_gui->addItem($sh);
755
756 // custom parameters
757 $ti = new ilTextInputGUI($this->lng->txt("sty_custom_par"), "custom_par");
758 $ti->setMaxLength(300);
759 $ti->setSize(80);
760 $ti->setMulti(true);
761 $ti->setInfo($this->lng->txt("sty_custom_par_info"));
762 $this->form_gui->addItem($ti);
763
764
765 // save and cancel commands
766 $this->form_gui->addCommandButton("updateTagStyle", $lng->txt("save_return"));
767 $this->form_gui->addCommandButton("refreshTagStyle", $lng->txt("save_refresh"));
768
769// $this->form_gui->setTitle($lng->txt("edit"));
770 $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
771 }
772
777 public function getValues()
778 {
779 $style = $this->object->getStyle();
780 $cur = explode(".",$_GET["tag"]);
781 $cur_tag = $cur[0];
782 $cur_class = $cur[1];
783 $cur_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
784 (int) $_GET["mq_id"], false);
786 foreach($parameters as $p => $v)
787 {
788 $filtered_groups = ilObjStyleSheet::_getFilteredGroups();
789 if (is_array($filtered_groups[$v["group"]]) && !in_array($cur_tag, $filtered_groups[$v["group"]]))
790 {
791 continue;
792 }
793 $p = explode(".", $p);
794 $p = $p[0];
795 $input = $this->form_gui->getItemByPostVar($p);
796 switch ($v["input"])
797 {
798 case "":
799 break;
800
801 case "trbl_numeric":
802 case "border_width":
803 case "border_style":
804 case "trbl_color":
805 $input->setAllValue($cur_parameters[$v["subpar"][0]]);
806 $input->setTopValue($cur_parameters[$v["subpar"][1]]);
807 $input->setRightValue($cur_parameters[$v["subpar"][2]]);
808 $input->setBottomValue($cur_parameters[$v["subpar"][3]]);
809 $input->setLeftValue($cur_parameters[$v["subpar"][4]]);
810 break;
811
812 default:
813 $input->setValue($cur_parameters[$p]);
814 break;
815 }
816 }
817
818 $cust_parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style, $_GET["style_type"],
819 (int) $_GET["mq_id"], true);
820 $vals = array();
821 foreach ($cust_parameters as $k => $c)
822 {
823 $vals[] = $k.": ".$c;
824 }
825 $input = $this->form_gui->getItemByPostVar("custom_par");
826 $input->setValue($vals);
827 }
828
833 {
834 include_once("./Services/Export/classes/class.ilExport.php");
835 $exp = new ilExport();
836 $r = $exp->exportObject($this->object->getType(),$this->object->getId());
837
838 ilUtil::deliverFile($r["directory"]."/".$r["file"], $r["file"], '', false, true);
839 }
840
841 function extractParametersOfTag($a_tag, $a_class, $a_style, $a_type, $a_mq_id = 0, $a_custom = false)
842 {
843 $parameters = array();
844 foreach($a_style as $tag)
845 {
846 foreach($tag as $par)
847 {
848 if ($par["tag"] == $a_tag && $par["class"] == $a_class
849 && $par["type"] == $a_type && (int) $a_mq_id == (int) $par["mq_id"]
850 && (int) $a_custom == (int) $par["custom"])
851 {
852 $parameters[$par["parameter"]] = $par["value"];
853 }
854 }
855 }
856 return $parameters;
857 }
858
863 {
864 $this->object->addParameter($_POST["tag"], $_POST["parameter"]);
865 $this->editObject();
866 }
867
871 function refreshObject()
872 {
873 $this->object->setTitle($_POST["style_title"]);
874 $this->object->setDescription($_POST["style_description"]);
875
876 foreach($_POST["styval"] as $id => $value)
877 {
878 $this->object->updateStyleParameter($id, $value);
879 }
880 $this->object->update();
881 $this->editObject();
882 }
883
889 function deleteObject($a_error = false)
890 {
891 //$this->setTabs();
892
893 // display confirmation message
894 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
895 $cgui = new ilConfirmationGUI();
896 $cgui->setFormAction($this->ctrl->getFormAction($this));
897 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
898 $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
899 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
900
901 $caption = ilUtil::getImageTagByType("sty", $this->tpl->tplPath).
902 " ".ilObject::_lookupTitle($this->object->getId());
903
904 $cgui->addItem("id[]", "", $caption);
905
906 $this->tpl->setContent($cgui->getHTML());
907 }
908
909
914 {
915 $this->ctrl->returnToParent($this);
916 }
917
922 {
923 global $ilias;
924
925 $this->object->delete();
926
927 $this->ctrl->returnToParent($this);
928 }
929
934 {
935 if (is_array($_POST["sty_select"]))
936 {
937 foreach($_POST["sty_select"] as $id => $dummy)
938 {
939 $this->object->deleteParameter($id);
940 }
941 }
942 $this->object->read();
943 $this->object->writeCSSFile();
944 $this->editObject();
945 }
946
950 function saveObject()
951 {
952 if(!trim($_POST["style_title"]))
953 {
954 $this->ctrl->redirect($this, "create");
955 }
956
957//echo "HH"; exit;
958 $class_name = "ilObjStyleSheet";
959 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
960 $newObj = new ilObjStyleSheet();
961 $newObj->setTitle("-");
962 $newObj->create();
963 $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"]));
964 $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"]));
965 $newObj->update();
966
967 // assign style to style sheet folder,
968 // if parent is style sheet folder
969 if ($_GET["ref_id"] > 0)
970 {
971
972 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
973 if ($fold->getType() == "stys")
974 {
975 $fold->addStyle($newObj->getId());
976 $fold->update();
977 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
978 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
979 }
980 }
981
982 return $newObj->getId();
983 }
984
989 {
990 global $ilias;
991
992 if ($_POST["source_style"] > 0)
993 $style_obj =& $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
994 $new_id = $style_obj->ilClone();
995
996 // assign style to style sheet folder,
997 // if parent is style sheet folder
998 if ($_GET["ref_id"] > 0)
999 {
1000
1001 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1002 if ($fold->getType() == "stys")
1003 {
1004 $fold->addStyle($new_id);
1005 $fold->update();
1006 ilObjStyleSheet::_writeStandard($new_id, "1");
1007 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
1008 }
1009 }
1010
1011 return $new_id;
1012 }
1013
1018 {
1019 // check file
1020 $source = $_FILES["importfile"]["tmp_name"];
1021 if (($source == 'none') || (!$source))
1022 {
1023 $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
1024 }
1025
1026 // check correct file type
1027 $info = pathinfo($_FILES["importfile"]["name"]);
1028 if (strtolower($info["extension"]) != "zip" && strtolower($info["extension"]) != "xml")
1029 {
1030 $this->ilias->raiseError("File must be a zip or xml file!",$this->ilias->error_obj->MESSAGE);
1031 }
1032
1033 // new import
1034 $fname = explode("_", $_FILES["importfile"]["name"]);
1035 if (strtolower($info["extension"]) == "zip" && $fname[4] == "sty")
1036 {
1037 include_once("./Services/Export/classes/class.ilImport.php");
1038 $imp = new ilImport();
1039 $new_id = $imp->importObject(null, $_FILES["importfile"]["tmp_name"],
1040 $_FILES["importfile"]["name"], "sty");
1041 if ($new_id > 0)
1042 {
1043 $newObj = ilObjectFactory::getInstanceByObjId($new_id);
1044 }
1045 }
1046 else // old import
1047 {
1048 require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1049 $newObj = new ilObjStyleSheet();
1050 $newObj->import($_FILES["importfile"]);
1051 }
1052
1053 // assign style to style sheet folder,
1054 // if parent is style sheet folder
1055 if ($_GET["ref_id"] > 0)
1056 {
1057 $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
1058 if ($fold->getType() == "stys")
1059 {
1060 $fold->addStyle($newObj->getId());
1061 $fold->update();
1062 ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
1063 $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
1064 }
1065 }
1066 return $newObj->getId();
1067 }
1068
1075 function afterImport($a_new_obj)
1076 {
1077
1078 }
1079
1080
1084 function cancelObject()
1085 {
1086 global $lng;
1087
1088 ilUtil::sendInfo($lng->txt("msg_cancel"), true);
1089 $this->ctrl->returnToParent($this);
1090 }
1091
1095 function getAdminTabs(&$tabs_gui)
1096 {
1097 $this->getTabs($tabs_gui);
1098 }
1099
1103 function setTabs()
1104 {
1105 global $lng;
1106
1107 $this->getTabs($this->tabs_gui);
1108
1109 if (strtolower(get_class($this->object)) == "ilobjstylesheet")
1110 {
1111 $this->tpl->setVariable("HEADER", $this->object->getTitle());
1112 }
1113 else
1114 {
1115 $this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
1116 }
1117 }
1118
1124 function getTabs(&$tabs_gui)
1125 {
1126 global $lng, $ilCtrl, $ilTabs, $ilHelp;
1127
1128 $ilHelp->setScreenIdComponent("sty");
1129
1130 if ($ilCtrl->getCmd() == "editTagStyle")
1131 {
1132 // back to upper context
1133 $tabs_gui->setBackTarget($lng->txt("back"),
1134 $ilCtrl->getLinkTarget($this, "edit"));
1135
1136 $t = explode(".", $_GET["tag"]);
1137 $t2 = explode(":", $t[1]);
1138 $pc = $this->object->_getPseudoClasses($t[0]);
1139 if (is_array($pc) && count($pc) > 0)
1140 {
1141 // style classes
1142 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0]);
1143 $tabs_gui->addTarget("sty_tag_normal",
1144 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1145 get_class($this));
1146 if ($t2[1] == "")
1147 {
1148 $ilTabs->setTabActive("sty_tag_normal");
1149 }
1150
1151 foreach ($pc as $p)
1152 {
1153 // style classes
1154 $ilCtrl->setParameter($this, "tag", $t[0].".".$t2[0].":".$p);
1155 $tabs_gui->addTarget("sty_tag_".$p,
1156 $this->ctrl->getLinkTarget($this, "editTagStyle"), array("editTagStyle", ""),
1157 get_class($this));
1158 if ($t2[1] == $p)
1159 {
1160 $ilTabs->setTabActive("sty_tag_".$p);
1161 }
1162 }
1163 $ilCtrl->setParameter($this, "tag", $_GET["tag"]);
1164 }
1165 }
1166 else
1167 {
1168 // back to upper context
1169 $tabs_gui->setBackTarget($lng->txt("back"),
1170 $this->ctrl->getLinkTarget($this, "returnToUpperContext"));
1171
1172 // style classes
1173 $tabs_gui->addTarget("sty_style_chars",
1174 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1175 get_class($this));
1176
1177 // colors
1178 $tabs_gui->addTarget("sty_colors",
1179 $this->ctrl->getLinkTarget($this, "listColors"), "listColors",
1180 get_class($this));
1181
1182 // media queries
1183 $tabs_gui->addTarget("sty_media_queries",
1184 $this->ctrl->getLinkTarget($this, "listMediaQueries"), "listMediaQueries",
1185 get_class($this));
1186
1187 // images
1188 $tabs_gui->addTarget("sty_images",
1189 $this->ctrl->getLinkTarget($this, "listImages"), "listImages",
1190 get_class($this));
1191
1192 // table templates
1193 $tabs_gui->addTarget("sty_templates",
1194 $this->ctrl->getLinkTarget($this, "listTemplates"), "listTemplates",
1195 get_class($this));
1196
1197 // settings
1198 $tabs_gui->addTarget("settings",
1199 $this->ctrl->getLinkTarget($this, "properties"), "properties",
1200 get_class($this));
1201
1202 // accordiontest
1203/*
1204 $tabs_gui->addTarget("accordiontest",
1205 $this->ctrl->getLinkTarget($this, "accordiontest"), "accordiontest",
1206 get_class($this));*/
1207 }
1208
1209 }
1210
1216 function setSubTabs()
1217 {
1218 global $lng, $ilTabs, $ilCtrl;
1219
1221
1222 foreach ($types as $super_type => $types)
1223 {
1224 // text block characteristics
1225 $ilCtrl->setParameter($this, "style_type", $super_type);
1226 $ilTabs->addSubTabTarget("sty_".$super_type."_char",
1227 $this->ctrl->getLinkTarget($this, "edit"), array("edit", ""),
1228 get_class($this));
1229 }
1230
1231 $ilCtrl->setParameter($this, "style_type", $_GET["style_type"]);
1232 }
1233
1240 {
1241 global $lng, $ilTabs, $ilCtrl;
1242
1244
1245 foreach ($types as $t => $c)
1246 {
1247 $ilCtrl->setParameter($this, "temp_type", $t);
1248 $ilTabs->addSubTabTarget("sty_".$t."_templates",
1249 $this->ctrl->getLinkTarget($this, "listTemplates"), array("listTemplates", ""),
1250 get_class($this));
1251 }
1252
1253 $ilCtrl->setParameter($this, "temp_type", $_GET["temp_type"]);
1254 }
1255
1261 {
1262 global $ilLocator;
1263
1264 if ($_GET["admin_mode"] == "settings") // system settings
1265 {
1266 parent::addAdminLocatorItems(true);
1267
1268 $ilLocator->addItem(ilObject::_lookupTitle(
1269 ilObject::_lookupObjId($_GET["ref_id"])),
1270 $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "view"));
1271
1272 if ($_GET["obj_id"] > 0)
1273 {
1274 $ilLocator->addItem($this->object->getTitle(),
1275 $this->ctrl->getLinkTarget($this, "edit"));
1276 }
1277 }
1278 else // repository administration
1279 {
1280 //?
1281 }
1282
1283 }
1284
1285 function showUpperIcon()
1286 {
1287 global $tree, $tpl, $objDefinition;
1288
1289 if (strtolower($_GET["baseClass"]) == "iladministrationgui")
1290 {
1291 $tpl->setUpperIcon(
1292 $this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui",
1293 "editContentStyles"));
1294 }
1295 else
1296 {
1297 // ?
1298 }
1299 }
1300
1305 {
1306 global $tpl, $ilToolbar, $ilCtrl, $lng, $rbacsystem;
1307
1308 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1309 {
1310 $ilToolbar->addButton($lng->txt("sty_add_image"),
1311 $ilCtrl->getLinkTarget($this, "addImage"));
1312 }
1313
1314 include_once("./Services/Style/classes/class.ilStyleImageTableGUI.php");
1315 $table_gui = new ilStyleImageTableGUI($this, "listImages",
1316 $this->object);
1317 $tpl->setContent($table_gui->getHTML());
1318
1319 }
1320
1325 {
1326 global $tpl;
1327
1328 $this->initImageForm();
1329 $tpl->setContent($this->form_gui->getHTML());
1330 }
1331
1336 {
1337 global $ilCtrl;
1338
1339 $ilCtrl->redirect($this, "listImages");
1340 }
1341
1346 {
1347 global $tpl, $ilCtrl;
1348
1349 $this->initImageForm();
1350
1351 if ($this->form_gui->checkInput())
1352 {
1353 $this->object->uploadImage($_FILES["image_file"]);
1354 $ilCtrl->redirect($this, "listImages");
1355 }
1356 else
1357 {
1358 //$this->form_gui->setImageFormValuesByPost();
1359 $tpl->setContent($this->form_gui->getHTML());
1360 }
1361
1362 }
1363
1367 function initImageForm()
1368 {
1369 global $lng, $ilCtrl;
1370
1371 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1372 $this->form_gui = new ilPropertyFormGUI();
1373
1374 $this->form_gui->setTitle($lng->txt("sty_add_image"));
1375
1376 $file_input = new ilImageFileInputGUI($lng->txt("sty_image_file"), "image_file");
1377 $file_input->setRequired(true);
1378 $this->form_gui->addItem($file_input);
1379
1380 $this->form_gui->addCommandButton("uploadImage", $lng->txt("upload"));
1381 $this->form_gui->addCommandButton("cancelUpload", $lng->txt("cancel"));
1382 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1383 }
1384
1389 {
1390 global $ilCtrl;
1391
1392 $images = $this->object->getImages();
1393
1394 foreach ($images as $image)
1395 {
1396 if (is_array($_POST["file"]) && in_array($image["entry"], $_POST["file"]))
1397 {
1398 $this->object->deleteImage($image["entry"]);
1399 }
1400 }
1401 $ilCtrl->redirect($this, "listImages");
1402 }
1403
1408 {
1409 global $ilCtrl, $tpl, $lng;
1410
1411//var_dump($_POST);
1412
1413 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1414 {
1415 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1416 $ilCtrl->redirect($this, "edit");
1417 }
1418 else
1419 {
1420 // check whether there are any core style classes included
1421 $core_styles = ilObjStyleSheet::_getCoreStyles();
1422 foreach ($_POST["char"] as $char)
1423 {
1424 if (!empty($core_styles[$char]))
1425 {
1426 $this->deleteCoreCharMessage();
1427 return;
1428 }
1429 }
1430
1431 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1432 $cgui = new ilConfirmationGUI();
1433 $cgui->setFormAction($ilCtrl->getFormAction($this));
1434 $cgui->setHeaderText($lng->txt("sty_confirm_char_deletion"));
1435 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1436 $cgui->setConfirm($lng->txt("delete"), "deleteCharacteristic");
1437
1438 foreach ($_POST["char"] as $char)
1439 {
1440 $char_comp = explode(".", $char);
1441 $cgui->addItem("char[]", $char, $char_comp[2]);
1442 }
1443
1444 $tpl->setContent($cgui->getHTML());
1445 }
1446 }
1447
1455 {
1456 global $ilCtrl, $tpl, $lng;
1457
1458 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1459 $cgui = new ilConfirmationGUI();
1460 $cgui->setFormAction($ilCtrl->getFormAction($this));
1461
1462
1463 $core_styles = ilObjStyleSheet::_getCoreStyles();
1464 $cnt = 0;
1465 foreach ($_POST["char"] as $char)
1466 {
1467 if (!empty($core_styles[$char]))
1468 {
1469 $cnt++;
1470 $char_comp = explode(".", $char);
1471 $cgui->addItem("", "", $char_comp[2]);
1472 }
1473 else
1474 {
1475 $cgui->addHiddenItem("char[]", $char);
1476 }
1477 }
1478 $all_core_styles = ($cnt == count($_POST["char"]))
1479 ? true
1480 : false;
1481
1482 if ($all_core_styles)
1483 {
1484 $cgui->setHeaderText($lng->txt("sty_all_styles_obligatory"));
1485 $cgui->setCancel($lng->txt("back"), "cancelCharacteristicDeletion");
1486 }
1487 else
1488 {
1489 $cgui->setHeaderText($lng->txt("sty_some_styles_obligatory_delete_rest"));
1490 $cgui->setCancel($lng->txt("cancel"), "cancelCharacteristicDeletion");
1491 $cgui->setConfirm($lng->txt("sty_delete_other_selected"), "deleteCharacteristicConfirmation");
1492 }
1493
1494 $tpl->setContent($cgui->getHTML());
1495 }
1496
1501 {
1502 global $ilCtrl, $lng;
1503
1504 ilUtil::sendInfo($lng->txt("action_aborted"), true);
1505 $ilCtrl->redirect($this, "edit");
1506 }
1507
1512 {
1513 global $ilCtrl;
1514
1515 if (is_array($_POST["char"]))
1516 {
1517 foreach($_POST["char"] as $char)
1518 {
1519 $char_comp = explode(".", $char);
1520 $type = $char_comp[0];
1521 $tag = $char_comp[1];
1522 $class = $char_comp[2];
1523
1524 $this->object->deleteCharacteristic($type, $tag, $class);
1525 }
1526 }
1527
1528 $ilCtrl->redirect($this, "edit");
1529 }
1530
1535 {
1536 global $tpl;
1537
1538 $this->initCharacteristicForm("create");
1539 $tpl->setContent($this->form_gui->getHTML());
1540 }
1541
1546 {
1547 global $ilCtrl, $tpl, $lng;
1548
1549 $this->initCharacteristicForm("create");
1550
1551 if ($this->form_gui->checkInput())
1552 {
1553 if ($this->object->characteristicExists($_POST["new_characteristic"], $_GET["style_type"]))
1554 {
1555 $char_input = $this->form_gui->getItemByPostVar("new_characteristic");
1556 $char_input->setAlert($lng->txt("sty_characteristic_already_exists"));
1557 }
1558 else
1559 {
1560 $this->object->addCharacteristic($_POST["type"], $_POST["new_characteristic"]);
1561 ilUtil::sendInfo($lng->txt("sty_added_characteristic"), true);
1562 $ilCtrl->setParameter($this, "tag",
1563 ilObjStyleSheet::_determineTag($_POST["type"]).".".$_POST["new_characteristic"]);
1564 $ilCtrl->setParameter($this, "style_type", $_POST["type"]);
1565 $ilCtrl->redirect($this, "editTagStyle");
1566 }
1567 }
1568 $this->form_gui->setValuesByPost();
1569 $tpl->setContent($this->form_gui->getHTML());
1570 }
1571
1577 public function initCharacteristicForm($a_mode)
1578 {
1579 global $lng, $ilCtrl;
1580
1581 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1582 $this->form_gui = new ilPropertyFormGUI();
1583
1584 // title
1585 $txt_input = new ilRegExpInputGUI($lng->txt("title"), "new_characteristic");
1586 $txt_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1587 $txt_input->setNoMatchMessage($lng->txt("sty_msg_characteristic_must_only_include")." A-Z, a-z, 1-9");
1588 $txt_input->setRequired(true);
1589 $this->form_gui->addItem($txt_input);
1590
1591 // type
1592 $all_super_types = ilObjStyleSheet::_getStyleSuperTypes();
1593 $types = $all_super_types[$this->super_type];
1594 $exp_types = array();
1595 foreach($types as $t)
1596 {
1598 {
1599 $exp_types[$t] = $lng->txt("sty_type_".$t);
1600 }
1601 }
1602 if (count($exp_types) > 1)
1603 {
1604 $type_input = new ilSelectInputGUI($lng->txt("sty_type"), "type");
1605 $type_input->setOptions($exp_types);
1606 $type_input->setValue(key($exp_types));
1607 $this->form_gui->addItem($type_input);
1608 }
1609 else if (count($exp_types) == 1)
1610 {
1611 $hid_input = new ilHiddenInputGUI("type");
1612 $hid_input->setValue(key($exp_types));
1613 $this->form_gui->addItem($hid_input);
1614 }
1615
1616 $this->form_gui->setTitle($lng->txt("sty_add_characteristic"));
1617 $this->form_gui->addCommandButton("saveCharacteristic", $lng->txt("save"));
1618 $this->form_gui->addCommandButton("edit", $lng->txt("cancel"));
1619 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1620 }
1621
1625 static function getStyleExampleHTML($a_type, $a_class)
1626 {
1627 global $lng;
1628
1629 $c = explode(":", $a_class);
1630 $a_class = $c[0];
1631
1632 $ex_tpl = new ilTemplate("tpl.style_example.html", true, true, "Services/Style");
1633
1634 if ($ex_tpl->blockExists("Example_".$a_type))
1635 {
1636 $ex_tpl->setCurrentBlock("Example_".$a_type);
1637 }
1638 else
1639 {
1640 $ex_tpl->setCurrentBlock("Example_default");
1641 }
1642 $ex_tpl->setVariable("EX_CLASS", "ilc_".$a_type."_".$a_class);
1643 $ex_tpl->setVariable("EX_TEXT", "ABC abc 123");
1644 if (in_array($a_type, array("media_cont", "qimg")))
1645 {
1646 //
1647 }
1648 if (in_array($a_type, array("table", "table_caption")))
1649 {
1650 $ex_tpl->setVariable("TXT_CAPTION", $lng->txt("sty_caption"));
1651 }
1652 if (in_array($a_class, array("OrderListItemHorizontal", "OrderListHorizontal")))
1653 {
1654 $ex_tpl->setVariable("HOR", "Horizontal");
1655 }
1656 $ex_tpl->parseCurrentBlock();
1657
1658 return $ex_tpl->get();
1659 }
1660
1665 {
1666 global $ilCtrl, $lng;
1667
1668 //var_dump($_POST);
1669
1670 foreach ($_POST["all_chars"] as $char)
1671 {
1672 $ca = explode(".", $char);
1673 $this->object->saveHideStatus($ca[0], $ca[2],
1674 (is_array($_POST["hide"]) && in_array($char, $_POST["hide"])));
1675 }
1676
1677 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
1678 $ilCtrl->redirect($this, "edit");
1679 }
1680
1688 {
1689 global $ilCtrl, $lng;
1690
1691 if (!is_array($_POST["char"]) || count($_POST["char"]) == 0)
1692 {
1693 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
1694 }
1695 else
1696 {
1697 $style_cp = implode("::", $_POST["char"]);
1698 $style_cp = $this->object->getId().":::".$_GET["style_type"].":::".$style_cp;
1699 $_SESSION["sty_copy"] = $style_cp;
1700 ilUtil::sendSuccess($lng->txt("sty_copied_please_select_target"), true);
1701 }
1702 $ilCtrl->redirect($this, "edit");
1703 }
1704
1712 {
1713 global $tpl, $ilTabs;
1714
1715 $ilTabs->clearTargets();
1716
1717 include_once("./Services/Style/classes/class.ilPasteStyleCharacteristicTableGUI.php");
1718 $table = new ilPasteStyleCharacteristicTableGUI($this, "pasteCharacteristicsOverview");
1719
1720 $tpl->setContent($table->getHTML());
1721 }
1722
1730 {
1731 global $ilCtrl, $lng;
1732
1733 if (is_array($_POST["title"]))
1734 {
1735 foreach ($_POST["title"] as $from_char => $to_title)
1736 {
1737 $fc = explode(".", $from_char);
1738
1739 if ($_POST["conflict_action"][$from_char] == "overwrite" ||
1740 !$this->object->characteristicExists($to_title, $fc[0]))
1741 {
1742 $this->object->copyCharacteristic($_POST["from_style_id"],
1743 $fc[0], $fc[2], $to_title);
1744 }
1745 }
1746 ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
1747 unset($_SESSION["sty_copy"]);
1748 ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
1749 }
1750
1751 $ilCtrl->redirect($this, "edit");
1752 }
1753
1754 //
1755 // Color management
1756 //
1757
1762 {
1763 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1764
1765 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1766 {
1767 $ilToolbar->addButton($this->lng->txt("sty_add_color"),
1768 $ilCtrl->getLinkTarget($this, "addColor"));
1769 }
1770
1771 include_once("./Services/Style/classes/class.ilStyleColorTableGUI.php");
1772 $table_gui = new ilStyleColorTableGUI($this, "listColors",
1773 $this->object);
1774 $tpl->setContent($table_gui->getHTML());
1775
1776 }
1777
1782 {
1783 global $tpl;
1784
1785 $this->initColorForm();
1786 $tpl->setContent($this->form_gui->getHTML());
1787 }
1788
1793 {
1794 global $tpl, $ilCtrl;
1795
1796 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1797 $this->initColorForm("edit");
1798 $this->getColorFormValues();
1799 $tpl->setContent($this->form_gui->getHTML());
1800 }
1801
1802
1806 function initColorForm($a_mode = "create")
1807 {
1808 global $lng, $ilCtrl;
1809
1810 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1811 $this->form_gui = new ilPropertyFormGUI();
1812
1813 $this->form_gui->setTitle($lng->txt("sty_add_color"));
1814
1815 // name
1816 $name_input = new ilRegExpInputGUI($lng->txt("sty_color_name"), "color_name");
1817 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
1818 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
1819 $name_input->setRequired(true);
1820 $name_input->setSize(15);
1821 $name_input->setMaxLength(15);
1822 $this->form_gui->addItem($name_input);
1823
1824 // code
1825 $color_input = new ilColorPickerInputGUI($lng->txt("sty_color_code"), "color_code");
1826 $color_input->setRequired(true);
1827 $color_input->setDefaultColor("");
1828 $this->form_gui->addItem($color_input);
1829
1830 if ($a_mode == "create")
1831 {
1832 $this->form_gui->addCommandButton("saveColor", $lng->txt("save"));
1833 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1834 }
1835 else
1836 {
1837 $this->form_gui->addCommandButton("updateColor", $lng->txt("save"));
1838 $this->form_gui->addCommandButton("cancelColorSaving", $lng->txt("cancel"));
1839 }
1840 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1841 }
1842
1847 {
1848 if ($_GET["c_name"] != "")
1849 {
1850 $values["color_name"] = $_GET["c_name"];
1851 $values["color_code"] = $this->object->getColorCodeForName($_GET["c_name"]);
1852 $this->form_gui->setValuesByArray($values);
1853 }
1854 }
1855
1860 {
1861 global $ilCtrl;
1862
1863 $ilCtrl->redirect($this, "listColors");
1864 }
1865
1870 {
1871 global $tpl, $ilCtrl, $lng;
1872
1873 $this->initColorForm();
1874
1875 if ($this->form_gui->checkInput())
1876 {
1877 if ($this->object->colorExists($_POST["color_name"]))
1878 {
1879 $col_input = $this->form_gui->getItemByPostVar("color_name");
1880 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1881 }
1882 else
1883 {
1884 $this->object->addColor($_POST["color_name"],
1885 $_POST["color_code"]);
1886 $ilCtrl->redirect($this, "listColors");
1887 }
1888 }
1889 $this->form_gui->setValuesByPost();
1890 $tpl->setContent($this->form_gui->getHTML());
1891 }
1892
1897 {
1898 global $tpl, $ilCtrl, $lng;
1899
1900 $this->initColorForm("edit");
1901
1902 if ($this->form_gui->checkInput())
1903 {
1904 if ($this->object->colorExists($_POST["color_name"]) &&
1905 $_POST["color_name"] != $_GET["c_name"])
1906 {
1907 $col_input = $this->form_gui->getItemByPostVar("color_name");
1908 $col_input->setAlert($lng->txt("sty_color_already_exists"));
1909 }
1910 else
1911 {
1912 $this->object->updateColor($_GET["c_name"], $_POST["color_name"],
1913 $_POST["color_code"]);
1914 $ilCtrl->redirect($this, "listColors");
1915 }
1916 }
1917 $ilCtrl->setParameter($this, "c_name", $_GET["c_name"]);
1918 $this->form_gui->setValuesByPost();
1919 $tpl->setContent($this->form_gui->getHTML());
1920 }
1921
1926 {
1927 global $ilCtrl, $tpl, $lng;
1928
1929 if (!is_array($_POST["color"]) || count($_POST["color"]) == 0)
1930 {
1931 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1932 $ilCtrl->redirect($this, "listColors");
1933 }
1934 else
1935 {
1936 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1937 $cgui = new ilConfirmationGUI();
1938 $cgui->setFormAction($ilCtrl->getFormAction($this));
1939 $cgui->setHeaderText($lng->txt("sty_confirm_color_deletion"));
1940 $cgui->setCancel($lng->txt("cancel"), "cancelColorDeletion");
1941 $cgui->setConfirm($lng->txt("delete"), "deleteColor");
1942
1943 foreach ($_POST["color"] as $c)
1944 {
1945 $cgui->addItem("color[]", ilUtil::prepareFormOutput($c), $c);
1946 }
1947
1948 $tpl->setContent($cgui->getHTML());
1949 }
1950 }
1951
1956 {
1957 global $ilCtrl;
1958
1959 $ilCtrl->redirect($this, "listColors");
1960 }
1961
1966 {
1967 global $ilCtrl;
1968
1969 if (is_array($_POST["color"]))
1970 {
1971 foreach ($_POST["color"] as $c)
1972 {
1973 $this->object->removeColor($c);
1974 }
1975 }
1976
1977 $ilCtrl->redirect($this, "listColors");
1978 }
1979
1980 //
1981 // Media query management
1982 //
1983
1988 {
1989 global $tpl, $rbacsystem, $ilToolbar, $ilCtrl;
1990
1991 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]))
1992 {
1993 $ilToolbar->addButton($this->lng->txt("sty_add_media_query"),
1994 $ilCtrl->getLinkTarget($this, "addMediaQuery"));
1995 }
1996
1997 include_once("./Services/Style/classes/class.ilStyleMediaQueryTableGUI.php");
1998 $table_gui = new ilStyleMediaQueryTableGUI($this, "listMediaQueries",
1999 $this->object);
2000 $tpl->setContent($table_gui->getHTML());
2001 }
2002
2007 {
2008 global $tpl;
2009
2010 $this->initMediaQueryForm();
2011 $tpl->setContent($this->form_gui->getHTML());
2012 }
2013
2018 {
2019 global $tpl, $ilCtrl;
2020
2021 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2022 $this->initMediaQueryForm("edit");
2023 $this->getMediaQueryFormValues();
2024 $tpl->setContent($this->form_gui->getHTML());
2025 }
2026
2027
2031 function initMediaQueryForm($a_mode = "create")
2032 {
2033 global $lng, $ilCtrl;
2034
2035 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2036 $this->form_gui = new ilPropertyFormGUI();
2037
2038 $this->form_gui->setTitle($lng->txt("sty_add_media_query"));
2039
2040 // media query
2041 $ti = new ilTextInputGUI("@media", "mquery");
2042 $ti->setMaxLength(2000);
2043 $this->form_gui->addItem($ti);
2044
2045
2046 if ($a_mode == "create")
2047 {
2048 $this->form_gui->addCommandButton("saveMediaQuery", $lng->txt("save"));
2049 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2050 }
2051 else
2052 {
2053 $this->form_gui->addCommandButton("updateMediaQuery", $lng->txt("save"));
2054 $this->form_gui->addCommandButton("listMediaQueries", $lng->txt("cancel"));
2055 }
2056 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2057 }
2058
2063 {
2064 if ($_GET["mq_id"] != "")
2065 {
2066 foreach ($this->object->getMediaQueries() as $mq)
2067 {
2068 if ($mq["id"] == (int) $_GET["mq_id"])
2069 {
2070 $values["mquery"] = $mq["mquery"];
2071 }
2072 }
2073 $this->form_gui->setValuesByArray($values);
2074 }
2075 }
2076
2081 {
2082 global $tpl, $ilCtrl, $lng;
2083
2084 $this->initMediaQueryForm();
2085
2086 if ($this->form_gui->checkInput())
2087 {
2088 $this->object->addMediaQuery($_POST["mquery"]);
2089 $ilCtrl->redirect($this, "listMediaQueries");
2090 }
2091 $this->form_gui->setValuesByPost();
2092 $tpl->setContent($this->form_gui->getHTML());
2093 }
2094
2099 {
2100 global $tpl, $ilCtrl, $lng;
2101
2102 $this->initMediaQueryForm("edit");
2103
2104 if ($this->form_gui->checkInput())
2105 {
2106 $this->object->updateMediaQuery((int) $_GET["mq_id"], $_POST["mquery"]);
2107 $ilCtrl->redirect($this, "listMediaQueries");
2108 }
2109 $ilCtrl->setParameter($this, "mq_id", $_GET["mq_id"]);
2110 $this->form_gui->setValuesByPost();
2111 $tpl->setContent($this->form_gui->getHTML());
2112 }
2113
2118 {
2119 global $ilCtrl, $tpl, $lng;
2120
2121 if (!is_array($_POST["mq_id"]) || count($_POST["mq_id"]) == 0)
2122 {
2123 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2124 $ilCtrl->redirect($this, "listMediaQueries");
2125 }
2126 else
2127 {
2128 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2129 $cgui = new ilConfirmationGUI();
2130 $cgui->setFormAction($ilCtrl->getFormAction($this));
2131 $cgui->setHeaderText($lng->txt("sty_sure_del_mqueries"));
2132 $cgui->setCancel($lng->txt("cancel"), "listMediaQueries");
2133 $cgui->setConfirm($lng->txt("delete"), "deleteMediaQueries");
2134
2135 foreach ($_POST["mq_id"] as $i)
2136 {
2137 $mq = $this->object->getMediaQueryForId($i);
2138 $cgui->addItem("mq_id[]", $i, $mq["mquery"]);
2139 }
2140
2141 $tpl->setContent($cgui->getHTML());
2142 }
2143 }
2144
2152 {
2153 global $ilCtrl, $rbacsystem;
2154
2155 if ($rbacsystem->checkAccess("write", (int) $_GET["ref_id"]) && is_array($_POST["mq_id"]))
2156 {
2157 foreach ($_POST["mq_id"] as $id)
2158 {
2159 $this->object->deleteMediaQuery($id);
2160 }
2161 }
2162 $ilCtrl->redirect($this, "listMediaQueries");
2163 }
2164
2172 {
2173 global $ilCtrl;
2174
2175 if (is_array($_POST["order"]))
2176 {
2177 $this->object->saveMediaQueryOrder($_POST["order"]);
2178 }
2179 $ilCtrl->redirect($this, "listMediaQueries");
2180 }
2181
2182
2183 //
2184 // Templates management
2185 //
2186
2191 {
2192 global $tpl, $ilTabs, $ilCtrl;
2193
2194 $ctype = $_GET["temp_type"];
2195 if ($ctype == "")
2196 {
2197 $ctype = "table";
2198 $ilCtrl->setParameter($this, "temp_type", $ctype);
2199 $_GET["temp_type"] = $ctype;
2200 }
2201
2202 $this->setTemplatesSubTabs();
2203 $ilTabs->setSubTabActive("sty_".$ctype."_templates");
2204
2205 $this->includeCSS();
2206 include_once("./Services/Style/classes/class.ilTableTemplatesTableGUI.php");
2207 $table_gui = new ilTableTemplatesTableGUI($ctype, $this, "listTemplates",
2208 $this->object);
2209 $tpl->setContent($table_gui->getHTML());
2210
2211 }
2212
2217 {
2218 global $tpl;
2219
2220 $this->initTemplateForm();
2221 $tpl->setContent($this->form_gui->getHTML());
2222 }
2223
2228 {
2229 global $tpl, $ilCtrl;
2230
2231 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2232 $this->initTemplateForm("edit");
2233 $this->getTemplateFormValues();
2234
2235 $this->displayTemplateEditForm();
2236 }
2237
2241 function getTemplatePreview($a_type, $a_t_id, $a_small_mode = false)
2242 {
2243 return $this->_getTemplatePreview(
2244 $this->object, $a_type, $a_t_id, $a_small_mode);
2245 }
2246
2250 function _getTemplatePreview($a_style, $a_type, $a_t_id, $a_small_mode = false)
2251 {
2252 global $lng, $tpl;
2253
2254 $kr = $kc = 7;
2255 if ($a_small_mode)
2256 {
2257 $kr = 6;
2258 $kc = 5;
2259 }
2260
2261 $ts = $a_style->getTemplate($a_t_id);
2262 $t = $ts["classes"];
2263
2264 // preview
2265 if ($a_type == "table")
2266 {
2267 $p_content = '<PageContent><Table DataTable="y"';
2268 if ($t["row_head"] != "")
2269 {
2270 $p_content.= ' HeaderRows="1"';
2271 }
2272 if ($t["row_foot"] != "")
2273 {
2274 $p_content.= ' FooterRows="1"';
2275 }
2276 if ($t["col_head"] != "")
2277 {
2278 $p_content.= ' HeaderCols="1"';
2279 }
2280 if ($t["col_foot"] != "")
2281 {
2282 $p_content.= ' FooterCols="1"';
2283 }
2284 $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
2285 if (!$a_small_mode)
2286 {
2287 $p_content.= '<Caption>'.$lng->txt("sty_caption").'</Caption>';
2288 }
2289 for($i = 1; $i<=$kr; $i++)
2290 {
2291 $p_content.= '<TableRow>';
2292 for($j = 1; $j<=$kc; $j++)
2293 {
2294 if ($a_small_mode)
2295 {
2296 $cell = '&lt;div style="height:2px;"&gt;&lt;/div&gt;';
2297 }
2298 else
2299 {
2300 $cell = 'xxx';
2301 }
2302 $p_content.= '<TableData><PageContent><Paragraph Characteristic="TableContent">'.$cell.'</Paragraph></PageContent></TableData>';
2303 }
2304 $p_content.= '</TableRow>';
2305 }
2306 $p_content.= '</Table></PageContent>';
2307 }
2308
2309 if ($a_type == "vaccordion" || $a_type == "haccordion" || $a_type == "carousel")
2310 {
2311 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2313
2314 if ($a_small_mode)
2315 {
2316 $c = '&amp;nbsp;';
2317 $h = '&amp;nbsp;';
2318 }
2319 else
2320 {
2321 $c = 'xxx';
2322 $h = 'head';
2323 }
2324 if ($a_type == "vaccordion")
2325 {
2326 $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="VerticalAccordion" ';
2327 if ($a_small_mode)
2328 {
2329 $p_content.= ' ContentWidth="70"';
2330 }
2331 }
2332 else if ($a_type == "haccordion")
2333 {
2334 $p_content = '<PageContent><Tabs Type="HorizontalAccordion"';
2335 if ($a_small_mode)
2336 {
2337 $p_content.= ' ContentHeight="40"';
2338 $p_content.= ' ContentWidth="70"';
2339 $c = '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
2340 }
2341 else
2342 {
2343 $p_content.= ' ContentHeight="40"';
2344 }
2345 }
2346 else if ($a_type == "carousel")
2347 {
2348 $p_content = '<PageContent><Tabs HorizontalAlign="Left" Type="Carousel" ';
2349 if ($a_small_mode)
2350 {
2351 $p_content.= ' ContentWidth="70"';
2352 }
2353 }
2354
2355
2356 $p_content.= ' Template="'.$a_style->lookupTemplateName($a_t_id).'">';
2357 $p_content.= '<Tab><PageContent><Paragraph>'.$c.'</Paragraph></PageContent>';
2358 $p_content.= '<TabCaption>'.$h.'</TabCaption>';
2359 $p_content.= '</Tab>';
2360 $p_content.= '</Tabs></PageContent>';
2361 }
2362//echo htmlentities($p_content);
2363 $txml = $a_style->getTemplateXML();
2364//echo htmlentities($txml); exit;
2365 $p_content.= $txml;
2366 include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
2367 $r_content = ilPCTableGUI::_renderTable($p_content, "");
2368
2369 // fix carousel template visibility
2370 if($a_type == "carousel")
2371 {
2372 $r_content.= "<style>.owl-carousel{ display:block !important; }</style>";
2373 }
2374
2375//echo htmlentities($r_content); exit;
2376 return $r_content;
2377 }
2378
2382 function initTemplateForm($a_mode = "create")
2383 {
2384 global $lng, $ilCtrl;
2385
2386 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2387 $this->form_gui = new ilPropertyFormGUI();
2388
2389 if ($a_mode == "create")
2390 {
2391 $this->form_gui->setTitle($lng->txt("sty_add_template"));
2392 }
2393 else
2394 {
2395 $this->form_gui->setTitle($lng->txt("sty_edit_template"));
2396 }
2397
2398 // name
2399 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2400 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2401 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2402 $name_input->setRequired(true);
2403 $name_input->setSize(30);
2404 $name_input->setMaxLength(30);
2405 $this->form_gui->addItem($name_input);
2406
2407 // template style classes
2409 foreach ($scs as $sc => $st)
2410 {
2411 $sc_input = new ilSelectInputGUI($lng->txt("sty_".$sc."_class"), $sc."_class");
2412 $chars = $this->object->getCharacteristics($st);
2413 $options = array("" => "");
2414 foreach($chars as $char)
2415 {
2416 $options[$char] = $char;
2417 }
2418 $sc_input->setOptions($options);
2419 $this->form_gui->addItem($sc_input);
2420 }
2421
2422 if ($a_mode == "create")
2423 {
2424 $this->form_gui->addCommandButton("saveTemplate", $lng->txt("save"));
2425 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2426 }
2427 else
2428 {
2429 $this->form_gui->addCommandButton("refreshTemplate", $lng->txt("save_refresh"));
2430 $this->form_gui->addCommandButton("updateTemplate", $lng->txt("save_return"));
2431 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2432 }
2433 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2434 }
2435
2440 {
2441 global $ilCtrl;
2442
2443 $ilCtrl->redirect($this, "listTemplates");
2444 }
2445
2446
2451 {
2452 global $tpl, $ilCtrl, $lng;
2453
2454 $this->initTemplateForm();
2455
2456 if ($this->form_gui->checkInput())
2457 {
2458 if ($this->object->templateExists($_POST["name"]))
2459 {
2460 $name_input = $this->form_gui->getItemByPostVar("name");
2461 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2462 }
2463 else
2464 {
2465 $classes = array();
2466 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2467 {
2468 $classes[$tct] = $_POST[$tct."_class"];
2469 }
2470 $t_id = $this->object->addTemplate($_GET["temp_type"], $_POST["name"], $classes);
2471 $this->object->writeTemplatePreview($t_id,
2472 $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2473 $ilCtrl->redirect($this, "listTemplates");
2474 }
2475 }
2476 $this->form_gui->setValuesByPost();
2477 $tpl->setContent($this->form_gui->getHTML());
2478 }
2479
2483 function updateTemplateObject($a_refresh = false)
2484 {
2485 global $tpl, $ilCtrl, $lng;
2486
2487 $ilCtrl->setParameter($this, "t_id", $_GET["t_id"]);
2488 $this->initTemplateForm("edit");
2489
2490 if ($this->form_gui->checkInput())
2491 {
2492 if ($this->object->templateExists($_POST["name"]) &&
2494 {
2495 $name_input = $this->form_gui->getItemByPostVar("name");
2496 $name_input->setAlert($lng->txt("sty_template_already_exists"));
2497 }
2498 else
2499 {
2500 $classes = array();
2501 foreach (ilObjStyleSheet::_getTemplateClassTypes($_GET["temp_type"]) as $tct => $ct)
2502 {
2503 $classes[$tct] = $_POST[$tct."_class"];
2504 }
2505
2506 $this->object->updateTemplate($_GET["t_id"],
2507 $_POST["name"], $classes);
2508 $this->object->writeTemplatePreview($_GET["t_id"],
2509 $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"], true));
2510 if(!$a_refresh)
2511 {
2512 $ilCtrl->redirect($this, "listTemplates");
2513 }
2514 }
2515 }
2516
2517 $this->form_gui->setValuesByPost();
2518 $this->displayTemplateEditForm();
2519 }
2520
2525 {
2526 global $tpl;
2527
2528 $a_tpl = new ilTemplate("tpl.template_edit.html", true, true,
2529 "Services/Style");
2530 $this->includeCSS();
2531 $a_tpl->setVariable("FORM", $this->form_gui->getHTML());
2532 $a_tpl->setVariable("PREVIEW", $this->getTemplatePreview($_GET["temp_type"], $_GET["t_id"]));
2533 $tpl->setContent($a_tpl->get());
2534 }
2535
2540 {
2541 $this->updateTemplateObject(true);
2542 }
2543
2548 {
2549 if ($_GET["t_id"] > 0)
2550 {
2551 $t = $this->object->getTemplate($_GET["t_id"]);
2552
2553 $values["name"] = $t["name"];
2555 foreach ($scs as $k => $type)
2556 {
2557 $values[$k."_class"] = $t["classes"][$k];
2558 }
2559 $this->form_gui->setValuesByArray($values);
2560 }
2561 }
2562
2567 {
2568 global $ilCtrl, $tpl, $lng;
2569
2570 if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
2571 {
2572 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
2573 $ilCtrl->redirect($this, "listTemplates");
2574 }
2575 else
2576 {
2577 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2578 $cgui = new ilConfirmationGUI();
2579 $cgui->setFormAction($ilCtrl->getFormAction($this));
2580 $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
2581 $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
2582 $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
2583
2584 foreach ($_POST["tid"] as $tid)
2585 {
2586 $classes = $this->object->getTemplateClasses($tid);
2587 $cl_str = "";
2588 $listed = array();
2589 foreach ($classes as $cl)
2590 {
2591 if ($cl != "" && !$listed[$cl])
2592 {
2593 $cl_str.= '<div>- '.
2594 $cl."</div>";
2595 $listed[$cl] = true;
2596 }
2597 }
2598 if ($cl_str != "")
2599 {
2600 $cl_str = '<div style="padding-left:30px;" class="small">'.
2601 "<div><i>".$lng->txt("sty_style_class")."</i></div>".$cl_str."</div>";
2602 }
2603 $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid).$cl_str);
2604 }
2605
2606 $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
2607
2608 $tpl->setContent($cgui->getHTML());
2609 }
2610 }
2611
2616 {
2617 global $ilCtrl;
2618
2619 $ilCtrl->redirect($this, "listTemplates");
2620 }
2621
2626 {
2627 global $ilCtrl;
2628
2629 if (is_array($_POST["tid"]))
2630 {
2631 foreach ($_POST["tid"] as $tid)
2632 {
2633 $this->object->removeTemplate($tid);
2634 }
2635 }
2636
2637 $ilCtrl->redirect($this, "listTemplates");
2638 }
2639
2644 {
2645 global $ilCtrl;
2646
2647 if (is_array($_POST["tid"]))
2648 {
2649 foreach ($_POST["tid"] as $tid)
2650 {
2651 $cls = $this->object->getTemplateClasses($tid);
2652 foreach ($cls as $k => $cls)
2653 {
2654 $ty = $this->object->determineTemplateStyleClassType($_GET["temp_type"], $k);
2656 $this->object->deleteCharacteristic($ty, $ta, $cls);
2657 }
2658 $this->object->removeTemplate($tid);
2659 }
2660 }
2661
2662 $ilCtrl->redirect($this, "listTemplates");
2663 }
2664
2669 {
2670 global $tpl;
2671
2673 $tpl->setContent($this->form_gui->getHTML());
2674 }
2675
2680 {
2681 global $lng, $ilCtrl;
2682
2683 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2684 $this->form_gui = new ilPropertyFormGUI();
2685
2686 $this->form_gui->setTitle($lng->txt("sty_generate_template"));
2687
2688 // name
2689 $name_input = new ilRegExpInputGUI($lng->txt("sty_template_name"), "name");
2690 $name_input->setPattern("/^[a-zA-Z]+[a-zA-Z0-9]*$/");
2691 $name_input->setNoMatchMessage($lng->txt("sty_msg_color_must_only_include")." A-Z, a-z, 1-9");
2692 $name_input->setRequired(true);
2693 $name_input->setSize(30);
2694 $name_input->setMaxLength(30);
2695 $this->form_gui->addItem($name_input);
2696
2697 // basic layout
2698 $bl_input = new ilSelectInputGUI($lng->txt("sty_template_layout"), "layout");
2699 $options = array(
2700 "coloredZebra" => $lng->txt("sty_table_template_colored_zebra"),
2701 "bwZebra" => $lng->txt("sty_table_template_bw_zebra"),
2702 "noZebra" => $lng->txt("sty_table_template_no_zebra")
2703 );
2704 $bl_input->setOptions($options);
2705 $this->form_gui->addItem($bl_input);
2706
2707 // top bottom padding
2708 include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
2709 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_top_bottom_padding"), "tb_padding");
2710 $num_input->setAllowPercentage(false);
2711 $num_input->setValue("3px");
2712 $this->form_gui->addItem($num_input);
2713
2714 // left right padding
2715 $num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_left_right_padding"), "lr_padding");
2716 $num_input->setAllowPercentage(false);
2717 $num_input->setValue("10px");
2718 $this->form_gui->addItem($num_input);
2719
2720 // base color
2721 $bc_input = new ilSelectInputGUI($lng->txt("sty_base_color"), "base_color");
2722 $cs = $this->object->getColors();
2723 $options = array();
2724 foreach ($cs as $c)
2725 {
2726 $options[$c["name"]] = $c["name"];
2727 }
2728 $bc_input->setOptions($options);
2729 $this->form_gui->addItem($bc_input);
2730
2731 // Lightness Settings
2732 $lss = array("border" => 90, "header_text" => 70, "header_bg" => 0,
2733 "cell1_text" => -60, "cell1_bg" => 90, "cell2_text" => -60, "cell2_bg" => 75);
2734 foreach ($lss as $ls => $v)
2735 {
2736 $l_input = new ilNumberInputGUI($lng->txt("sty_lightness_".$ls), "lightness_".$ls);
2737 $l_input->setMaxValue(100);
2738 $l_input->setMinValue(-100);
2739 $l_input->setValue($v);
2740 $l_input->setSize(4);
2741 $l_input->setMaxLength(4);
2742 $this->form_gui->addItem($l_input);
2743 }
2744
2745 $this->form_gui->addCommandButton("templateGeneration", $lng->txt("generate"));
2746 $this->form_gui->addCommandButton("cancelTemplateSaving", $lng->txt("cancel"));
2747 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
2748 }
2749
2754 {
2755 global $tpl, $ilCtrl, $lng;
2756
2758
2759 if ($this->form_gui->checkInput())
2760 {
2761 if ($this->object->templateExists($_POST["name"]))
2762 {
2763 $name_input = $this->form_gui->getItemByPostVar("name");
2764 $name_input->setAlert($lng->txt("sty_table_template_already_exists"));
2765 }
2766 else
2767 {
2768 // -> move to application class!
2769
2770 // cell classes
2771 $cells = array("H" => "header", "C1" => "cell1", "C2" => "cell2");
2772 $tb_p = $this->form_gui->getItemByPostVar("tb_padding");
2773 $tb_padding = $tb_p->getValue();
2774 $lr_p = $this->form_gui->getItemByPostVar("lr_padding");
2775 $lr_padding = $lr_p->getValue();
2776 $cell_color = $_POST["base_color"];
2777
2778 // use mid gray as cell color for bw zebra
2779 if ($_POST["layout"] == "bwZebra")
2780 {
2781 $cell_color = "MidGray";
2782 if (!$this->object->colorExists($cell_color))
2783 {
2784 $this->object->addColor($cell_color, "7F7F7F");
2785 }
2786 $this->object->updateColor($cell_color, $cell_color, "7F7F7F");
2787 }
2788
2789 foreach ($cells as $k => $cell)
2790 {
2791 $cell_class[$k] = $_POST["name"].$k;
2792 if (!$this->object->characteristicExists($cell_class[$k], "table_cell"))
2793 {
2794 $this->object->addCharacteristic("table_cell", $cell_class[$k], true);
2795 }
2796 if ($_POST["layout"] == "bwZebra" && $k == "H")
2797 {
2798 $this->object->replaceStylePar("td", $cell_class[$k], "color",
2799 "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2800 $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2801 "!".$_POST["base_color"]."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2802 }
2803 else
2804 {
2805 $this->object->replaceStylePar("td", $cell_class[$k], "color",
2806 "!".$cell_color."(".$_POST["lightness_".$cell."_text"].")", "table_cell");
2807 $this->object->replaceStylePar("td", $cell_class[$k], "background-color",
2808 "!".$cell_color."(".$_POST["lightness_".$cell."_bg"].")", "table_cell");
2809 }
2810 $this->object->replaceStylePar("td", $cell_class[$k], "padding-top",
2811 $tb_padding, "table_cell");
2812 $this->object->replaceStylePar("td", $cell_class[$k], "padding-bottom",
2813 $tb_padding, "table_cell");
2814 $this->object->replaceStylePar("td", $cell_class[$k], "padding-left",
2815 $lr_padding, "table_cell");
2816 $this->object->replaceStylePar("td", $cell_class[$k], "padding-right",
2817 $lr_padding, "table_cell");
2818 $this->object->replaceStylePar("td", $cell_class[$k], "border-width",
2819 "1px", "table_cell");
2820 $this->object->replaceStylePar("td", $cell_class[$k], "border-style",
2821 "solid", "table_cell");
2822 $this->object->replaceStylePar("td", $cell_class[$k], "border-color",
2823 "!".$cell_color."(".$_POST["lightness_border"].")", "table_cell");
2824 $this->object->replaceStylePar("td", $cell_class[$k], "font-weight",
2825 "normal", "table_cell");
2826 }
2827
2828 // table class
2829 $classes["table"] = $_POST["name"]."T";
2830 if (!$this->object->characteristicExists($classes["table"], "table"))
2831 {
2832 $this->object->addCharacteristic("table", $classes["table"], true);
2833 }
2834 $this->object->replaceStylePar("table", $classes["table"], "caption-side",
2835 "bottom", "table");
2836 $this->object->replaceStylePar("table", $classes["table"], "border-collapse",
2837 "collapse", "table");
2838 $this->object->replaceStylePar("table", $classes["table"], "margin-top",
2839 "5px", "table");
2840 $this->object->replaceStylePar("table", $classes["table"], "margin-bottom",
2841 "5px", "table");
2842 if ($_POST["layout"] == "bwZebra")
2843 {
2844 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-color",
2845 "!".$_POST["base_color"], "table");
2846 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-style",
2847 "solid", "table");
2848 $this->object->replaceStylePar("table", $classes["table"], "border-bottom-width",
2849 "3px", "table");
2850 $sb = array("left", "right", "top");
2851 foreach ($sb as $b)
2852 {
2853 $this->object->replaceStylePar("table", $classes["table"], "border-".$b."-width",
2854 "0px", "table");
2855 }
2856 }
2857
2858 switch ($_POST["layout"])
2859 {
2860 case "coloredZebra":
2861 $classes["row_head"] = $cell_class["H"];
2862 $classes["odd_row"] = $cell_class["C1"];
2863 $classes["even_row"] = $cell_class["C2"];
2864 break;
2865
2866 case "bwZebra":
2867 $classes["row_head"] = $cell_class["H"];
2868 $classes["odd_row"] = $cell_class["C1"];
2869 $classes["even_row"] = $cell_class["C2"];
2870 break;
2871
2872 case "noZebra":
2873 $classes["row_head"] = $cell_class["H"];
2874 $classes["odd_row"] = $cell_class["C1"];
2875 $classes["even_row"] = $cell_class["C1"];
2876 $classes["col_head"] = $cell_class["C2"];
2877 break;
2878 }
2879
2880
2881 $t_id = $this->object->addTemplate($_GET["temp_type"],
2882 $_POST["name"], $classes);
2883 $this->object->writeTemplatePreview($t_id,
2884 $this->getTemplatePreview($_GET["temp_type"], $t_id, true));
2885 $ilCtrl->redirect($this, "listTemplates");
2886 }
2887 }
2888 $this->form_gui->setValuesByPost();
2889 $tpl->setContent($this->form_gui->getHTML());
2890 }
2891
2893 {
2894 global $tpl;
2895
2896 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2897
2898 $acc = new ilAccordionGUI();
2899 $acc->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2900 $acc->addItem("Header 2", str_repeat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xx x xx", 30));
2901 $acc->setOrientation(ilAccordionGUI::HORIZONTAL);
2902
2903 $ac2 = new ilAccordionGUI();
2904 $ac2->addItem("Header 1", str_repeat("bla bla bla bla bla bla", 30));
2905 $ac2->addItem("Header 2", $acc->getHTML());
2906 $ac2->setOrientation(ilAccordionGUI::VERTICAL);
2907
2908 $tpl->setContent($ac2->getHTML());
2909 }
2910
2915 {
2916 global $ilCtrl;
2917
2918 if ($_GET["baseClass"] == "ilAdministrationGUI")
2919 {
2920 $ilCtrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
2921 }
2922 $ilCtrl->returnToParent($this);
2923 }
2924
2925
2926}
2927?>
$_GET["client_id"]
$_SESSION["AccountId"]
Accordion user interface class.
static addCss()
Add required css.
This class represents a background image property in a property form.
This class represents a background position in a property form.
This class represents a checkbox property in a property form.
Color picker form for selecting color hexcodes using yui library.
Confirmation screen class.
This class represents a file property in a property form.
This class represents a fint size property in a property form.
This class represents a section header in a property form.
const ID_PART_SCREEN
This class represents a hidden form property in a property form.
This class represents an image file property in a property form.
Import class.
This class represents a number property in a property form.
This class represents a numeric style property in a property form.
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
cancelObject()
update style sheet
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
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.
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.
afterImport($a_new_obj)
After import.
switchMQueryObject()
Switch media query.
addMediaQueryObject()
Add a media query.
updateObject()
Update properties.
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.
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
editMediaQueryObject()
Edit media query.
editTagStyleObject()
Edit tag style.
confirmedDeleteObject()
delete selected style objects
initPropertiesForm($a_mode="edit")
FORM: Init properties form.
listColorsObject()
List colors of style.
setTemplatesSubTabs()
adds tabs to tab gui object
saveTemplateObject()
Save table template.
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.
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)
& executeCommand()
execute command
setSubTabs()
adds tabs to tab gui object
saveMediaQueryObject()
Save media query.
listTemplatesObject()
List templates.
cancelTemplateSavingObject()
Cancel color saving.
deleteCharacteristicObject()
Delete one or multiple style characteristic.
Class ilObjStyleSheet.
static _getStyleParameterInputType($par)
static _getTemplateClassTypes($a_template_type="")
Get template class types.
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 _getCoreStyles()
Get core styles.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
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.
This class represents a property form user interface.
This class represents a regular expression input property in a property form.
This class represents a selection list property in a property form.
TableGUI class for style editor (image list)
TableGUI class for style editor (image list)
TableGUI class for style editor (image list)
TableGUI class for style editor.
This class represents a border style with all/top/right/bottom/left in a property form.
This class represents a border width with all/top/right/bottom/left in a property form.
Color picker form for selecting color hexcodes using yui library (all/top/right/bottom/left)
This class represents a numeric style property with all/top/right/bottom/left in a property form.
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
$_POST['username']
Definition: cron.php:12
$h
$style
Definition: example_012.php:70
$r
Definition: example_031.php:79
$info
Definition: example_052.php:80
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)
$cmd
Definition: sahs_server.php:35
if(!is_array($argv)) $options