4 include_once(
"./classes/class.ilObjectGUI.php");
38 $this->tabs_gui =& $ilTabs;
57 if (!$a_call_by_reference)
59 $params = array(
"ref_id",
"obj_id");
62 $this->ctrl->saveParameter($this,
$params);
66 $this->call_by_reference = $a_call_by_reference;
67 $this->creation_mode =
false;
68 $this->ref_id = ($this->call_by_reference) ? $this->
id :
$_GET[
"ref_id"];
69 $this->obj_id = ($this->call_by_reference) ?
$_GET[
"obj_id"] : $this->
id;
75 if (is_object($this->
object))
77 if ($this->call_by_reference && $this->ref_id =
$_GET[
"ref_id"])
79 $this->ctrl->setContext($this->object->getId(),
80 $this->
object->getType());
100 $next_class = $this->ctrl->getNextClass($this);
101 $cmd = $this->ctrl->getCmd();
186 final protected function getReturnLocation() { die(
"ilObject2GUI::getReturnLocation() is deprecated."); }
187 final protected function setReturnLocation() { die(
"ilObject2GUI::setReturnLocation() is deprecated."); }
188 final protected function showActions() { die(
"ilObject2GUI::showActions() is deprecated."); }
189 final public function getTemplateFile() {mk(); die(
"ilObject2GUI::getTemplateFile() is deprecated."); }
190 final protected function getTitlesByRefId() { die(
"ilObject2GUI::getTitlesByRefId() is deprecated."); }
191 final protected function getTabs() {nj(); die(
"ilObject2GUI::getTabs() is deprecated."); }
192 final protected function __showButton() { die(
"ilObject2GUI::__showButton() is deprecated."); }
193 final protected function hitsperpageObject() { die(
"ilObject2GUI::hitsperpageObject() is deprecated."); }
194 final protected function __initTableGUI() { die(
"ilObject2GUI::__initTableGUI() is deprecated."); }
196 final protected function __showClipboardTable() { die(
"ilObject2GUI::__showClipboardTable() is deprecated."); }
231 global $rbacsystem,
$tpl;
235 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
237 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
241 $this->ctrl->setParameter($this,
"new_type", $new_type);
243 $tpl->setContent($this->form->getHTML());
245 if ($new_type !=
"mep")
250 $tpl->setContent($this->form->getHTML().$clone_html);
267 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
269 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
271 $this->ctrl->setParameter($this,
"new_type", $new_type);
273 if ($this->form->checkInput())
276 $location = $objDefinition->getLocation($new_type);
279 $class_name =
"ilObj".$objDefinition->getClassName($new_type);
280 include_once(
$location.
"/class.".$class_name.
".php");
281 $newObj =
new $class_name();
282 $newObj->setType($new_type);
286 $newObj->createReference();
287 $newObj->putInTree(
$_GET[
"ref_id"]);
288 $newObj->setPermissions(
$_GET[
"ref_id"]);
290 $this->afterSave($newObj);
294 $this->form->setValuesByPost();
295 $tpl->setContent($this->form->getHtml());
307 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
309 $this->form->setTarget(
"_top");
315 $ti->setRequired(
true);
316 $this->form->addItem($ti);
322 $this->form->addItem($ta);
325 if ($a_mode ==
"create")
327 $this->form->addCommandButton(
"save", $lng->txt($a_new_type.
"_add"));
328 $this->form->addCommandButton(
"cancelCreation", $lng->txt(
"cancel"));
329 $this->form->setTitle($lng->txt($a_new_type.
"_new"));
333 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
334 $this->form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
335 $this->form->setTitle($lng->txt(
"edit"));
338 $this->form->setFormAction($ilCtrl->getFormAction($this));
347 $values[
"title"] = $this->
object->getTitle();
348 $values[
"desc"] = $this->
object->getDescription();
349 $this->form->setValuesByArray($values);
359 $this->ctrl->returnToParent($this);
383 $tpl->setContent($this->form->getHTML());
393 $this->ctrl->redirect($this);
406 if ($this->form->checkInput())
408 $this->
object->setTitle(
$_POST[
"title"]);
409 $this->
object->setDescription(
$_POST[
"desc"]);
410 $this->update = $this->
object->update();
415 $this->form->setValuesByPost();
416 $tpl->setContent($this->form->getHtml());
421 $this->ctrl->redirect($this);