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 $jsMathSetting =
new ilSetting(
"jsMath");
278 foreach (self::$common_bb_buttons as $c => $st)
282 if ($c !=
"tex" || $jsMathSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
284 $btpl->touchBlock(
"bb_".$c.
"_button");
285 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
292 $btpl->touchBlock(
"bb_anc_button");
293 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
300 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
303 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
304 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
306 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
316 $updated = $this->pg_obj->deleteContent($this->hier_id);
325 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
334 if(!isset(
$_POST[
"target"]))
336 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
340 if(count(
$_POST[
"target"]) > 1)
342 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
345 $a_hid = explode(
":",
$_POST[
"target"][0]);
349 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
351 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
355 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
356 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
358 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
362 $first_hier_character = substr($a_hid[0], 0, 1);
363 if ($first_hier_character ==
"c" ||
364 $first_hier_character ==
"r" ||
365 $first_hier_character ==
"i")
367 $a_hid[0] = substr($a_hid[0], 1);
371 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
372 $this->content_obj->getPcId(), $a_hid[1]);
382 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
391 if(!isset(
$_POST[
"target"]))
393 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
397 if(count(
$_POST[
"target"]) > 1)
399 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
402 $a_hid = explode(
":",
$_POST[
"target"][0]);
405 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
407 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
411 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
412 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
414 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
418 $first_hier_character = substr($a_hid[0], 0, 1);
419 if ($first_hier_character ==
"c" ||
420 $first_hier_character ==
"r" ||
421 $first_hier_character ==
"i")
423 $a_hid[0] = substr($a_hid[0], 1);
427 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
428 $this->content_obj->getPcId(), $a_hid[1]);
437 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
448 if ($this->pg_obj->getParentType() !=
"lm" &&
449 $this->pg_obj->getParentType() !=
"dbk")
451 $ilErr->raiseError(
"Split method called for wrong parent type (".
452 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
460 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
461 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
464 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
474 if ($this->pg_obj->getParentType() !=
"lm" &&
475 $this->pg_obj->getParentType() !=
"dbk")
477 $ilErr->raiseError(
"Split method called for wrong parent type (".
478 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
488 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
489 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
493 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
501 if(is_array($this->updated))
503 $error_str =
"<b>Validation Error(s):</b><br>";
504 foreach ($this->updated as
$error)
506 $err_mess = implode($error,
" - ");
507 if (!is_int(strpos($err_mess,
":0:")))
509 $error_str .= htmlentities($err_mess).
"<br />";
512 $this->tpl->setVariable(
"MESSAGE", $error_str);
514 else if($this->updated !=
"" && $this->updated !==
true)
516 $this->tpl->setVariable(
"MESSAGE",
"<b>Validation Error(s):</b><br />".
517 $this->updated.
"<br />");
526 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
534 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
546 if ($obj->isEnabled ())
551 $updated = $this->pg_obj->update($this->hier_id);
561 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
571 if (is_object($style))
573 $ts = $style->getTemplates($a_type);
577 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];