4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
31 "str" =>
"Strong",
"emp" =>
"Emph",
"imp" =>
"Important",
"com" =>
"Comment",
32 "quot" =>
"Quotation",
"acc" =>
"Accent",
"code" =>
"Code",
"tex" =>
"Tex",
33 "fn" =>
"Footnote",
"xln" =>
"ExternalLink"
46 $this->pg_obj = $a_pg_obj;
48 $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();
66 $this->content_obj = $a_val;
86 $this->pg_obj = $a_val;
106 $this->page_config = $a_val;
135 $this->styleid = $a_styleid;
145 return $this->styleid;
153 if ((!is_object($this->style) || $this->
getStyleId() != $this->style->getId()) && $this->
getStyleId() > 0)
157 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
173 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
176 if (!is_array($a_type))
178 $a_type = array($a_type);
180 foreach ($a_type as $at)
182 $chars = array_merge($chars, $style->getCharacteristics($at,
true));
184 $new_chars = array();
185 if (is_array($chars))
187 foreach ($chars as $char)
189 if ($this->chars[$char] !=
"")
191 $new_chars[$char] = $this->chars[$char];
195 $new_chars[$char] = $char;
209 $this->chars = $a_chars;
217 return $this->chars ? $this->chars : array();
235 $this->hier_id = $a_hier_id;
245 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
247 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
255 $btpl->setCurrentBlock(
"bb_ilink_button");
256 $btpl->setVariable(
"BB_LINK_ILINK",
257 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
258 $btpl->parseCurrentBlock();
261 include_once(
"./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
262 $btpl->setCurrentBlock(
"int_link_prep");
264 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
265 "",
false,
true,
false),
true));
266 $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();
284 foreach (self::$common_bb_buttons as $c => $st)
288 if ($c !=
"tex" ||
$mathJaxSetting->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>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>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);
548 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
559 if ($obj->isEnabled ())
564 $updated = $this->pg_obj->update($this->hier_id);
574 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
586 $updated = $this->pg_obj->cutContents(array($this->hier_id.
":".$this->pc_id));
597 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
610 $this->pg_obj->copyContents(array($this->hier_id.
":".$this->pc_id));
612 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
623 if (is_object($style))
625 $ts = $style->getTemplates($a_type);
629 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];