ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 require_once("./Services/COPage/classes/class.ilPCParagraph.php");
5 require_once("./Services/COPage/classes/class.ilPageContentGUI.php");
6 require_once("./Services/COPage/classes/class.ilWysiwygUtil.php");
7 
19 {
24  function ilPCParagraphGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = "")
25  {
26  $this->setEnableWikiLinks(false);
27  parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
28 
29  // characteristics (should be flexible in the future)
31  }
32 
36  static function _getStandardCharacteristics()
37  {
38  global $lng;
39 
40  return array("Standard" => $lng->txt("cont_standard"),
41  "Headline1" => $lng->txt("cont_Headline1"),
42  "Headline2" => $lng->txt("cont_Headline2"),
43  "Headline3" => $lng->txt("cont_Headline3"),
44  "Citation" => $lng->txt("cont_Citation"),
45  "Mnemonic" => $lng->txt("cont_Mnemonic"),
46  "Example" => $lng->txt("cont_Example"),
47  "Additional" => $lng->txt("cont_Additional"),
48  "Remark" => $lng->txt("cont_Remark"),
49  "List" => $lng->txt("cont_List"),
50  "TableContent" => $lng->txt("cont_TableContent")
51  );
52  }
53 
57  static function _getCharacteristics($a_style_id)
58  {
61 
62  if ($a_style_id > 0 &&
63  ilObject::_lookupType($a_style_id) == "sty")
64  {
65  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
66  $style = new ilObjStyleSheet($a_style_id);
67  $types = array("text_block", "heading1", "heading2", "heading3");
68  $chars = array();
69  foreach ($types as $t)
70  {
71  $chars = array_merge($chars, $style->getCharacteristics($t));
72  }
73  $new_chars = array();
74  foreach ($chars as $char)
75  {
76  if ($st_chars[$char] != "") // keep lang vars for standard chars
77  {
78  $new_chars[$char] = $st_chars[$char];
79  }
80  else
81  {
82  $new_chars[$char] = $char;
83  }
84  asort($new_chars);
85  }
86  $chars = $new_chars;
87  }
88 
89  return $chars;
90  }
91 
95  function &executeCommand()
96  {
97  // get next class that processes or forwards current command
98  $next_class = $this->ctrl->getNextClass($this);
99 
101  array("text_block", "heading1", "heading2", "heading3")); // scorm-2004
102 
103  // get current command
104  $cmd = $this->ctrl->getCmd();
105 
106  switch($next_class)
107  {
108  default:
109  $ret =& $this->$cmd();
110  break;
111  }
112 
113  return $ret;
114  }
115 
121  function setEnableWikiLinks($a_enablewikilinks)
122  {
123  $this->enablewikilinks = $a_enablewikilinks;
124  }
125 
132  {
133  return $this->enablewikilinks;
134  }
135 
139  function edit($a_insert = false)
140  {
141  global $ilUser, $ilias;
142 
143  // add paragraph edit template
144  $tpl = new ilTemplate("tpl.paragraph_edit.html", true, true, "Services/COPage");
145 
146  // help text
147  $this->insertHelp($tpl);
148 
149  // operations
150  if ($a_insert)
151  {
152  $tpl->setCurrentBlock("commands");
153  $tpl->setVariable("BTN_NAME", "create_par");
154  $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
155  $tpl->setVariable("BTN_CANCEL", "cancelCreate");
156  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
157  $tpl->parseCurrentBlock();
158  $tpl->setCurrentBlock("commands2");
159  $tpl->setVariable("BTN_NAME", "create_par");
160  $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
161  $tpl->setVariable("BTN_CANCEL", "cancelCreate");
162  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
163  $tpl->parseCurrentBlock();
164  $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_par"));
165  }
166  else
167  {
168  $tpl->setCurrentBlock("commands");
169  $tpl->setVariable("BTN_NAME", "update");
170  $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
171  $tpl->setVariable("BTN_CANCEL", "cancelUpdate");
172  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
173  $tpl->parseCurrentBlock();
174  $tpl->setCurrentBlock("commands2");
175  $tpl->setVariable("BTN_NAME", "update");
176  $tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
177  $tpl->setVariable("BTN_CANCEL", "cancelUpdate");
178  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
179  $tpl->parseCurrentBlock();
180  $tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_par"));
181  }
182 
183  // language and characteristic selection
184  $s_char = $this->determineCharacteristic($a_insert);
185  if (!$a_insert)
186  {
187  if (key($_POST["cmd"]) == "update")
188  {
189  $s_lang = $_POST["par_language"];
190  }
191  else
192  {
193  $s_lang = $this->content_obj->getLanguage();
194  }
195  }
196  else
197  {
198  if (key($_POST["cmd"]) == "create_par")
199  {
200  $s_lang = $_POST["par_language"];
201  }
202  else
203  {
204  if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
205  {
206  $s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
207  }
208  else
209  {
210  $s_lang = $ilUser->getLanguage();
211  }
212  }
213  }
214 
215  $this->insertStyleSelectionList($tpl, $s_char);
216 // $this->insertCharacteristicTable($tpl, $s_char);
217 
218 
219  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
220 
221  $tpl->setVariable("PAR_TA_NAME", "par_content");
222  $tpl->setVariable("BB_MENU", $this->getBBMenu());
223  $this->tpl->addJavascript("./Services/COPage/phpBB/3_0_5/editor.js");
224  $this->tpl->addJavascript("./Services/COPage/js/paragraph_editing.js");
225  $this->setStyle();
226 
227  $this->displayValidationError();
228 
229  $tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
230  $tpl->setVariable("TXT_ANCHOR", $this->lng->txt("cont_anchor"));
231 
232  require_once("Services/MetaData/classes/class.ilMDLanguageItem.php");
234  $select_lang = ilUtil::formSelect ($s_lang,"par_language",$lang,false,true);
235  $tpl->setVariable("SELECT_LANGUAGE", $select_lang);
236 
237  $tpl->setVariable("TXT_CHARACTERISTIC", $this->lng->txt("cont_characteristic"));
238 // $select_char = ilUtil::formSelect ($s_char,
239 // "par_characteristic",$this->chars,false,true);
240 // $tpl->setVariable("SELECT_CHARACTERISTIC", $select_char);
241 
242  if (key($_POST["cmd"]) == "update" || key($_POST["cmd"]) == "create_par")
243  {
244  $s_text = ilUtil::stripSlashes($_POST["par_content"], false);
245  // prevent curly brackets from being swallowed up by template engine
246  $s_text = str_replace("{", "&#123;", $s_text);
247  $s_text = str_replace("}", "&#125;", $s_text);
248  }
249  else if (!$a_insert)
250  {
251  $s_text = $this->content_obj->xml2output($this->content_obj->getText());
252  }
253 
254  $tpl->setVariable("PAR_TA_CONTENT", $s_text);
255 
256  $tpl->parseCurrentBlock();
257 
258  $this->tpl->setContent($tpl->get());
259  return $tpl->get();
260  }
261 
268  function determineCharacteristic($a_insert = false)
269  {
270  // language and characteristic selection
271  if (!$a_insert)
272  {
273  if (key($_POST["cmd"]) == "update")
274  {
275  $s_char = $_POST["par_characteristic"];
276  }
277  else
278  {
279  $s_char = $this->content_obj->getCharacteristic();
280  if ($s_char == "")
281  {
282  $s_char = "Standard";
283  }
284  }
285  }
286  else
287  {
288  if (key($_POST["cmd"]) == "create_par")
289  {
290  $s_char = $_POST["par_characteristic"];
291  }
292  else
293  {
294  $s_char = "Standard";
295 
296  // set characteristic of new paragraphs in list items to "List"
297  $cont_obj = $this->pg_obj->getContentObject($this->getHierId());
298  if (is_object($cont_obj))
299  {
300  if ($cont_obj->getType() == "li" ||
301  ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "List"))
302  {
303  $s_char = "List";
304  }
305 
306  if ($cont_obj->getType() == "td" ||
307  ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "TableContent"))
308  {
309  $s_char = "TableContent";
310  }
311 
312  }
313  }
314  }
315  return $s_char;
316  }
317 
321  function editJS()
322  {
323  global $ilUser, $ilias;
324 
325  $s_text = $this->content_obj->getText();
326 //echo "\n<br><br>".htmlentities($s_text);
327  $s_text = $this->content_obj->xml2output($s_text, true, false);
328 //echo "\n<br><br>".htmlentities($s_text);
329  $char = $this->determineCharacteristic(false);
330  $s_text = ilPCParagraphGUI::xml2outputJS($s_text, $char, $this->content_obj->readPCId());
331 //echo "\n<br><br>".htmlentities($s_text);
332  $ids = "###".$this->content_obj->readHierId().":".$this->content_obj->readPCId()."###".
333  $char."###";
334  echo $ids.$s_text;
335  exit;
336  }
337 
341  function editMultipleJS()
342  {
343  global $ilUser, $ilias;
344 
345  echo $this->content_obj->getParagraphSequenceContent($this->pg_obj);
346  exit;
347  }
348 
352  static function xml2outputJS($s_text, $char, $a_pc_id)
353  {
354 // $s_text = "<div class='ilc_text_block_".$char."' id='$a_pc_id'>".$s_text."</div>";
355  $s_text = $s_text;
356  // lists
357  $s_text = str_replace(array("<SimpleBulletList>", "</SimpleBulletList>"),
358  array("<ul class='ilc_list_u_BulletedList'>", "</ul>"),
359  $s_text);
360  $s_text = str_replace(array("<SimpleNumberedList>", "</SimpleNumberedList>"),
361  array("<ol class='ilc_list_o_NumberedList'>", "</ol>"), $s_text);
362  $s_text = str_replace(array("<SimpleListItem>", "</SimpleListItem>"),
363  array("<li class='ilc_list_item_StandardListItem'>", "</li>"), $s_text);
364  $s_text = str_replace(array("<SimpleListItem/>"),
365  array("<li class='ilc_list_item_StandardListItem'></li>"), $s_text);
366  //$s_text = str_replace("<SimpleBulletList><br />", "<SimpleBulletList>", $s_text);
367  //$s_text = str_replace("<SimpleNumberedList><br />", "<SimpleNumberedList>", $s_text);
368  //$s_text = str_replace("</SimpleListItem><br />", "</SimpleListItem>", $s_text);
369 
370 
371  // spans
372  include_once("./Services/COPage/classes/class.ilPageContentGUI.php");
373  foreach (ilPageContentGUI::_getCommonBBButtons() as $bb => $cl)
374  {
375  if (!in_array($bb, array("code", "tex", "fn", "xln")))
376  {
377  $s_text = str_replace("[".$bb."]",
378  '<span class="ilc_text_inline_'.$cl.'">', $s_text);
379  $s_text = str_replace("[/".$bb."]",
380  '</span>', $s_text);
381  }
382  }
383 
384  // code
385  $s_text = str_replace(array("[code]", "[/code]"),
386  array("<code>", "</code>"), $s_text);
387 
388  return $s_text;
389  }
390 
391 
398  function saveJS()
399  {
400  global $ilCtrl;
401 
402  $this->updated = $this->content_obj->saveJS($this->pg_obj,
403  $_POST["ajaxform_content"],
404  ilUtil::stripSlashes($_POST["ajaxform_char"]),
405  ilUtil::stripSlashes($_POST["pc_id_str"]));
406  if ($_POST["quick_save"])
407  {
408  if ($this->updated)
409  {
410  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
411  echo $a_pc_id_str;
412  exit;
413  }
414  }
415 
416  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
417 
418  $ilCtrl->setParameterByClass($ilCtrl->getReturnClass($this), "updated_pc_id_str",
419  urlencode($a_pc_id_str));
420  $ilCtrl->redirectByClass($ilCtrl->getReturnClass($this), "edit", "", true);
421  }
422 
426  function cancel()
427  {
428  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
429  }
430 
434  function insertCharacteristicTable($a_tpl, $a_seleted_value)
435  {
436  $i = 0;
437 
438  $chars = $this->getCharacteristics();
439 
440  if ($chars[$a_seleted_value] == "" && ($a_seleted_value != ""))
441  {
442  $chars = array_merge(array($a_seleted_value => $a_seleted_value),
443  $chars);
444  }
445 
446  foreach ($chars as $char => $char_lang)
447  {
448  $a_tpl->setCurrentBlock("characteristic_cell");
449  $a_tpl->setVariable("CHAR_HTML",
450  '<div class="ilc_text_block_'.$char.'" style="margin-top:2px; margin-bottom:2px; position:static;">'.$char_lang."</div>");
451  $a_tpl->setVariable("CHAR_VALUE", $char);
452  if ($char == $a_seleted_value)
453  {
454  $a_tpl->setVariable("SELECTED",
455  ' checked="checked" ');
456  }
457  $a_tpl->parseCurrentBlock();
458  if ((($i+1) % 3) == 0) //
459  {
460  $a_tpl->touchBlock("characteristic_row");
461  }
462  $i++;
463  }
464  $a_tpl->touchBlock("characteristic_table");
465  }
466 
473  function insertStyleSelectionList($a_tpl, $a_selected)
474  {
475  $a_tpl->setVariable("ADV_SEL_STYLE", self::getStyleSelector($a_selected,
476  $this->getCharacteristics()));
477  }
478 
482  static function getStyleSelector($a_selected, $a_chars, $a_use_callback = false)
483  {
484  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
485  $selection = new ilAdvancedSelectionListGUI();
486  $selection->setFormSelectMode("par_characteristic", "", false,
487  "", "", "",
488  "", "", "", "");
489  $selection->setId("style_selection");
490  $selection->setSelectionHeaderClass("ilEditSubmit ilTinyMenuDropDown");
491  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
492  $selection->setSelectedValue($a_selected);
493  $selection->setUseImages(false);
494  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT);
495  if ($a_use_callback)
496  {
497  $selection->setSelectCallback("ilCOPage.setParagraphClass");
498  }
499 
500  $chars = $a_chars;
501  $title_char = ($chars[$a_selected] != "")
502  ? $chars[$a_selected]
503  : $a_selected;
504  $selection->setListTitle($title_char);
505 
506  if ($chars[$a_seleted] == "" && ($a_seleted != ""))
507  {
508  $chars = array_merge(array($a_seleted => $a_seleted),
509  $chars);
510  }
511 
512  foreach ($chars as $char => $char_lang)
513  {
514  $t = "text_block";
515  $tag = "div";
516  switch($char)
517  {
518  case "Headline1": $t = "heading1"; $tag = "h1"; break;
519  case "Headline2": $t = "heading2"; $tag = "h2"; break;
520  case "Headline3": $t = "heading3"; $tag = "h3"; break;
521  }
522  $html = '<'.$tag.' class="ilc_'.$t.'_'.$char.'" style="margin-top:2px; margin-bottom:2px; text-indent:0px; position:static;">'.$char_lang."</".$tag.">";
523  $selection->addItem($char_lang, $char, "",
524  "", $char, "", $html);
525  }
526  return $selection->getHTML();
527  }
528 
532  static function getCharStyleSelector($a_par_type, $a_use_callback = true)
533  {
534  global $lng;
535 
536  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
537  $selection = new ilAdvancedSelectionListGUI();
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->pg_obj->update();
666 //echo "<br>PARupdate_after:".htmlentities($this->pg_obj->dom->dump_mem(0, "UTF-8")).":";
667 
668  $ilBench->stop("Editor","Paragraph_update");
669 
670  if ($this->updated === true)
671  {
672  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
673  }
674  else
675  {
676  $this->edit();
677  }
678  }
679 
680 
684  function create()
685  {
686  if ($_POST["ajaxform_hier_id"] != "")
687  {
688  return $this->createJS();
689  }
690 
691  $this->content_obj =& new ilPCParagraph($this->dom);
692 //echo "+".$this->pc_id."+";
693  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
694 
695  $this->content_obj->setLanguage($_POST["par_language"]);
696  $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["par_language"];
697  $this->content_obj->setCharacteristic($_POST["par_characteristic"]);
698 
699  $this->updated = $this->content_obj->setText(
700  $this->content_obj->input2xml($_POST["par_content"],
701  $_POST["usedwsiwygeditor"]), true);
702 
703  if ($this->updated !== true)
704  {
705  $this->insert();
706  return;
707  }
708  $this->updated = $this->pg_obj->update();
709 
710  if ($this->updated === true)
711  {
712  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
713  }
714  else
715  {
716  $this->insert();
717  }
718  }
719 
723  function createJS()
724  {
725  global $ilUser, $ilCtrl;
726 
727  $this->content_obj = new ilPCParagraph($this->dom);
728  $this->updated = $this->content_obj->saveJS($this->pg_obj,
729  $_POST["ajaxform_content"],
730  ilUtil::stripSlashes($_POST["ajaxform_char"]),
731  ilUtil::stripSlashes($_POST["pc_id_str"]),
732  $_POST["insert_at_id"]);
733  if ($_POST["quick_save"])
734  {
735  if ($this->updated)
736  {
737  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
738  echo $a_pc_id_str;
739  exit;
740  }
741  }
742 
743  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
744  $ilCtrl->setParameterByClass($ilCtrl->getReturnClass($this), "updated_pc_id_str",
745  urlencode($a_pc_id_str));
746  $ilCtrl->redirectByClass($ilCtrl->getReturnClass($this), "edit", "", true);
747  }
748 
752  function insertHelp($a_tpl)
753  {
754  global $lng;
755 
756  $a_tpl->setCurrentBlock("help_item");
757  $a_tpl->setVariable("TXT_HELP", "<b>".$lng->txt("cont_syntax_help")."</b>");
758  $a_tpl->parseCurrentBlock();
759  $a_tpl->setCurrentBlock("help_item");
760  $a_tpl->setVariable("TXT_HELP", "* ".$lng->txt("cont_bullet_list"));
761  $a_tpl->parseCurrentBlock();
762  $a_tpl->setCurrentBlock("help_item");
763  $a_tpl->setVariable("TXT_HELP", "# ".$lng->txt("cont_numbered_list"));
764  $a_tpl->parseCurrentBlock();
765  $a_tpl->setCurrentBlock("help_item");
766  $a_tpl->setVariable("TXT_HELP", "=".$lng->txt("cont_Headline1")."=<br />".
767  "==".$lng->txt("cont_Headline2")."==<br />".
768  "===".$lng->txt("cont_Headline3")."===");
769  $a_tpl->parseCurrentBlock();
770 
771  if ($this->getEnableWikiLinks())
772  {
773  $a_tpl->setCurrentBlock("help_item");
774  $a_tpl->setVariable("TXT_HELP", "[[".$lng->txt("cont_wiki_page_link")."]]");
775  $a_tpl->parseCurrentBlock();
776  }
777 
778  $a_tpl->setCurrentBlock("help");
779  $a_tpl->parseCurrentBlock();
780  }
781 
782 }
783 ?>