24 require_once(
"./Services/COPage/classes/class.ilPCPlaceHolder.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
55 $this->pg_obj = $a_pg_obj;
56 $this->content_obj = $a_content_obj;
57 $this->hier_id = $a_hier_id;
58 $this->pc_id = $a_pc_id;
72 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
78 case 'ilpcmediaobjectgui':
79 include_once(
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
80 $media_gui =
new ilPCMediaObjectGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
81 $ret = $ilCtrl->forwardCommand($media_gui);
99 $this->
propertyGUI(
"create",
"Text",
"100px",
"insert");
108 if (
$_POST[
"plach_height"]==
"" || !preg_match(
"/[0-9]+/",
$_POST[
"plach_height"])) {
114 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
115 $this->content_obj->setHeight(
$_POST[
"plach_height"].
"px");
116 $this->content_obj->setContentClass(
$_POST[
'plach_type']);
117 $this->updated = $this->pg_obj->update();
118 if ($this->updated ===
true)
120 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
134 if ($this->pg_obj->getLayoutMode() ==
true) {
148 $this->styleid = $a_styleid;
167 $this->
propertyGUI(
"saveProperties",$this->content_obj->getContentClass(),$this->content_obj->getHeight(),
"save");
174 switch ($this->content_obj->getContentClass()) {
176 include_once(
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
177 $ilCtrl->setCmdClass(
"ilpcmediaobjectgui");
178 $ilCtrl->setCmd(
"insert");
180 $ret = $ilCtrl->forwardCommand($media_gui);
187 include_once(
"./Services/COPage/classes/class.ilPCQuestionGUI.php");
188 $ilCtrl->setCmdClass(
"ilpcquestiongui");
189 $ilCtrl->setCmd(
"insert");
190 $question_gui =
new ilPCQuestionGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
191 $question_gui -> setSelfAssessmentMode(
true);
192 $ret = $ilCtrl->forwardCommand($question_gui);
206 if (
$_POST[
"plach_height"]==
"" || !preg_match(
"/[0-9]+/",
$_POST[
"plach_height"])) {
211 $this->content_obj->setContentClass(
$_POST[
'plach_type']);
212 $this->content_obj->setHeight(
$_POST[
"plach_height"].
"px");
214 $this->updated = $this->pg_obj->update();
215 if ($this->updated ===
true)
217 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
221 $this->pg_obj->addHierIDs();
229 private function propertyGUI($a_action,$a_type,$a_height,$a_mode) {
232 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
234 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
235 $this->form_gui->setTitle($lng->txt(
"cont_ed_plachprop"));
237 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
239 $options =array(
"Text"=>$lng->txt(
"cont_ed_plachtext"),
"Media"=>$lng->txt(
"cont_ed_plachmedia"),
240 "Question"=>$lng->txt(
"cont_ed_plachquestion"));
242 $ttype_input->setValue($a_type);
243 $ttype_input->setRequired(
true);
244 $theight_input =
new ilTextInputGUI($lng->txt(
"height"),
"plach_height");
246 $theight_input->setMaxLength(3);
248 $a_height = preg_replace(
"/px/",
"",$a_height);
249 $theight_input->setValue($a_height);
250 $theight_input->setTitle($lng->txt(
"height").
" (px)");
251 $theight_input->setRequired(
true);
253 $this->form_gui->addItem($ttype_input);
254 $this->form_gui->addItem($theight_input);
256 $this->form_gui->addCommandButton($a_action, $lng->txt($a_mode));
257 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
258 $this->tpl->setContent($this->form_gui->getHTML());
269 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
271 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
272 $this->form_gui->setTitle($lng->txt(
"cont_ed_select_pctext"));
276 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
278 $options = array($lng->txt(
"cont_ed_par"),$lng->txt(
"cont_ed_dtable"),
279 $lng->txt(
"cont_ed_atable"),$lng->txt(
"cont_ed_list"),$lng->txt(
"cont_ed_flist"));
281 $this->form_gui->addItem($ttype_input);
283 $this->form_gui->addCommandButton(
"insertPCText", $lng->txt(
"insert"));
284 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
285 $this->tpl->setContent($this->form_gui->getHTML());
295 switch (
$_POST[
'pctext_type']) {
298 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
299 $ilCtrl->setCmdClass(
"ilpcparagraphgui");
300 $ilCtrl->setCmd(
"insert");
301 $paragraph_gui =
new ilPCParagraphGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
302 $paragraph_gui->setStyleId($this->
getStyleId());
306 $ret = $ilCtrl->forwardCommand($paragraph_gui);
310 include_once(
"./Services/COPage/classes/class.ilPCDataTableGUI.php");
311 $ilCtrl->setCmdClass(
"ilpcdatatablegui");
312 $ilCtrl->setCmd(
"insert");
313 $dtable_gui =
new ilPCDataTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
314 $ret = $ilCtrl->forwardCommand($dtable_gui);
318 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
319 $ilCtrl->setCmdClass(
"ilpctablegui");
320 $ilCtrl->setCmd(
"insert");
321 $atable_gui =
new ilPCTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
322 $ret = $ilCtrl->forwardCommand($atable_gui);
326 include_once(
"./Services/COPage/classes/class.ilPCListGUI.php");
327 $ilCtrl->setCmdClass(
"ilpclistgui");
328 $ilCtrl->setCmd(
"insert");
329 $list_gui =
new ilPCListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
330 $ret = $ilCtrl->forwardCommand($list_gui);
334 include_once (
"./Services/COPage/classes/class.ilPCFileListGUI.php");
335 $ilCtrl->setCmdClass(
"ilpcfilelistgui");
336 $ilCtrl->setCmd(
"insert");
337 $file_list_gui =
new ilPCFileListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
338 $file_list_gui->setStyleId($this->
getStyleId());
339 $ret = $this->ctrl->forwardCommand($file_list_gui);