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"
46 $this->pg_obj =& $a_pg_obj;
49 $this->content_obj =& $a_content_obj;
52 $this->hier_id = $a_hier_id;
53 $this->pc_id = $a_pc_id;
55 $this->dom =& $a_pg_obj->getDom();
75 $this->styleid = $a_styleid;
85 return $this->styleid;
93 if ((!is_object($this->style) || $this->
getStyleId() != $this->style->getId()) && $this->
getStyleId() > 0)
97 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
113 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
116 if (!is_array($a_type))
118 $a_type = array($a_type);
120 foreach ($a_type as $at)
122 $chars = array_merge($chars, $style->getCharacteristics($at,
true));
124 $new_chars = array();
125 if (is_array($chars))
127 foreach ($chars as $char)
129 if ($this->chars[$char] !=
"")
131 $new_chars[$char] = $this->chars[$char];
135 $new_chars[$char] = $char;
149 $this->chars = $a_chars;
157 return $this->chars ? $this->chars : array();
185 $this->hier_id = $a_hier_id;
195 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
197 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
200 if ($this->pg_obj->getParentType() ==
"gdf" ||
201 $this->pg_obj->getParentType() ==
"lm" ||
202 $this->pg_obj->getParentType() ==
"dbk")
204 $btpl->setCurrentBlock(
"bb_ilink_button");
205 $btpl->setVariable(
"BB_LINK_ILINK",
206 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
207 $btpl->parseCurrentBlock();
208 $btpl->touchBlock(
"bb_kw_button");
209 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
211 if ($this->pg_obj->getParentType() ==
"wpg")
213 $btpl->setCurrentBlock(
"bb_wikilink_button");
214 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
215 $btpl->parseCurrentBlock();
217 $jsMathSetting =
new ilSetting(
"jsMath");
220 foreach (self::$common_bb_buttons as $c => $st)
224 if ($c !=
"tex" || $jsMathSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
226 $btpl->touchBlock(
"bb_".$c.
"_button");
227 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
236 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
239 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
240 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
241 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
243 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
253 $updated = $this->pg_obj->deleteContent($this->hier_id);
262 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
271 if(!isset(
$_POST[
"target"]))
273 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
277 if(count(
$_POST[
"target"]) > 1)
279 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
282 $a_hid = explode(
":",
$_POST[
"target"][0]);
286 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
288 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
292 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
293 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
295 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
299 $first_hier_character = substr($a_hid[0], 0, 1);
300 if ($first_hier_character ==
"c" ||
301 $first_hier_character ==
"r" ||
302 $first_hier_character ==
"i")
304 $a_hid[0] = substr($a_hid[0], 1);
308 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
309 $this->content_obj->getPcId(), $a_hid[1]);
319 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
328 if(!isset(
$_POST[
"target"]))
330 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
334 if(count(
$_POST[
"target"]) > 1)
336 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
339 $a_hid = explode(
":",
$_POST[
"target"][0]);
342 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
344 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
348 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
349 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
351 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
355 $first_hier_character = substr($a_hid[0], 0, 1);
356 if ($first_hier_character ==
"c" ||
357 $first_hier_character ==
"r" ||
358 $first_hier_character ==
"i")
360 $a_hid[0] = substr($a_hid[0], 1);
364 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
365 $this->content_obj->getPcId(), $a_hid[1]);
374 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
385 if ($this->pg_obj->getParentType() !=
"lm" &&
386 $this->pg_obj->getParentType() !=
"dbk")
388 $ilErr->raiseError(
"Split method called for wrong parent type (".
389 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
397 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
398 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
401 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
411 if ($this->pg_obj->getParentType() !=
"lm" &&
412 $this->pg_obj->getParentType() !=
"dbk")
414 $ilErr->raiseError(
"Split method called for wrong parent type (".
415 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
425 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
426 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
430 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
438 if(is_array($this->updated))
440 $error_str =
"<b>Validation Error(s):</b><br>";
441 foreach ($this->updated as
$error)
443 $err_mess = implode($error,
" - ");
444 if (!is_int(strpos($err_mess,
":0:")))
446 $error_str .= htmlentities($err_mess).
"<br />";
449 $this->tpl->setVariable(
"MESSAGE", $error_str);
451 else if($this->updated !=
"" && $this->updated !==
true)
453 $this->tpl->setVariable(
"MESSAGE",
"<b>Validation Error(s):</b><br />".
454 $this->updated.
"<br />");
463 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
471 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
483 if ($obj->isEnabled ())
488 $updated = $this->pg_obj->update($this->hier_id);
498 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
508 if (is_object($style))
510 $ts = $style->getTemplates($a_type);
514 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];