4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
34 static $style_selector_reset =
"margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;";
38 "str" =>
"Strong",
"emp" =>
"Emph",
"imp" =>
"Important",
39 "sup" =>
"Sup",
"sub" =>
"Sub",
41 "quot" =>
"Quotation",
"acc" =>
"Accent",
"code" =>
"Code",
"tex" =>
"Tex",
42 "fn" =>
"Footnote",
"xln" =>
"ExternalLink" 58 $this->pg_obj = $a_pg_obj;
60 $this->content_obj = $a_content_obj;
64 $this->hier_id = $a_hier_id;
65 $this->pc_id = $a_pc_id;
67 $this->dom = $a_pg_obj->getDom();
78 $this->content_obj = $a_val;
98 $this->pg_obj = $a_val;
118 $this->page_config = $a_val;
136 return self::$common_bb_buttons;
147 $this->styleid = $a_styleid;
157 return $this->styleid;
169 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
185 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
188 if (!is_array($a_type))
190 $a_type = array($a_type);
192 foreach ($a_type as $at)
194 $chars = array_merge($chars,
$style->getCharacteristics($at,
true));
196 $new_chars = array();
197 if (is_array($chars))
199 foreach ($chars as $char)
201 if ($this->chars[$char] !=
"")
203 $new_chars[$char] = $this->chars[$char];
207 $new_chars[$char] = $char;
221 $this->chars = $a_chars;
229 return $this->chars ? $this->chars : array();
247 $this->hier_id = $a_hier_id;
257 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
259 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
267 $btpl->setCurrentBlock(
"bb_ilink_button");
268 $btpl->setVariable(
"BB_LINK_ILINK",
269 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
270 $btpl->parseCurrentBlock();
273 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
274 $btpl->setCurrentBlock(
"int_link_prep");
276 $ilCtrl->getLinkTargetByClass(array(
"ilpageeditorgui",
"ilinternallinkgui"),
277 "",
false,
true,
false),
true));
278 $btpl->parseCurrentBlock();
284 $btpl->touchBlock(
"bb_kw_button");
285 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
287 if ($this->pg_obj->getParentType() ==
"wpg")
289 $btpl->setCurrentBlock(
"bb_wikilink_button2");
290 $btpl->setVariable(
"TXT_WIKI_BUTTON2", $lng->txt(
"obj_wiki"));
291 $btpl->setVariable(
"WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
""));
292 $btpl->parseCurrentBlock();
294 $btpl->setCurrentBlock(
"bb_wikilink_button");
295 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
296 $btpl->parseCurrentBlock();
301 foreach (self::$common_bb_buttons as $c => $st)
305 if ($c !=
"tex" ||
$mathJaxSetting->get(
"enable") || defined(
"URL_TO_LATEX"))
307 $btpl->touchBlock(
"bb_".$c.
"_button");
308 $btpl->setVariable(
"TXT_".strtoupper($c), $this->lng->txt(
"cont_text_".$c));
315 $btpl->touchBlock(
"bb_anc_button");
316 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
323 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
326 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
327 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
329 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
339 $updated = $this->pg_obj->deleteContent($this->hier_id);
340 if($updated !==
true)
348 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
357 if(!isset(
$_POST[
"target"]))
359 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
363 if(count(
$_POST[
"target"]) > 1)
365 $this->
ilias->raiseError($this->lng->txt(
"only_one_target"),$this->
ilias->error_obj->MESSAGE);
368 $a_hid = explode(
":",
$_POST[
"target"][0]);
372 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
374 $this->
ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->
ilias->error_obj->MESSAGE);
378 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
379 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
381 $this->
ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->
ilias->error_obj->MESSAGE);
385 $first_hier_character = substr($a_hid[0], 0, 1);
386 if ($first_hier_character ==
"c" ||
387 $first_hier_character ==
"r" ||
388 $first_hier_character ==
"i")
390 $a_hid[0] = substr($a_hid[0], 1);
394 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
395 $this->content_obj->getPcId(), $a_hid[1]);
396 if($updated !==
true)
405 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
414 if(!isset(
$_POST[
"target"]))
416 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
420 if(count(
$_POST[
"target"]) > 1)
422 $this->
ilias->raiseError($this->lng->txt(
"only_one_target"),$this->
ilias->error_obj->MESSAGE);
425 $a_hid = explode(
":",
$_POST[
"target"][0]);
428 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
430 $this->
ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->
ilias->error_obj->MESSAGE);
434 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
435 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
437 $this->
ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->
ilias->error_obj->MESSAGE);
441 $first_hier_character = substr($a_hid[0], 0, 1);
442 if ($first_hier_character ==
"c" ||
443 $first_hier_character ==
"r" ||
444 $first_hier_character ==
"i")
446 $a_hid[0] = substr($a_hid[0], 1);
450 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
451 $this->content_obj->getPcId(), $a_hid[1]);
452 if($updated !==
true)
460 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
471 if ($this->pg_obj->getParentType() !=
"lm" &&
472 $this->pg_obj->getParentType() !=
"dbk")
474 $ilErr->raiseError(
"Split method called for wrong parent type (".
475 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
483 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
484 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
487 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
497 if ($this->pg_obj->getParentType() !=
"lm" &&
498 $this->pg_obj->getParentType() !=
"dbk")
500 $ilErr->raiseError(
"Split method called for wrong parent type (".
501 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
511 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
512 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
516 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
524 if(is_array($this->updated))
526 $error_str =
"<b>Error(s):</b><br>";
527 foreach ($this->updated as $error)
529 $err_mess = implode($error,
" - ");
530 if (!is_int(strpos($err_mess,
":0:")))
532 $error_str .= htmlentities($err_mess).
"<br />";
537 else if($this->updated !=
"" && $this->updated !==
true)
549 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
557 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
565 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
576 if ($obj->isEnabled ())
581 $updated = $this->pg_obj->update($this->hier_id);
582 if($updated !==
true)
591 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
603 $updated = $this->pg_obj->cutContents(array($this->hier_id.
":".$this->pc_id));
604 if($updated !==
true)
614 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
627 $this->pg_obj->copyContents(array($this->hier_id.
":".$this->pc_id));
629 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
642 $ts =
$style->getTemplates($a_type);
646 $options[
"t:".$t[
"id"].
":".$t[
"name"]] = $t[
"name"];
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setContentObject($a_val)
Set content object.
ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
Constructor public.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
deactivate()
gui function set enabled if is not enabled and vice versa
splitPage()
split page to new page at specified position
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
getStyle()
Get style object.
getHierId()
get hierarchical id in dom object
setPageConfig($a_val)
Set Page Config.
getTemplateOptions($a_type)
Get table templates.
getPageConfig()
Get Page Config.
cancelCreate()
cancel creating page content
cancelUpdate()
cancel update
splitPageNext()
split page to next page at specified position
getContentObject()
Get content object.
_splitPageNext($a_page_id, $a_pg_parent_type, $a_hier_id)
split page to next page at hierarchical id
setCharacteristics($a_chars)
Set Characteristics.
getBBMenu($a_ta_name="par_content")
Get the bb menu incl.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
if(!is_array($argv)) $options
moveAfter()
move content element after another element
special template class to simplify handling of ITX/PEAR
static $style_selector_reset
displayValidationError()
display validation errors
getStyleId()
Get Style Id.
moveBefore()
move content element before another element
redirection script todo: (a better solution should control the processing via a xml file) ...
getCharacteristics()
Get characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupSettingByParentType($a_par_type, $a_name, $a_default=false)
Lookup setting by parent type.
static _getCommonBBButtons()
Get common bb buttons.
static getLogger($a_component_id)
Get component logger.
setStyleId($a_styleid)
Set Style Id.
copy()
Copy single element.
getInitHTML($a_url, $a_move_to_body=false)
Get initialisation HTML to use interna link editing.
_splitPage($a_page_id, $a_pg_parent_type, $a_hier_id)
split page at hierarchical id
setHierId($a_hier_id)
get hierarchical id in dom object
static $common_bb_buttons