4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
38 static $style_selector_reset =
"margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;";
42 "str" =>
"Strong",
"emp" =>
"Emph",
"imp" =>
"Important",
43 "sup" =>
"Sup",
"sub" =>
"Sub",
45 "quot" =>
"Quotation",
"acc" =>
"Accent",
"code" =>
"Code",
"tex" =>
"Tex",
46 "fn" =>
"Footnote",
"xln" =>
"ExternalLink" 53 function __construct($a_pg_obj, $a_content_obj, $a_hier_id = 0, $a_pc_id =
"")
62 $this->pg_obj = $a_pg_obj;
64 $this->content_obj = $a_content_obj;
68 $this->hier_id = $a_hier_id;
69 $this->pc_id = $a_pc_id;
71 $this->dom = $a_pg_obj->getDom();
82 $this->content_obj = $a_val;
102 $this->pg_obj = $a_val;
122 $this->page_config = $a_val;
140 return self::$common_bb_buttons;
151 $this->styleid = $a_styleid;
161 return $this->styleid;
173 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
189 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
198 $chars = array_merge($chars,
$style->getCharacteristics($at,
true));
200 $new_chars =
array();
201 if (is_array($chars))
203 foreach ($chars as $char)
205 if ($this->chars[$char] !=
"")
207 $new_chars[$char] = $this->chars[$char];
211 $new_chars[$char] = $char;
225 $this->chars = $a_chars;
233 return $this->chars ? $this->chars :
array();
251 $this->hier_id = $a_hier_id;
261 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
263 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
268 $btpl->setCurrentBlock(
"bb_ilink_button");
269 $btpl->setVariable(
"BB_LINK_ILINK",
270 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
271 $btpl->parseCurrentBlock();
274 include_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
275 $btpl->setCurrentBlock(
"int_link_prep");
277 $ilCtrl->getLinkTargetByClass(
array(
"ilpageeditorgui",
"ilinternallinkgui"),
278 "",
false,
true,
false),
true));
279 $btpl->parseCurrentBlock();
285 $btpl->touchBlock(
"bb_kw_button");
286 $btpl->setVariable(
"TXT_KW", $this->lng->txt(
"cont_text_keyword"));
288 if ($this->pg_obj->getParentType() ==
"wpg")
290 $btpl->setCurrentBlock(
"bb_wikilink_button2");
291 $btpl->setVariable(
"TXT_WIKI_BUTTON2", $lng->txt(
"obj_wiki"));
292 $btpl->setVariable(
"WIKI_BUTTON2_URL", $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
""));
293 $btpl->parseCurrentBlock();
295 $btpl->setCurrentBlock(
"bb_wikilink_button");
296 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
297 $btpl->parseCurrentBlock();
302 foreach (self::$common_bb_buttons as $c => $st)
308 if (!in_array($c,
array(
"acc",
"com",
"quot",
"code")))
310 $btpl->touchBlock(
"bb_" . $c .
"_button");
311 $btpl->setVariable(
"TXT_" . strtoupper($c), $this->lng->txt(
"cont_text_" . $c));
312 $lng->toJS(
"cont_text_" . $c);
320 $btpl->touchBlock(
"bb_anc_button");
321 $btpl->setVariable(
"TXT_ANC", $lng->txt(
"cont_anchor").
":");
322 $lng->toJS(
"cont_anchor");
325 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
332 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
333 $lng->toJS(
"cont_text_iln");
336 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
337 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
338 $lng->toJS(
"wiki_wiki_page");
340 $btpl->setVariable(
"PAR_TA_NAME", $a_ta_name);
350 $updated = $this->pg_obj->deleteContent($this->hier_id);
351 if($updated !==
true)
359 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
368 if(!isset(
$_POST[
"target"]))
370 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
374 if(count(
$_POST[
"target"]) > 1)
376 $this->
ilias->raiseError($this->lng->txt(
"only_one_target"),$this->
ilias->error_obj->MESSAGE);
379 $a_hid = explode(
":",
$_POST[
"target"][0]);
383 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
385 $this->
ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->
ilias->error_obj->MESSAGE);
389 $curr_node = $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
390 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
392 $this->
ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->
ilias->error_obj->MESSAGE);
396 $first_hier_character = substr($a_hid[0], 0, 1);
397 if ($first_hier_character ==
"c" ||
398 $first_hier_character ==
"r" ||
399 $first_hier_character ==
"i")
401 $a_hid[0] = substr($a_hid[0], 1);
405 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
406 $this->content_obj->getPcId(), $a_hid[1]);
407 if($updated !==
true)
416 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
425 if(!isset(
$_POST[
"target"]))
427 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
431 if(count(
$_POST[
"target"]) > 1)
433 $this->
ilias->raiseError($this->lng->txt(
"only_one_target"),$this->
ilias->error_obj->MESSAGE);
436 $a_hid = explode(
":",
$_POST[
"target"][0]);
439 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
441 $this->
ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->
ilias->error_obj->MESSAGE);
445 $curr_node = $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
446 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
448 $this->
ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->
ilias->error_obj->MESSAGE);
452 $first_hier_character = substr($a_hid[0], 0, 1);
453 if ($first_hier_character ==
"c" ||
454 $first_hier_character ==
"r" ||
455 $first_hier_character ==
"i")
457 $a_hid[0] = substr($a_hid[0], 1);
461 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
462 $this->content_obj->getPcId(), $a_hid[1]);
463 if($updated !==
true)
471 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
482 if ($this->pg_obj->getParentType() !=
"lm")
484 $ilErr->raiseError(
"Split method called for wrong parent type (".
485 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
493 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
494 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
497 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
507 if ($this->pg_obj->getParentType() !=
"lm")
509 $ilErr->raiseError(
"Split method called for wrong parent type (".
510 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
520 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
521 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
525 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
533 if(is_array($this->updated))
535 $error_str =
"<b>Error(s):</b><br>";
536 foreach ($this->updated as
$error)
538 $err_mess = implode($error,
" - ");
539 if (!is_int(strpos($err_mess,
":0:")))
541 $error_str .= htmlentities($err_mess).
"<br />";
546 else if($this->updated !=
"" && $this->updated !==
true)
558 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
566 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
574 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
585 if ($obj->isEnabled ())
590 $updated = $this->pg_obj->update($this->hier_id);
591 if($updated !==
true)
600 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
612 $updated = $this->pg_obj->cutContents(
array($this->hier_id.
":".$this->pc_id));
613 if($updated !==
true)
623 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
636 $this->pg_obj->copyContents(
array($this->hier_id.
":".$this->pc_id));
638 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
655 $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.
__construct($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
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
splitPage()
split page to new page at specified position
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
static _splitPage($a_page_id, $a_pg_parent_type, $a_hier_id)
split page at hierarchical id
getContentObject()
Get content object.
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
static getCharStyleSelector($a_par_type, $a_use_callback=true, $a_style_id=0)
Get character style selector.
static _splitPageNext($a_page_id, $a_pg_parent_type, $a_hier_id)
split page to next page at hierarchical id
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) ...
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
getCharacteristics()
Get characteristics.
Create styles array
The data for the language used.
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.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
copy()
Copy single element.
setHierId($a_hier_id)
get hierarchical id in dom object
static $common_bb_buttons