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();
272 $btpl->touchBlock(
"bb_kw_button");
273 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
275 if ($this->pg_obj->getParentType() ==
"wpg")
277 $btpl->setCurrentBlock(
"bb_wikilink_button");
278 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
279 $btpl->parseCurrentBlock();
281 $jsMathSetting =
new ilSetting(
"jsMath");
284 foreach (self::$common_bb_buttons as $c => $st)
288 if ($c !=
"tex" || $jsMathSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
290 $btpl->touchBlock(
"bb_".$c.
"_button");
291 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
298 $btpl->touchBlock(
"bb_anc_button");
299 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
306 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
309 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
310 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
312 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
322 $updated = $this->pg_obj->deleteContent($this->hier_id);
331 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
340 if(!isset(
$_POST[
"target"]))
342 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
346 if(count(
$_POST[
"target"]) > 1)
348 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
351 $a_hid = explode(
":",
$_POST[
"target"][0]);
355 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
357 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
361 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
362 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
364 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
368 $first_hier_character = substr($a_hid[0], 0, 1);
369 if ($first_hier_character ==
"c" ||
370 $first_hier_character ==
"r" ||
371 $first_hier_character ==
"i")
373 $a_hid[0] = substr($a_hid[0], 1);
377 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
378 $this->content_obj->getPcId(), $a_hid[1]);
388 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
397 if(!isset(
$_POST[
"target"]))
399 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
403 if(count(
$_POST[
"target"]) > 1)
405 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
408 $a_hid = explode(
":",
$_POST[
"target"][0]);
411 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
413 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
417 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
418 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
420 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
424 $first_hier_character = substr($a_hid[0], 0, 1);
425 if ($first_hier_character ==
"c" ||
426 $first_hier_character ==
"r" ||
427 $first_hier_character ==
"i")
429 $a_hid[0] = substr($a_hid[0], 1);
433 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
434 $this->content_obj->getPcId(), $a_hid[1]);
443 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
454 if ($this->pg_obj->getParentType() !=
"lm" &&
455 $this->pg_obj->getParentType() !=
"dbk")
457 $ilErr->raiseError(
"Split method called for wrong parent type (".
458 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
466 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
467 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
470 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
480 if ($this->pg_obj->getParentType() !=
"lm" &&
481 $this->pg_obj->getParentType() !=
"dbk")
483 $ilErr->raiseError(
"Split method called for wrong parent type (".
484 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
494 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
495 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
499 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
507 if(is_array($this->updated))
509 $error_str =
"<b>Validation Error(s):</b><br>";
510 foreach ($this->updated as $error)
512 $err_mess = implode($error,
" - ");
513 if (!is_int(strpos($err_mess,
":0:")))
515 $error_str .= htmlentities($err_mess).
"<br />";
518 $this->tpl->setVariable(
"MESSAGE", $error_str);
520 else if($this->updated !=
"" && $this->updated !==
true)
522 $this->tpl->setVariable(
"MESSAGE",
"<b>Validation Error(s):</b><br />".
523 $this->updated.
"<br />");
532 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
540 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
552 if ($obj->isEnabled ())
557 $updated = $this->pg_obj->update($this->hier_id);
567 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
577 if (is_object($style))
579 $ts = $style->getTemplates($a_type);
583 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];