4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
30 "str" =>
"Strong",
"emp" =>
"Emph",
"imp" =>
"Important",
"com" =>
"Comment",
31 "quot" =>
"Quotation",
"acc" =>
"Accent",
"code" =>
"Code",
"tex" =>
"Tex",
32 "fn" =>
"Footnote",
"xln" =>
"ExternalLink"
45 $this->pg_obj =& $a_pg_obj;
48 $this->content_obj =& $a_content_obj;
51 $this->hier_id = $a_hier_id;
52 $this->pc_id = $a_pc_id;
54 $this->dom =& $a_pg_obj->getDom();
74 $this->styleid = $a_styleid;
84 return $this->styleid;
94 $this->enable_internal_links = $a_val;
104 return $this->enable_internal_links;
114 $this->enable_keywords = $a_val;
124 return $this->enable_keywords;
134 $this->enable_anchors = $a_val;
144 return $this->enable_anchors;
152 if ((!is_object($this->style) || $this->
getStyleId() != $this->style->getId()) && $this->
getStyleId() > 0)
156 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
172 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
175 if (!is_array($a_type))
177 $a_type = array($a_type);
179 foreach ($a_type as $at)
181 $chars = array_merge($chars, $style->getCharacteristics($at,
true));
183 $new_chars = array();
184 if (is_array($chars))
186 foreach ($chars as $char)
188 if ($this->chars[$char] !=
"")
190 $new_chars[$char] = $this->chars[$char];
194 $new_chars[$char] = $char;
208 $this->chars = $a_chars;
216 return $this->chars ? $this->chars : array();
244 $this->hier_id = $a_hier_id;
254 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
256 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
264 $btpl->setCurrentBlock(
"bb_ilink_button");
265 $btpl->setVariable(
"BB_LINK_ILINK",
266 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
267 $btpl->parseCurrentBlock();
270 include_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
271 $btpl->setCurrentBlock(
"int_link_prep");
273 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
274 "",
false,
true,
false)));
275 $btpl->parseCurrentBlock();
281 $btpl->touchBlock(
"bb_kw_button");
282 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
284 if ($this->pg_obj->getParentType() ==
"wpg")
286 $btpl->setCurrentBlock(
"bb_wikilink_button");
287 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
288 $btpl->parseCurrentBlock();
290 $jsMathSetting =
new ilSetting(
"jsMath");
293 foreach (self::$common_bb_buttons as $c => $st)
297 if ($c !=
"tex" || $jsMathSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
299 $btpl->touchBlock(
"bb_".$c.
"_button");
300 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
307 $btpl->touchBlock(
"bb_anc_button");
308 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
315 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
318 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
319 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
321 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
331 $updated = $this->pg_obj->deleteContent($this->hier_id);
340 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
349 if(!isset(
$_POST[
"target"]))
351 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
355 if(count(
$_POST[
"target"]) > 1)
357 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
360 $a_hid = explode(
":",
$_POST[
"target"][0]);
364 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
366 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
370 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
371 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
373 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
377 $first_hier_character = substr($a_hid[0], 0, 1);
378 if ($first_hier_character ==
"c" ||
379 $first_hier_character ==
"r" ||
380 $first_hier_character ==
"i")
382 $a_hid[0] = substr($a_hid[0], 1);
386 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
387 $this->content_obj->getPcId(), $a_hid[1]);
397 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
406 if(!isset(
$_POST[
"target"]))
408 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
412 if(count(
$_POST[
"target"]) > 1)
414 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
417 $a_hid = explode(
":",
$_POST[
"target"][0]);
420 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
422 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
426 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
427 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
429 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
433 $first_hier_character = substr($a_hid[0], 0, 1);
434 if ($first_hier_character ==
"c" ||
435 $first_hier_character ==
"r" ||
436 $first_hier_character ==
"i")
438 $a_hid[0] = substr($a_hid[0], 1);
442 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
443 $this->content_obj->getPcId(), $a_hid[1]);
452 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
463 if ($this->pg_obj->getParentType() !=
"lm" &&
464 $this->pg_obj->getParentType() !=
"dbk")
466 $ilErr->raiseError(
"Split method called for wrong parent type (".
467 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
475 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
476 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
479 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
489 if ($this->pg_obj->getParentType() !=
"lm" &&
490 $this->pg_obj->getParentType() !=
"dbk")
492 $ilErr->raiseError(
"Split method called for wrong parent type (".
493 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
503 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
504 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
508 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
516 if(is_array($this->updated))
518 $error_str =
"<b>Validation Error(s):</b><br>";
519 foreach ($this->updated as $error)
521 $err_mess = implode($error,
" - ");
522 if (!is_int(strpos($err_mess,
":0:")))
524 $error_str .= htmlentities($err_mess).
"<br />";
527 $this->tpl->setVariable(
"MESSAGE", $error_str);
529 else if($this->updated !=
"" && $this->updated !==
true)
531 $this->tpl->setVariable(
"MESSAGE",
"<b>Validation Error(s):</b><br />".
532 $this->updated.
"<br />");
541 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
549 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
557 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
568 if ($obj->isEnabled ())
573 $updated = $this->pg_obj->update($this->hier_id);
583 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
595 $updated = $this->pg_obj->cutContents(array($this->hier_id.
":".$this->pc_id));
606 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
619 $this->pg_obj->copyContents(array($this->hier_id.
":".$this->pc_id));
621 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
632 if (is_object($style))
634 $ts = $style->getTemplates($a_type);
638 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];