5 require_once(
"./Services/COPage/classes/class.ilPCPlaceHolder.php");
 
    6 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   36                 $this->pg_obj = $a_pg_obj;
 
   37                 $this->content_obj = $a_content_obj;
 
   38                 $this->hier_id = $a_hier_id;
 
   39                 $this->pc_id = $a_pc_id;
 
   53                 $next_class = $this->ctrl->getNextClass($this);
 
   55                 $cmd = $this->ctrl->getCmd();
 
   59                         case 'ilpcmediaobjectgui':  
 
   60                                 include_once(
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
 
   61                                 $media_gui = 
new ilPCMediaObjectGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
   62                                 $ret = $ilCtrl->forwardCommand($media_gui);             
 
   80                 $this->
propertyGUI(
"create",
"Text",
"100px",
"insert");
 
   89                 if (
$_POST[
"plach_height"]==
"" || !preg_match(
"/[0-9]+/",
$_POST[
"plach_height"])) {
 
   95                 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
   96                 $this->content_obj->setHeight(
$_POST[
"plach_height"].
"px");
 
   97                 $this->content_obj->setContentClass(
$_POST[
'plach_type']);
 
   98                 $this->updated = $this->pg_obj->update();               
 
   99                 if ($this->updated === 
true)
 
  101                         $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);
 
  115                 if ($this->pg_obj->getLayoutMode() == 
true) {
 
  129                 $this->styleid = $a_styleid;
 
  148                 $this->
propertyGUI(
"saveProperties",$this->content_obj->getContentClass(),$this->content_obj->getHeight(),
"save");
 
  155                 switch ($this->content_obj->getContentClass()) {
 
  157                                 include_once(
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
 
  158                                 $ilCtrl->setCmdClass(
"ilpcmediaobjectgui");
 
  159                                 $ilCtrl->setCmd(
"insert");
 
  161                                 $ret = $ilCtrl->forwardCommand($media_gui);
 
  168                                 include_once(
"./Services/COPage/classes/class.ilPCQuestionGUI.php");
 
  169                                 $ilCtrl->setCmdClass(
"ilpcquestiongui");
 
  170                                 $ilCtrl->setCmd(
"insert");
 
  171                                 $question_gui = 
new ilPCQuestionGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  172                                 $question_gui -> setSelfAssessmentMode(
true);
 
  173                                 $ret = $ilCtrl->forwardCommand($question_gui);
 
  187                 if (
$_POST[
"plach_height"]==
"" || !preg_match(
"/[0-9]+/",
$_POST[
"plach_height"])) {
 
  192                 $this->content_obj->setContentClass(
$_POST[
'plach_type']);
 
  193                 $this->content_obj->setHeight(
$_POST[
"plach_height"].
"px");
 
  195                 $this->updated = $this->pg_obj->update();
 
  196                 if ($this->updated === 
true)
 
  198                         $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);
 
  202                         $this->pg_obj->addHierIDs();
 
  210         private function propertyGUI($a_action,$a_type,$a_height,$a_mode) {
 
  213                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  215                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
  216                 $this->form_gui->setTitle($lng->txt(
"cont_ed_plachprop"));
 
  218                 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
 
  220                 $options =array(
"Text"=>$lng->txt(
"cont_ed_plachtext"),
"Media"=>$lng->txt(
"cont_ed_plachmedia"),
 
  221                                                 "Question"=>$lng->txt(
"cont_ed_plachquestion"));
 
  223                 $ttype_input->setValue($a_type);
 
  224                 $ttype_input->setRequired(
true);
 
  225                 $theight_input = 
new ilTextInputGUI($lng->txt(
"height"),
"plach_height");
 
  227                 $theight_input->setMaxLength(3);
 
  229                 $a_height = preg_replace(
"/px/",
"",$a_height);
 
  230                 $theight_input->setValue($a_height);
 
  231                 $theight_input->setTitle($lng->txt(
"height").
" (px)");
 
  232                 $theight_input->setRequired(
true);
 
  234                 $this->form_gui->addItem($ttype_input);
 
  235                 $this->form_gui->addItem($theight_input);
 
  237                 $this->form_gui->addCommandButton($a_action, $lng->txt($a_mode));
 
  238                 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
 
  239                 $this->tpl->setContent($this->form_gui->getHTML());
 
  250                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  252                 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
 
  253                 $this->form_gui->setTitle($lng->txt(
"cont_ed_select_pctext"));
 
  257                 include_once(
"Services/Form/classes/class.ilRadioMatrixInputGUI.php");
 
  259                 $options = array($lng->txt(
"cont_ed_par"),$lng->txt(
"cont_ed_dtable"),
 
  260                                                  $lng->txt(
"cont_ed_atable"),$lng->txt(
"cont_ed_list"),$lng->txt(
"cont_ed_flist"),
 
  261                                                  $lng->txt(
"cont_tabs"));
 
  263                 $this->form_gui->addItem($ttype_input);
 
  265                 $this->form_gui->addCommandButton(
"insertPCText", $lng->txt(
"insert"));
 
  266                 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
 
  267                 $this->tpl->setContent($this->form_gui->getHTML());
 
  278                 switch (
$_POST[
'pctext_type']) {
 
  286                                         $ret_class = $ilCtrl->getReturnClass($this);
 
  287                                         $ilCtrl->setParameterByClass($ret_class, 
"pl_hier_id", $this->hier_id);
 
  288                                         $ilCtrl->setParameterByClass($ret_class, 
"pl_pc_id", $this->pc_id);
 
  289                                         $ilCtrl->redirectByClass($ret_class,
 
  290                                                 "insertJSAtPlaceholder");
 
  293                                 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
 
  294                                 $ilCtrl->setCmdClass(
"ilpcparagraphgui");
 
  295                                 $ilCtrl->setCmd(
"insert");
 
  296                                 $paragraph_gui = 
new ilPCParagraphGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  297                                 $paragraph_gui->setStyleId($this->
getStyleId());
 
  301                                 $ret = $ilCtrl->forwardCommand($paragraph_gui);
 
  305                                 include_once(
"./Services/COPage/classes/class.ilPCDataTableGUI.php");
 
  306                                 $ilCtrl->setCmdClass(
"ilpcdatatablegui");
 
  307                                 $ilCtrl->setCmd(
"insert");
 
  308                                 $dtable_gui = 
new ilPCDataTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  309                                 $ret = $ilCtrl->forwardCommand($dtable_gui);
 
  313                                 include_once(
"./Services/COPage/classes/class.ilPCTableGUI.php");
 
  314                                 $ilCtrl->setCmdClass(
"ilpctablegui");
 
  315                                 $ilCtrl->setCmd(
"insert");
 
  316                                 $atable_gui = 
new ilPCTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  317                                 $ret = $ilCtrl->forwardCommand($atable_gui);
 
  321                                 include_once(
"./Services/COPage/classes/class.ilPCListGUI.php");
 
  322                                 $ilCtrl->setCmdClass(
"ilpclistgui");
 
  323                                 $ilCtrl->setCmd(
"insert");
 
  324                                 $list_gui = 
new ilPCListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  325                                 $ret = $ilCtrl->forwardCommand($list_gui);
 
  329                                 include_once (
"./Services/COPage/classes/class.ilPCFileListGUI.php");
 
  330                                 $ilCtrl->setCmdClass(
"ilpcfilelistgui");
 
  331                                 $ilCtrl->setCmd(
"insert");
 
  332                                 $file_list_gui = 
new ilPCFileListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  333                                 $file_list_gui->setStyleId($this->
getStyleId());
 
  334                                 $ret = $this->ctrl->forwardCommand($file_list_gui);
 
  338                                 include_once (
"./Services/COPage/classes/class.ilPCTabsGUI.php");
 
  339                                 $ilCtrl->setCmdClass(
"ilpctabsgui");
 
  340                                 $ilCtrl->setCmd(
"insert");
 
  341                                 $tabs_gui = 
new ilPCTabsGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
 
  343                                 $ret = $this->ctrl->forwardCommand($tabs_gui);
 
  356                 $this->ctrl->returnToParent($this, 
"jump".$this->hier_id);