24 require_once(
"./Services/COPage/classes/class.ilPCResources.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
55 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
81 function edit($a_insert =
false)
88 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
90 $form->setFormAction($ilCtrl->getFormAction($this));
93 $form->setTitle($this->lng->txt(
"cont_insert_resources"));
97 $form->setTitle($this->lng->txt(
"cont_update_resources"));
105 $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type);
107 foreach($sub_objs as $k => $so)
109 $types[$k] = $this->lng->txt(
"objs_".$k);
111 foreach($types as $k => $type)
114 $type_prop->addOption($option);
116 $selected = ($a_insert)
118 : $this->content_obj->getResourceListType();
119 $type_prop->setValue($selected);
120 $form->addItem($type_prop);
125 $form->addCommandButton(
"create_resources", $lng->txt(
"save"));
126 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
130 $form->addCommandButton(
"update_resources", $lng->txt(
"save"));
131 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
133 $html = $form->getHTML();
134 $tpl->setContent($html);
146 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
147 $this->content_obj->setResourceListType($_POST[
"type"]);
148 $this->updated = $this->pg_obj->update();
149 if ($this->updated ===
true)
151 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
164 $this->content_obj->setResourceListType($_POST[
"type"]);
165 $this->updated = $this->pg_obj->update();
166 if ($this->updated ===
true)
168 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
172 $this->pg_obj->addHierIDs();