4require_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;
 
  151                $this->styleid = $a_styleid;
 
  161                return $this->styleid;
 
  169                if ((!is_object($this->style) || $this->
getStyleId() != $this->style->getId()) && $this->getStyleId() > 0)
 
  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);
 
  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]);
 
  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]);
 
  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);
 
  490                                $this->pg_obj->getParentType(), $this->hier_id);
 
  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);
 
  515                                $this->pg_obj->getParentType(), $this->hier_id);
 
  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);
 
  600                $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);              
 
  612                $updated = $this->pg_obj->cutContents(array($this->hier_id.
":".$this->pc_id));
 
  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);              
 
if(strpos( $jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
An exception for terminatinating execution or to throw for unit testing.
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
static _splitPageNext($a_page_id, $a_pg_parent_type, $a_hier_id)
split page to next page at hierarchical id
static _splitPage($a_page_id, $a_pg_parent_type, $a_hier_id)
split page at hierarchical id
static getLogger($a_component_id)
Get component logger.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getCharStyleSelector($a_par_type, $a_use_callback=true, $a_style_id=0)
Get character style selector.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getHierId()
get hierarchical id in dom object
setPageConfig($a_val)
Set Page Config.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
deactivate()
gui function set enabled if is not enabled and vice versa
static $style_selector_reset
getPageConfig()
Get Page Config.
getTemplateOptions($a_type)
Get table templates.
displayValidationError()
display validation errors
static _getCommonBBButtons()
Get common bb buttons.
getCharacteristics()
Get characteristics.
cancelUpdate()
cancel update
moveAfter()
move content element after another element
splitPageNext()
split page to next page at specified position
setStyleId($a_styleid)
Set Style Id.
static $common_bb_buttons
splitPage()
split page to new page at specified position
getContentObject()
Get content object.
__construct($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
Constructor @access public.
moveBefore()
move content element before another element
setContentObject($a_val)
Set content object.
cancelCreate()
cancel creating page content
getStyle()
Get style object.
getBBMenu($a_ta_name="par_content")
Get the bb menu incl.
setCharacteristics($a_chars)
Set Characteristics.
copy()
Copy single element.
setHierId($a_hier_id)
get hierarchical id in dom object
getStyleId()
Get Style Id.
static lookupSettingByParentType($a_par_type, $a_name, $a_default=false)
Lookup setting by parent type.
special template class to simplify handling of ITX/PEAR
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file)
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
if(!is_array($argv)) $options