4 require_once(
"./Services/COPage/classes/class.ilPCResources.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
35 $next_class = $this->ctrl->getNextClass($this);
38 $cmd = $this->ctrl->getCmd();
61 function edit($a_insert =
false)
68 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
70 $form->setFormAction($ilCtrl->getFormAction($this));
73 $form->setTitle($this->lng->txt(
"cont_insert_resources"));
77 $form->setTitle($this->lng->txt(
"cont_update_resources"));
85 $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type);
87 foreach($sub_objs as $k => $so)
89 $types[$k] = $this->lng->txt(
"objs_".$k);
91 foreach($types as $k => $type)
94 $type_prop->addOption($option);
96 $selected = ($a_insert)
98 : $this->content_obj->getResourceListType();
99 $type_prop->setValue($selected);
100 $form->addItem($type_prop);
105 $form->addCommandButton(
"create_resources", $lng->txt(
"save"));
106 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
110 $form->addCommandButton(
"update_resources", $lng->txt(
"save"));
111 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
113 $html = $form->getHTML();
114 $tpl->setContent($html);
126 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
127 $this->content_obj->setResourceListType(
$_POST[
"type"]);
128 $this->updated = $this->pg_obj->update();
129 if ($this->updated ===
true)
131 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
144 $this->content_obj->setResourceListType(
$_POST[
"type"]);
145 $this->updated = $this->pg_obj->update();
146 if ($this->updated ===
true)
148 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
152 $this->pg_obj->addHierIDs();