ILIAS  Release_4_4_x_branch Revision 61816
 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 
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 
34  static function _getStandardCharacteristics()
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->setFormSelectMode("par_characteristic", "", false,
485  "", "", "",
486  "", "", "", "");
487  $selection->setId("style_selection");
488  $selection->setSelectionHeaderClass("ilEditSubmit ilTinyMenuDropDown");
489  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
490  $selection->setSelectedValue($a_selected);
491  $selection->setUseImages(false);
492  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT);
493  if ($a_use_callback)
494  {
495  $selection->setSelectCallback("ilCOPage.setParagraphClass");
496  }
497 
498  $chars = $a_chars;
499  $title_char = ($chars[$a_selected] != "")
500  ? $chars[$a_selected]
501  : $a_selected;
502  $selection->setListTitle($title_char);
503 
504  if ($chars[$a_seleted] == "" && ($a_seleted != ""))
505  {
506  $chars = array_merge(array($a_seleted => $a_seleted),
507  $chars);
508  }
509 
510  foreach ($chars as $char => $char_lang)
511  {
512  $t = "text_block";
513  $tag = "div";
514  switch($char)
515  {
516  case "Headline1": $t = "heading1"; $tag = "h1"; break;
517  case "Headline2": $t = "heading2"; $tag = "h2"; break;
518  case "Headline3": $t = "heading3"; $tag = "h3"; break;
519  }
520  $html = '<'.$tag.' class="ilc_'.$t.'_'.$char.'" style="margin-top:2px; margin-bottom:2px; text-indent:0px; position:static;">'.$char_lang."</".$tag.">";
521  $selection->addItem($char_lang, $char, "",
522  "", $char, "", $html);
523  }
524  return $selection->getHTML();
525  }
526 
530  static function getCharStyleSelector($a_par_type, $a_use_callback = true)
531  {
532  global $lng;
533 
534  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
535  $selection = new ilAdvancedSelectionListGUI();
536  $selection->setFormSelectMode("char_characteristic", "", false,
537  "", "", "",
538  "", "", "", "");
539  $selection->setId("char_style_selection");
540  $selection->setSelectionHeaderClass("ilEditSubmit");
541  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
542  //$selection->setSelectedValue($a_selected);
543  $selection->setUseImages(false);
544  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_NOP);
545  if ($a_use_callback)
546  {
547  $selection->setSelectCallback("ilCOPage.setCharacterClass");
548  }
549 
550  //$chars = $a_chars;
551  //$title_char = ($chars[$a_selected] != "")
552  // ? $chars[$a_selected]
553  // : $a_selected;
554  $selection->setListTitle("&nbsp;<i>A</i>");
555 
556  /*if ($chars[$a_seleted] == "" && ($a_seleted != ""))
557  {
558  $chars = array_merge(array($a_seleted => $a_seleted),
559  $chars);
560  }*/
561 
562  $chars = array(
563  "Comment" => array("code" => "com", "txt" => $lng->txt("cont_char_style_com")),
564  "Quotation" => array("code" => "quot", "txt" =>$lng->txt("cont_char_style_quot")),
565  "Accent" => array("code" => "acc", "txt" => $lng->txt("cont_char_style_acc")),
566  "Code" => array("code" => "code", "txt" => $lng->txt("cont_char_style_code"))
567  );
568  foreach ($chars as $key => $char)
569  {
571  $a_par_type, "active_".$char["code"], true))
572  {
573  $t = "text_inline";
574  $tag = "span";
575  switch($key)
576  {
577  case "Code": $tag = "code"; break;
578  }
579  $html = '<'.$tag.' class="ilc_'.$t.'_'.$key.'" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">'.$char["txt"]."</".$tag.">";
580 
581  // this next line is very important for IE. The real onclick event is on the surrounding <tr> of the
582  // advanced selection list. But it is impossible to prevent the tr-event from removing the focus
583  // on tiny withouth the following line, that receives the click event before and stops the faulty default
584  // bevaviour of IE, see bug report #8723
585  $html = '<a class="nostyle" style="display:block;" href="#" onclick="return false;">'.$html."</a>";
586  $selection->addItem($char["txt"], $key, "",
587  "", $key, "", $html);
588  }
589  }
590  return $selection->getHTML();
591  }
592 
596  private function setStyle()
597  {
598  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
599 
600  if ($this->pg_obj->getParentType() == "gdf" ||
601  $this->pg_obj->getParentType() == "lm" ||
602  $this->pg_obj->getParentType() == "dbk")
603  {
604  if ($this->pg_obj->getParentType() != "gdf")
605  {
606  $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(
607  ilObjContentObject::_lookupStyleSheetId($this->pg_obj->getParentId())));
608  }
609  else
610  {
611  $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(0));
612  }
613  }
614  else
615  {
616  if ($this->pg_obj->getParentType() != "sahs")
617  {
618 // $this->tpl->setContentStylesheet(ilObjStyleSheet::getContentStylePath(0));
619  }
620  }
621  }
622 
626  function insert()
627  {
628  return $this->edit(true);
629  }
630 
634  function update()
635  {
636  global $ilBench;
637 
638  $ilBench->start("Editor","Paragraph_update");
639  // set language and characteristic
640  $this->content_obj->setLanguage($_POST["par_language"]);
641  $this->content_obj->setCharacteristic($_POST["par_characteristic"]);
642  //$this->content_obj->setAnchor(ilUtil::stripSlashes($_POST["anchor"]));
643 
644 //echo "<br>PARupdate1:".$_POST["par_content"].":";
645 //echo "<br>PARupdate2:".htmlentities($_POST["par_content"]).":";
646 //echo "<br>PARupdate3:".htmlentities($this->content_obj->input2xml($_POST["par_content"])).":";
647 //echo "<br>PARupdate4:".$this->content_obj->input2xml($_POST["par_content"]).":";
648 
649  //$this->updated = $this->content_obj->setText(
650  // $this->content_obj->input2xml(stripslashes($_POST["par_content"]),
651  // $_POST["usedwsiwygeditor"]));
652  $this->updated = $this->content_obj->setText(
653  $this->content_obj->input2xml($_POST["par_content"],
654  $_POST["usedwsiwygeditor"]), true);
655 //echo "<br>PARupdate2";
656  if ($this->updated !== true)
657  {
658  $ilBench->stop("Editor","Paragraph_update");
659  $this->edit();
660  return;
661  }
662 
663  $this->updated = $this->content_obj->updatePage($this->pg_obj);
664 //echo "<br>PARupdate_after:".htmlentities($this->pg_obj->dom->dump_mem(0, "UTF-8")).":";
665 //debug_print_backtrace();
666 
667  $ilBench->stop("Editor","Paragraph_update");
668 
669  if ($this->updated === true)
670  {
671  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
672  }
673  else
674  {
675  $this->edit();
676  }
677  }
678 
679 
683  function create()
684  {
685  if ($_POST["ajaxform_hier_id"] != "")
686  {
687  return $this->createJS();
688  }
689 
690  $this->content_obj = new ilPCParagraph($this->getPage());
691 //echo "+".$this->pc_id."+";
692  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
693 
694  $this->content_obj->setLanguage($_POST["par_language"]);
695  $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["par_language"];
696  $this->content_obj->setCharacteristic($_POST["par_characteristic"]);
697 
698  $this->updated = $this->content_obj->setText(
699  $this->content_obj->input2xml($_POST["par_content"],
700  $_POST["usedwsiwygeditor"]), true);
701 
702  if ($this->updated !== true)
703  {
704  $this->insert();
705  return;
706  }
707  $this->updated = $this->content_obj->updatePage($this->pg_obj);
708 
709  if ($this->updated === true)
710  {
711  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
712  }
713  else
714  {
715  $this->insert();
716  }
717  }
718 
722  function createJS()
723  {
724  global $ilUser, $ilCtrl;
725 
726  $this->content_obj = new ilPCParagraph($this->getPage());
727  $this->updated = $this->content_obj->saveJS($this->pg_obj,
728  $_POST["ajaxform_content"],
729  ilUtil::stripSlashes($_POST["ajaxform_char"]),
730  ilUtil::stripSlashes($_POST["pc_id_str"]),
731  $_POST["insert_at_id"]);
732  if ($_POST["quick_save"])
733  {
734  if ($this->updated)
735  {
736  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
737  echo $a_pc_id_str;
738  exit;
739  }
740  }
741 
742  if ($this->updated !== true && is_array($this->updated))
743  {
744  $this->outputError($this->updated);
745  }
746 
747  // e.g. e.g. ###3:110dad8bad6df8620071a0a693a2d328###
748  $a_pc_id_str = $this->content_obj->getLastSavedPcId($this->pg_obj, true);
749  $ilCtrl->setParameterByClass($ilCtrl->getReturnClass($this), "updated_pc_id_str",
750  urlencode($a_pc_id_str));
751  $ilCtrl->redirectByClass($ilCtrl->getReturnClass($this), "edit", "", true);
752  }
753 
757  function insertHelp($a_tpl)
758  {
759  global $lng;
760 
761  $a_tpl->setCurrentBlock("help_item");
762  $a_tpl->setVariable("TXT_HELP", "<b>".$lng->txt("cont_syntax_help")."</b>");
763  $a_tpl->parseCurrentBlock();
764  $a_tpl->setCurrentBlock("help_item");
765  $a_tpl->setVariable("TXT_HELP", "* ".$lng->txt("cont_bullet_list"));
766  $a_tpl->parseCurrentBlock();
767  $a_tpl->setCurrentBlock("help_item");
768  $a_tpl->setVariable("TXT_HELP", "# ".$lng->txt("cont_numbered_list"));
769  $a_tpl->parseCurrentBlock();
770  $a_tpl->setCurrentBlock("help_item");
771  $a_tpl->setVariable("TXT_HELP", "=".$lng->txt("cont_Headline1")."=<br />".
772  "==".$lng->txt("cont_Headline2")."==<br />".
773  "===".$lng->txt("cont_Headline3")."===");
774  $a_tpl->parseCurrentBlock();
775 
776  if ($this->getPageConfig()->getEnableWikiLinks())
777  {
778  $a_tpl->setCurrentBlock("help_item");
779  $a_tpl->setVariable("TXT_HELP", "[[".$lng->txt("cont_wiki_page_link")."]]");
780  $a_tpl->parseCurrentBlock();
781  }
782 
783  $a_tpl->setCurrentBlock("help");
784  $a_tpl->parseCurrentBlock();
785  }
786 
787 }
788 ?>