24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
59 $this->pg_obj =& $a_pg_obj;
62 $this->content_obj =& $a_content_obj;
65 $this->hier_id = $a_hier_id;
66 $this->pc_id = $a_pc_id;
68 $this->dom =& $a_pg_obj->getDom();
106 $this->hier_id = $a_hier_id;
116 $btpl =
new ilTemplate(
"tpl.bb_menu.html",
true,
true,
"Services/COPage");
119 if ($this->pg_obj->getParentType() ==
"gdf" ||
120 $this->pg_obj->getParentType() ==
"lm" ||
121 $this->pg_obj->getParentType() ==
"dbk")
123 $btpl->setCurrentBlock(
"bb_ilink_button");
124 $btpl->setVariable(
"BB_LINK_ILINK",
125 $this->ctrl->getLinkTargetByClass(
"ilInternalLinkGUI",
"showLinkHelp"));
126 $btpl->parseCurrentBlock();
128 if ($this->pg_obj->getParentType() ==
"wpg")
130 $btpl->setCurrentBlock(
"bb_wikilink_button");
131 $btpl->setVariable(
"TXT_WLN2", $lng->txt(
"wiki_wiki_page"));
132 $btpl->parseCurrentBlock();
135 $btpl->setVariable(
"TXT_STR", $this->lng->txt(
"cont_text_str"));
136 $btpl->setVariable(
"TXT_EMP", $this->lng->txt(
"cont_text_emp"));
137 $btpl->setVariable(
"TXT_COM", $this->lng->txt(
"cont_text_com"));
138 $btpl->setVariable(
"TXT_FN", $this->lng->txt(
"cont_text_fn"));
139 $btpl->setVariable(
"TXT_QUOT", $this->lng->txt(
"cont_text_quot"));
140 $btpl->setVariable(
"TXT_CODE", $this->lng->txt(
"cont_text_code"));
141 $btpl->setVariable(
"TXT_ILN", $this->lng->txt(
"cont_text_iln"));
142 $btpl->setVariable(
"TXT_XLN", $this->lng->txt(
"cont_text_xln"));
143 $btpl->setVariable(
"TXT_TEX", $this->lng->txt(
"cont_text_tex"));
144 $btpl->setVariable(
"TXT_BB_TIP", $this->lng->txt(
"cont_bb_tip"));
145 $btpl->setVariable(
"TXT_WLN", $lng->txt(
"wiki_wiki_page"));
147 $btpl->setVariable(
"PAR_TA_NAME",
"par_content");
157 $updated = $this->pg_obj->deleteContent($this->hier_id);
166 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
175 if(!isset($_POST[
"target"]))
177 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
181 if(count($_POST[
"target"]) > 1)
183 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
186 $a_hid = explode(
":", $_POST[
"target"][0]);
190 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
192 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
196 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
197 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
199 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
203 $first_hier_character = substr($a_hid[0], 0, 1);
204 if ($first_hier_character ==
"c" ||
205 $first_hier_character ==
"r" ||
206 $first_hier_character ==
"i")
208 $a_hid[0] = substr($a_hid[0], 1);
212 $updated = $this->pg_obj->moveContentAfter($this->hier_id, $a_hid[0],
213 $this->content_obj->getPcId(), $a_hid[1]);
223 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
232 if(!isset($_POST[
"target"]))
234 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
238 if(count($_POST[
"target"]) > 1)
240 $this->ilias->raiseError($this->lng->txt(
"only_one_target"),$this->ilias->error_obj->MESSAGE);
243 $a_hid = explode(
":", $_POST[
"target"][0]);
246 if($this->hier_id == substr($a_hid[0], 0, strlen($this->hier_id)))
248 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
252 $curr_node =& $this->pg_obj->getContentNode($a_hid[0], $a_hid[1]);
253 if (is_object($curr_node) && $curr_node->node_name() ==
"FileItem")
255 $this->ilias->raiseError($this->lng->txt(
"cont_operation_not_allowed"),$this->ilias->error_obj->MESSAGE);
259 $first_hier_character = substr($a_hid[0], 0, 1);
260 if ($first_hier_character ==
"c" ||
261 $first_hier_character ==
"r" ||
262 $first_hier_character ==
"i")
264 $a_hid[0] = substr($a_hid[0], 1);
268 $updated = $this->pg_obj->moveContentBefore($this->hier_id, $a_hid[0],
269 $this->content_obj->getPcId(), $a_hid[1]);
278 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
289 if ($this->pg_obj->getParentType() !=
"lm" &&
290 $this->pg_obj->getParentType() !=
"dbk")
292 $ilErr->raiseError(
"Split method called for wrong parent type (".
293 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
301 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $lm_page->getId());
302 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
305 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
315 if ($this->pg_obj->getParentType() !=
"lm" &&
316 $this->pg_obj->getParentType() !=
"dbk")
318 $ilErr->raiseError(
"Split method called for wrong parent type (".
319 $this->pg_obj->getParentType().
")", $ilErr->FATAL);
329 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $succ_id);
330 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
334 $this->ctrl->returnToParent($this,
"jump".($this->hier_id - 1));
342 if(is_array($this->updated))
344 $error_str =
"<b>Validation Error(s):</b><br>";
345 foreach ($this->updated as $error)
347 $err_mess = implode($error,
" - ");
348 if (!is_int(strpos($err_mess,
":0:")))
350 $error_str .= htmlentities($err_mess).
"<br />";
353 $this->tpl->setVariable(
"MESSAGE", $error_str);
355 else if($this->updated !=
"" && $this->updated !==
true)
357 $this->tpl->setVariable(
"MESSAGE",
"<b>Validation Error(s):</b><br />".
358 $this->updated.
"<br />");
367 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
375 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
387 if ($obj->isEnabled ())
392 $updated = $this->pg_obj->update($this->hier_id);
402 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);