4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
29 static $style_selector_reset =
"margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;";
33 "str" =>
"Strong",
"emp" =>
"Emph",
"imp" =>
"Important",
"com" =>
"Comment",
34 "quot" =>
"Quotation",
"acc" =>
"Accent",
"code" =>
"Code",
"tex" =>
"Tex",
35 "fn" =>
"Footnote",
"xln" =>
"ExternalLink"
48 $this->pg_obj = $a_pg_obj;
50 $this->content_obj = $a_content_obj;
54 $this->hier_id = $a_hier_id;
55 $this->pc_id = $a_pc_id;
57 $this->dom = $a_pg_obj->getDom();
68 $this->content_obj = $a_val;
88 $this->pg_obj = $a_val;
108 $this->page_config = $a_val;
137 $this->styleid = $a_styleid;
147 return $this->styleid;
155 if ((!is_object($this->style) || $this->
getStyleId() != $this->style->getId()) && $this->
getStyleId() > 0)
159 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
175 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
178 if (!is_array($a_type))
180 $a_type = array($a_type);
182 foreach ($a_type as $at)
184 $chars = array_merge($chars, $style->getCharacteristics($at,
true));
186 $new_chars = array();
187 if (is_array($chars))
189 foreach ($chars as $char)
191 if ($this->chars[$char] !=
"")
193 $new_chars[$char] = $this->chars[$char];
197 $new_chars[$char] = $char;
211 $this->chars = $a_chars;
219 return $this->chars ? $this->chars : array();
237 $this->hier_id = $a_hier_id;
247 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
249 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
257 $btpl->setCurrentBlock(
"bb_ilink_button");
258 $btpl->setVariable(
"BB_LINK_ILINK",
259 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
260 $btpl->parseCurrentBlock();
263 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
264 $btpl->setCurrentBlock(
"int_link_prep");
266 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
267 "",
false,
true,
false),
true));
268 $btpl->parseCurrentBlock();
274 $btpl->touchBlock(
"bb_kw_button");
275 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
277 if ($this->pg_obj->getParentType() ==
"wpg")
279 $btpl->setCurrentBlock(
"bb_wikilink_button2");
280 $btpl->setVariable(
"TXT_WIKI_BUTTON2", $lng->txt(
"obj_wiki"));
281 $btpl->setVariable(
"WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
""));
282 $btpl->parseCurrentBlock();
284 $btpl->setCurrentBlock(
"bb_wikilink_button");
285 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
286 $btpl->parseCurrentBlock();
291 foreach (self::$common_bb_buttons as $c => $st)
295 if ($c !=
"tex" ||
$mathJaxSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
297 $btpl->touchBlock(
"bb_".$c.
"_button");
298 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
305 $btpl->touchBlock(
"bb_anc_button");
306 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
313 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
316 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
317 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
319 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
329 $updated = $this->pg_obj->deleteContent($this->hier_id);
338 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
347 if(!isset(
$_POST[
"target"]))
349 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
353 if(count(
$_POST[
"target"]) > 1)
355 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
358 $a_hid = explode(
":",
$_POST[
"target"][0]);
362 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
364 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
368 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
369 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
371 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
375 $first_hier_character = substr($a_hid[0], 0, 1);
376 if ($first_hier_character ==
"c" ||
377 $first_hier_character ==
"r" ||
378 $first_hier_character ==
"i")
380 $a_hid[0] = substr($a_hid[0], 1);
384 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
385 $this->content_obj->getPcId(), $a_hid[1]);
395 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
404 if(!isset(
$_POST[
"target"]))
406 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
410 if(count(
$_POST[
"target"]) > 1)
412 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
415 $a_hid = explode(
":",
$_POST[
"target"][0]);
418 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
420 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
424 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
425 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
427 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
431 $first_hier_character = substr($a_hid[0], 0, 1);
432 if ($first_hier_character ==
"c" ||
433 $first_hier_character ==
"r" ||
434 $first_hier_character ==
"i")
436 $a_hid[0] = substr($a_hid[0], 1);
440 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
441 $this->content_obj->getPcId(), $a_hid[1]);
450 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
461 if ($this->pg_obj->getParentType() !=
"lm" &&
462 $this->pg_obj->getParentType() !=
"dbk")
464 $ilErr->raiseError(
"Split method called for wrong parent type (".
465 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
473 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
474 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
477 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
487 if ($this->pg_obj->getParentType() !=
"lm" &&
488 $this->pg_obj->getParentType() !=
"dbk")
490 $ilErr->raiseError(
"Split method called for wrong parent type (".
491 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
501 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
502 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
506 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
514 if(is_array($this->updated))
516 $error_str =
"<b>Error(s):</b><br>";
517 foreach ($this->updated as $error)
519 $err_mess = implode($error,
" - ");
520 if (!is_int(strpos($err_mess,
":0:")))
522 $error_str .= htmlentities($err_mess).
"<br />";
527 else if($this->updated !=
"" && $this->updated !==
true)
539 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
547 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
555 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
566 if ($obj->isEnabled ())
571 $updated = $this->pg_obj->update($this->hier_id);
581 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
593 $updated = $this->pg_obj->cutContents(array($this->hier_id.
":".$this->pc_id));
604 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
617 $this->pg_obj->copyContents(array($this->hier_id.
":".$this->pc_id));
619 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
630 if (is_object($style))
632 $ts = $style->getTemplates($a_type);
636 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];