ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilPCParagraphGUI.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/COPage/classes/class.ilPCParagraph.php");
5require_once("./Services/COPage/classes/class.ilPageContentGUI.php");
6
18{
23 function ilPCParagraphGUI($a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = "")
24 {
25 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
26
27 // characteristics (should be flexible in the future)
29 }
30
35 {
36 global $lng;
37
38 return array("Standard" => $lng->txt("cont_standard"),
39 "Headline1" => $lng->txt("cont_Headline1"),
40 "Headline2" => $lng->txt("cont_Headline2"),
41 "Headline3" => $lng->txt("cont_Headline3"),
42 "Citation" => $lng->txt("cont_Citation"),
43 "Mnemonic" => $lng->txt("cont_Mnemonic"),
44 "Example" => $lng->txt("cont_Example"),
45 "Additional" => $lng->txt("cont_Additional"),
46 "Remark" => $lng->txt("cont_Remark"),
47 "List" => $lng->txt("cont_List"),
48 "TableContent" => $lng->txt("cont_TableContent")
49 );
50 }
51
55 static function _getCharacteristics($a_style_id)
56 {
59
60 if ($a_style_id > 0 &&
61 ilObject::_lookupType($a_style_id) == "sty")
62 {
63 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
64 $style = new ilObjStyleSheet($a_style_id);
65 $types = array("text_block", "heading1", "heading2", "heading3");
66 $chars = array();
67 foreach ($types as $t)
68 {
69 $chars = array_merge($chars, $style->getCharacteristics($t));
70 }
71 $new_chars = array();
72 foreach ($chars as $char)
73 {
74 if ($st_chars[$char] != "") // keep lang vars for standard chars
75 {
76 $new_chars[$char] = $st_chars[$char];
77 }
78 else
79 {
80 $new_chars[$char] = $char;
81 }
82 asort($new_chars);
83 }
84 $chars = $new_chars;
85 }
86
87 return $chars;
88 }
89
93 function &executeCommand()
94 {
95 // get next class that processes or forwards current command
96 $next_class = $this->ctrl->getNextClass($this);
97
99 array("text_block", "heading1", "heading2", "heading3")); // scorm-2004
100
101 // get current command
102 $cmd = $this->ctrl->getCmd();
103
104 switch($next_class)
105 {
106 default:
107 $ret =& $this->$cmd();
108 break;
109 }
110
111 return $ret;
112 }
113
117 function edit($a_insert = false)
118 {
119 global $ilUser, $ilias;
120
121 // add paragraph edit template
122 $tpl = new ilTemplate("tpl.paragraph_edit.html", true, true, "Services/COPage");
123
124 // help text
125 $this->insertHelp($tpl);
126
127 // operations
128 if ($a_insert)
129 {
130 $tpl->setCurrentBlock("commands");
131 $tpl->setVariable("BTN_NAME", "create_par");
132 $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
133 $tpl->setVariable("BTN_CANCEL", "cancelCreate");
134 $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
135 $tpl->parseCurrentBlock();
136 $tpl->setCurrentBlock("commands2");
137 $tpl->setVariable("BTN_NAME", "create_par");
138 $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
139 $tpl->setVariable("BTN_CANCEL", "cancelCreate");
140 $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
141 $tpl->parseCurrentBlock();
142 $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_par"));
143 }
144 else
145 {
146 $tpl->setCurrentBlock("commands");
147 $tpl->setVariable("BTN_NAME", "update");
148 $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
149 $tpl->setVariable("BTN_CANCEL", "cancelUpdate");
150 $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
151 $tpl->parseCurrentBlock();
152 $tpl->setCurrentBlock("commands2");
153 $tpl->setVariable("BTN_NAME", "update");
154 $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
155 $tpl->setVariable("BTN_CANCEL", "cancelUpdate");
156 $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
157 $tpl->parseCurrentBlock();
158 $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_par"));
159 }
160
161 // language and characteristic selection
162 $s_char = $this->determineCharacteristic($a_insert);
163 if (!$a_insert)
164 {
165 if (key($_POST["cmd"]) == "update")
166 {
167 $s_lang = $_POST["par_language"];
168 }
169 else
170 {
171 $s_lang = $this->content_obj->getLanguage();
172 }
173 }
174 else
175 {
176 if (key($_POST["cmd"]) == "create_par")
177 {
178 $s_lang = $_POST["par_language"];
179 }
180 else
181 {
182 if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
183 {
184 $s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
185 }
186 else
187 {
188 $s_lang = $ilUser->getLanguage();
189 }
190 }
191 }
192
193 $this->insertStyleSelectionList($tpl, $s_char);
194// $this->insertCharacteristicTable($tpl, $s_char);
195
196
197 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
198
199 $tpl->setVariable("PAR_TA_NAME", "par_content");
200 $tpl->setVariable("BB_MENU", $this->getBBMenu());
201 $this->tpl->addJavascript("./Services/COPage/phpBB/3_0_5/editor.js");
202 $this->tpl->addJavascript("./Services/COPage/js/paragraph_editing.js");
203 $this->setStyle();
204
205 $this->displayValidationError();
206
207 $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
208 $tpl->setVariable("TXT_ANCHOR", $this->lng->txt("cont_anchor"));
209
210 require_once("Services/MetaData/classes/class.ilMDLanguageItem.php");
212 $select_lang = ilUtil::formSelect ($s_lang,"par_language",$lang,false,true);
213 $tpl->setVariable("SELECT_LANGUAGE", $select_lang);
214
215 $tpl->setVariable("TXT_CHARACTERISTIC", $this->lng->txt("cont_characteristic"));
216// $select_char = ilUtil::formSelect ($s_char,
217// "par_characteristic",$this->chars,false,true);
218// $tpl->setVariable("SELECT_CHARACTERISTIC", $select_char);
219
220 if (key($_POST["cmd"]) == "update" || key($_POST["cmd"]) == "create_par")
221 {
222 $s_text = ilUtil::stripSlashes($_POST["par_content"], false);
223 // prevent curly brackets from being swallowed up by template engine
224 $s_text = str_replace("{", "&#123;", $s_text);
225 $s_text = str_replace("}", "&#125;", $s_text);
226 }
227 else if (!$a_insert)
228 {
229 $s_text = $this->content_obj->xml2output($this->content_obj->getText());
230 }
231
232 $tpl->setVariable("PAR_TA_CONTENT", $s_text);
233
234 $tpl->parseCurrentBlock();
235
236 $this->tpl->setContent($tpl->get());
237 return $tpl->get();
238 }
239
246 function determineCharacteristic($a_insert = false)
247 {
248 // language and characteristic selection
249 if (!$a_insert)
250 {
251 if (key($_POST["cmd"]) == "update")
252 {
253 $s_char = $_POST["par_characteristic"];
254 }
255 else
256 {
257 $s_char = $this->content_obj->getCharacteristic();
258 if ($s_char == "")
259 {
260 $s_char = "Standard";
261 }
262 }
263 }
264 else
265 {
266 if (key($_POST["cmd"]) == "create_par")
267 {
268 $s_char = $_POST["par_characteristic"];
269 }
270 else
271 {
272 $s_char = "Standard";
273
274 // set characteristic of new paragraphs in list items to "List"
275 $cont_obj = $this->pg_obj->getContentObject($this->getHierId());
276 if (is_object($cont_obj))
277 {
278 if ($cont_obj->getType() == "li" ||
279 ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "List"))
280 {
281 $s_char = "List";
282 }
283
284 if ($cont_obj->getType() == "td" ||
285 ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "TableContent"))
286 {
287 $s_char = "TableContent";
288 }
289
290 }
291 }
292 }
293 return $s_char;
294 }
295
299 function editJS()
300 {
301 global $ilUser, $ilias;
302
303 $s_text = $this->content_obj->getText();
304//echo "\n<br><br>".htmlentities($s_text);
305 $s_text = $this->content_obj->xml2output($s_text, true, false);
306//echo "\n<br><br>".htmlentities($s_text);
307 $char = $this->determineCharacteristic(false);
308 $s_text = ilPCParagraphGUI::xml2outputJS($s_text, $char, $this->content_obj->readPCId());
309//echo "\n<br><br>".htmlentities($s_text);
310 $ids = "###".$this->content_obj->readHierId().":".$this->content_obj->readPCId()."###".
311 $char."###";
312 echo $ids.$s_text;
313 exit;
314 }
315
319 function editMultipleJS()
320 {
321 global $ilUser, $ilias;
322
323 echo $this->content_obj->getParagraphSequenceContent($this->pg_obj);
324 exit;
325 }
326
330 static function xml2outputJS($s_text, $char, $a_pc_id)
331 {
332// $s_text = "<div class='ilc_text_block_".$char."' id='$a_pc_id'>".$s_text."</div>";
333 $s_text = $s_text;
334 // lists
335 $s_text = str_replace(array("<SimpleBulletList>", "</SimpleBulletList>"),
336 array("<ul class='ilc_list_u_BulletedList'>", "</ul>"),
337 $s_text);
338 $s_text = str_replace(array("<SimpleNumberedList>", "</SimpleNumberedList>"),
339 array("<ol class='ilc_list_o_NumberedList'>", "</ol>"), $s_text);
340 $s_text = str_replace(array("<SimpleListItem>", "</SimpleListItem>"),
341 array("<li class='ilc_list_item_StandardListItem'>", "</li>"), $s_text);
342 $s_text = str_replace(array("<SimpleListItem/>"),
343 array("<li class='ilc_list_item_StandardListItem'></li>"), $s_text);
344 //$s_text = str_replace("<SimpleBulletList><br />", "<SimpleBulletList>", $s_text);
345 //$s_text = str_replace("<SimpleNumberedList><br />", "<SimpleNumberedList>", $s_text);
346 //$s_text = str_replace("</SimpleListItem><br />", "</SimpleListItem>", $s_text);
347
348
349 // spans
350 include_once("./Services/COPage/classes/class.ilPageContentGUI.php");
351 foreach (ilPageContentGUI::_getCommonBBButtons() as $bb => $cl)
352 {
353 if (!in_array($bb, array("code", "tex", "fn", "xln")))
354 {
355 $s_text = str_replace("[".$bb."]",
356 '<span class="ilc_text_inline_'.$cl.'">', $s_text);
357 $s_text = str_replace("[/".$bb."]",
358 '</span>', $s_text);
359 }
360 }
361
362 // code
363 $s_text = str_replace(array("[code]", "[/code]"),
364 array("<code>", "</code>"), $s_text);
365
366 return $s_text;
367 }
368
369
376 function saveJS()
377 {
378 global $ilCtrl;
379
380 $this->updated = $this->content_obj->saveJS($this->pg_obj,
381 $_POST["ajaxform_content"],
382 ilUtil::stripSlashes($_POST["ajaxform_char"]),
383 ilUtil::stripSlashes($_POST["pc_id_str"]));
384 if ($_POST["quick_save"])
385 {
386 if ($this->updated === true)
387 {
388 $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
389 echo $a_pc_id_str;
390 exit;
391 }
392 }
393
394 if ($this->updated !== true && is_array($this->updated))
395 {
396 $this->outputError($this->updated);
397 }
398
399 $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
400
401 $ilCtrl->setParameterByClass($ilCtrl->getReturnClass($this), "updated_pc_id_str",
402 urlencode($a_pc_id_str));
403 $ilCtrl->redirectByClass($ilCtrl->getReturnClass($this), "edit", "", true);
404 }
405
411 function outputError($a_err)
412 {
413 foreach ($a_err as $err)
414 {
415 echo $err[1]."<br />";
416 }
417 exit;
418 }
419
420
424 function cancel()
425 {
426 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
427 }
428
432 function insertCharacteristicTable($a_tpl, $a_seleted_value)
433 {
434 $i = 0;
435
436 $chars = $this->getCharacteristics();
437
438 if ($chars[$a_seleted_value] == "" && ($a_seleted_value != ""))
439 {
440 $chars = array_merge(array($a_seleted_value => $a_seleted_value),
441 $chars);
442 }
443
444 foreach ($chars as $char => $char_lang)
445 {
446 $a_tpl->setCurrentBlock("characteristic_cell");
447 $a_tpl->setVariable("CHAR_HTML",
448 '<div class="ilc_text_block_'.$char.'" style="margin-top:2px; margin-bottom:2px; position:static;">'.$char_lang."</div>");
449 $a_tpl->setVariable("CHAR_VALUE", $char);
450 if ($char == $a_seleted_value)
451 {
452 $a_tpl->setVariable("SELECTED",
453 ' checked="checked" ');
454 }
455 $a_tpl->parseCurrentBlock();
456 if ((($i+1) % 3) == 0) //
457 {
458 $a_tpl->touchBlock("characteristic_row");
459 }
460 $i++;
461 }
462 $a_tpl->touchBlock("characteristic_table");
463 }
464
471 function insertStyleSelectionList($a_tpl, $a_selected)
472 {
473 $a_tpl->setVariable("ADV_SEL_STYLE", self::getStyleSelector($a_selected,
474 $this->getCharacteristics()));
475 }
476
480 static function getStyleSelector($a_selected, $a_chars, $a_use_callback = false)
481 {
482 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
483 $selection = new ilAdvancedSelectionListGUI();
484 $selection->setPullRight(false);
485 $selection->setFormSelectMode("par_characteristic", "", false,
486 "", "", "",
487 "", "", "", "");
488 $selection->setId("style_selection");
489 $selection->setSelectionHeaderClass("ilEditSubmit ilTinyMenuDropDown");
490 $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
491 $selection->setSelectedValue($a_selected);
492 $selection->setUseImages(false);
494 if ($a_use_callback)
495 {
496 $selection->setSelectCallback("ilCOPage.setParagraphClass");
497 }
498
499 $chars = $a_chars;
500 $title_char = ($chars[$a_selected] != "")
501 ? $chars[$a_selected]
502 : $a_selected;
503 $selection->setListTitle($title_char);
504
505 if ($chars[$a_seleted] == "" && ($a_seleted != ""))
506 {
507 $chars = array_merge(array($a_seleted => $a_seleted),
508 $chars);
509 }
510
511 foreach ($chars as $char => $char_lang)
512 {
513 $t = "text_block";
514 $tag = "div";
515 switch($char)
516 {
517 case "Headline1": $t = "heading1"; $tag = "h1"; break;
518 case "Headline2": $t = "heading2"; $tag = "h2"; break;
519 case "Headline3": $t = "heading3"; $tag = "h3"; break;
520 }
521 $html = '<div class="ilCOPgEditStyleSelectionItem"><'.$tag.' class="ilc_'.$t.'_'.$char.'" style="'.self::$style_selector_reset.'">'.$char_lang."</".$tag."></div>";
522 $selection->addItem($char_lang, $char, "",
523 "", $char, "", $html);
524 }
525 return $selection->getHTML();
526 }
527
531 static function getCharStyleSelector($a_par_type, $a_use_callback = true)
532 {
533 global $lng;
534
535 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
536 $selection = new ilAdvancedSelectionListGUI();
537 $selection->setPullRight(false);
538 $selection->setFormSelectMode("char_characteristic", "", false,
539 "", "", "",
540 "", "", "", "");
541 $selection->setId("char_style_selection");
542 $selection->setSelectionHeaderClass("ilEditSubmit");
543 $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
544 //$selection->setSelectedValue($a_selected);
545 $selection->setUseImages(false);
546 $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_NOP);
547 if ($a_use_callback)
548 {
549 $selection->setSelectCallback("ilCOPage.setCharacterClass");
550 }
551
552 //$chars = $a_chars;
553 //$title_char = ($chars[$a_selected] != "")
554 // ? $chars[$a_selected]
555 // : $a_selected;
556 $selection->setListTitle("&nbsp;<i>A</i>");
557
558 /*if ($chars[$a_seleted] == "" && ($a_seleted != ""))
559 {
560 $chars = array_merge(array($a_seleted => $a_seleted),
561 $chars);
562 }*/
563
564 $chars = array(
565 "Comment" => array("code" => "com", "txt" => $lng->txt("cont_char_style_com")),
566 "Quotation" => array("code" => "quot", "txt" =>$lng->txt("cont_char_style_quot")),
567 "Accent" => array("code" => "acc", "txt" => $lng->txt("cont_char_style_acc")),
568 "Code" => array("code" => "code", "txt" => $lng->txt("cont_char_style_code"))
569 );
570 foreach ($chars as $key => $char)
571 {
573 $a_par_type, "active_".$char["code"], true))
574 {
575 $t = "text_inline";
576 $tag = "span";
577 switch($key)
578 {
579 case "Code": $tag = "code"; break;
580 }
581 $html = '<'.$tag.' class="ilc_'.$t.'_'.$key.'" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">'.$char["txt"]."</".$tag.">";
582
583 // this next line is very important for IE. The real onclick event is on the surrounding <tr> of the
584 // advanced selection list. But it is impossible to prevent the tr-event from removing the focus
585 // on tiny withouth the following line, that receives the click event before and stops the faulty default
586 // bevaviour of IE, see bug report #8723
587 $html = '<a class="nostyle" style="display:block;" href="#" onclick="return false;">'.$html."</a>";
588 $selection->addItem($char["txt"], $key, "",
589 "", $key, "", $html);
590 }
591 }
592 return $selection->getHTML();
593 }
594
598 private function setStyle()
599 {
600 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
601
602 if ($this->pg_obj->getParentType() == "gdf" ||
603 $this->pg_obj->getParentType() == "lm" ||
604 $this->pg_obj->getParentType() == "dbk")
605 {
606 if ($this->pg_obj->getParentType() != "gdf")
607 {
608 $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(
609 ilObjContentObject::_lookupStyleSheetId($this->pg_obj->getParentId())));
610 }
611 else
612 {
613 $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(0));
614 }
615 }
616 else
617 {
618 if ($this->pg_obj->getParentType() != "sahs")
619 {
620// $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(0));
621 }
622 }
623 }
624
628 function insert()
629 {
630 return $this->edit(true);
631 }
632
636 function update()
637 {
638 global $ilBench;
639
640 $ilBench->start("Editor","Paragraph_update");
641 // set language and characteristic
642 $this->content_obj->setLanguage($_POST["par_language"]);
643 $this->content_obj->setCharacteristic($_POST["par_characteristic"]);
644 //$this->content_obj->setAnchor(ilUtil::stripSlashes($_POST["anchor"]));
645
646//echo "<br>PARupdate1:".$_POST["par_content"].":";
647//echo "<br>PARupdate2:".htmlentities($_POST["par_content"]).":";
648//echo "<br>PARupdate3:".htmlentities($this->content_obj->input2xml($_POST["par_content"])).":";
649//echo "<br>PARupdate4:".$this->content_obj->input2xml($_POST["par_content"]).":";
650
651 //$this->updated = $this->content_obj->setText(
652 // $this->content_obj->input2xml(stripslashes($_POST["par_content"]),
653 // $_POST["usedwsiwygeditor"]));
654 $this->updated = $this->content_obj->setText(
655 $this->content_obj->input2xml($_POST["par_content"],
656 $_POST["usedwsiwygeditor"]), true);
657//echo "<br>PARupdate2";
658 if ($this->updated !== true)
659 {
660 $ilBench->stop("Editor","Paragraph_update");
661 $this->edit();
662 return;
663 }
664
665 $this->updated = $this->content_obj->updatePage($this->pg_obj);
666//echo "<br>PARupdate_after:".htmlentities($this->pg_obj->dom->dump_mem(0, "UTF-8")).":";
667//debug_print_backtrace();
668
669 $ilBench->stop("Editor","Paragraph_update");
670
671 if ($this->updated === true)
672 {
673 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
674 }
675 else
676 {
677 $this->edit();
678 }
679 }
680
681
685 function create()
686 {
687 if ($_POST["ajaxform_hier_id"] != "")
688 {
689 return $this->createJS();
690 }
691
692 $this->content_obj = new ilPCParagraph($this->getPage());
693//echo "+".$this->pc_id."+";
694 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
695
696 $this->content_obj->setLanguage($_POST["par_language"]);
697 $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["par_language"];
698 $this->content_obj->setCharacteristic($_POST["par_characteristic"]);
699
700 $this->updated = $this->content_obj->setText(
701 $this->content_obj->input2xml($_POST["par_content"],
702 $_POST["usedwsiwygeditor"]), true);
703
704 if ($this->updated !== true)
705 {
706 $this->insert();
707 return;
708 }
709 $this->updated = $this->content_obj->updatePage($this->pg_obj);
710
711 if ($this->updated === true)
712 {
713 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
714 }
715 else
716 {
717 $this->insert();
718 }
719 }
720
724 function createJS()
725 {
726 global $ilUser, $ilCtrl;
727
728 $this->content_obj = new ilPCParagraph($this->getPage());
729 $this->updated = $this->content_obj->saveJS($this->pg_obj,
730 $_POST["ajaxform_content"],
731 ilUtil::stripSlashes($_POST["ajaxform_char"]),
732 ilUtil::stripSlashes($_POST["pc_id_str"]),
733 $_POST["insert_at_id"]);
734 if ($_POST["quick_save"])
735 {
736 if ($this->updated)
737 {
738 $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
739 echo $a_pc_id_str;
740 exit;
741 }
742 }
743
744 if ($this->updated !== true && is_array($this->updated))
745 {
746 $this->outputError($this->updated);
747 }
748
749 // e.g. e.g. ###3:110dad8bad6df8620071a0a693a2d328###
750 $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
751 $ilCtrl->setParameterByClass($ilCtrl->getReturnClass($this), "updated_pc_id_str",
752 urlencode($a_pc_id_str));
753 $ilCtrl->redirectByClass($ilCtrl->getReturnClass($this), "edit", "", true);
754 }
755
759 function insertHelp($a_tpl)
760 {
761 global $lng;
762
763 $a_tpl->setCurrentBlock("help_item");
764 $a_tpl->setVariable("TXT_HELP", "<b>".$lng->txt("cont_syntax_help")."</b>");
765 $a_tpl->parseCurrentBlock();
766 $a_tpl->setCurrentBlock("help_item");
767 $a_tpl->setVariable("TXT_HELP", "* ".$lng->txt("cont_bullet_list"));
768 $a_tpl->parseCurrentBlock();
769 $a_tpl->setCurrentBlock("help_item");
770 $a_tpl->setVariable("TXT_HELP", "# ".$lng->txt("cont_numbered_list"));
771 $a_tpl->parseCurrentBlock();
772 $a_tpl->setCurrentBlock("help_item");
773 $a_tpl->setVariable("TXT_HELP", "=".$lng->txt("cont_Headline1")."=<br />".
774 "==".$lng->txt("cont_Headline2")."==<br />".
775 "===".$lng->txt("cont_Headline3")."===");
776 $a_tpl->parseCurrentBlock();
777
778 if ($this->getPageConfig()->getEnableWikiLinks())
779 {
780 $a_tpl->setCurrentBlock("help_item");
781 $a_tpl->setVariable("TXT_HELP", "[[".$lng->txt("cont_wiki_page_link")."]]");
782 $a_tpl->parseCurrentBlock();
783 }
784
785 $a_tpl->setCurrentBlock("help");
786 $a_tpl->parseCurrentBlock();
787 }
788
789}
790?>
$_GET["client_id"]
User interface class for advanced drop-down selection lists.
_lookupStyleSheetId($a_cont_obj_id)
lookup style sheet ID
Class ilObjStyleSheet.
getContentStylePath($a_style_id)
get content style path
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilPCParagraphGUI.
saveJS()
Save paragraph by JS call.
insert()
insert paragraph form
insertCharacteristicTable($a_tpl, $a_seleted_value)
Insert characteristic table.
determineCharacteristic($a_insert=false)
Determine current characteristic.
outputError($a_err)
Output error.
static xml2outputJS($s_text, $char, $a_pc_id)
Prepare content for js output.
& executeCommand()
execute command
createJS()
Create paragraph per JS.
editJS()
Edit paragraph (Ajax mode, sends the content of the paragraph)
create()
create new paragraph in dom and update page in db
static _getCharacteristics($a_style_id)
Get characteristics.
static getCharStyleSelector($a_par_type, $a_use_callback=true)
Get character style selector.
static getStyleSelector($a_selected, $a_chars, $a_use_callback=false)
Get style selector.
edit($a_insert=false)
edit paragraph form
insertHelp($a_tpl)
Insert Help.
insertStyleSelectionList($a_tpl, $a_selected)
Insert style selection list.
static _getStandardCharacteristics()
Get standard characteristics.
update()
update paragraph in dom and update page in db
ilPCParagraphGUI($a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
editMultipleJS()
Edit multiple paragraphs (Ajax mode, sends the content of the paragraphs)
Class ilPCParagraph.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getHierId()
get hierarchical id in dom object
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
static _getCommonBBButtons()
Get common bb buttons.
getCharacteristics()
Get characteristics.
getBBMenu($a_ta_name="par_content")
Get the bb menu incl.
setCharacteristics($a_chars)
Set Characteristics.
static lookupSettingByParentType($a_par_type, $a_name, $a_default=false)
Lookup setting by parent type.
special template class to simplify handling of ITX/PEAR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
$_POST['username']
Definition: cron.php:12
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilBench
Definition: ilias.php:18
global $ilCtrl
Definition: ilias.php:18
exit
Definition: login.php:54
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15