40 $this->content_object =& $a_content_obj;
53 if (is_array($a_actions))
55 foreach ($a_actions as $name =>
$lng)
57 $this->actions[$name] = array(
"name" => $name,
"lng" =>
$lng);
76 if ($this->target_frame[$a_cmd] !=
"")
78 return $this->target_frame[$a_cmd];
80 elseif (!empty($a_target_frame))
82 return "target=\"".$a_target_frame.
"\"";
102 $a_type =
$_GET[
"type"];
105 $template =
"tpl.".$a_type.
"_".$a_cmd.
".html";
107 if (!$this->tpl->fileExists($template))
109 $template =
"tpl.obj_".$a_cmd.
".html";
112 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content", $template);
127 $data[
"fields"] = array();
128 $data[
"fields"][
"title"] =
$_SESSION[
"error_post_vars"][
"Fobject"][
"title"];
129 $data[
"fields"][
"desc"] =
$_SESSION[
"error_post_vars"][
"Fobject"][
"desc"];
133 foreach (
$data[
"fields"] as $key => $val)
135 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
136 $this->tpl->setVariable(strtoupper($key), $val);
138 if ($this->prepare_output)
140 $this->tpl->parseCurrentBlock();
143 $this->ctrl->setParameter($this,
"new_type", $new_type);
146 $this->tpl->setVariable(
"FORMACTION",
147 $this->ctrl->getFormAction($this,
"save"));
148 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
149 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
150 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
151 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
153 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
163 $tree =
new ilTree($this->content_object->getId());
165 $tree->setTreeTablePK(
"lm_id");
167 $parent_id = (!empty(
$_GET[
"obj_id"]))
169 : $tree->getRootId();
171 if (!empty(
$_GET[
"target"]))
173 $target =
$_GET[
"target"];
178 $childs =& $tree->getChildsByType($parent_id, $this->obj->getType());
179 if (count($childs) == 0)
185 $target = $childs[count($childs) - 1][
"obj_id"];
188 if (!$tree->isInTree($this->obj->getId()))
190 $tree->insertNode($this->obj->getId(), $parent_id, $target);
204 $cont_obj_gui->
delete($this->obj->getId());
213 session_unregister(
"saved_post");
214 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
226 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
237 $this->tpl->setCurrentBlock(
"begin_link");
238 $this->tpl->setVariable(
"LINK_TARGET", $link);
239 $this->tpl->parseCurrentBlock();
240 $this->tpl->touchBlock(
"end_link");
243 $this->tpl->setCurrentBlock(
"text");
244 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
245 $this->tpl->parseCurrentBlock();
246 $this->tpl->setCurrentBlock(
"table_cell");
247 $this->tpl->parseCurrentBlock();
258 foreach ($a_actions as $name =>
$lng)
260 $d[$name] = array(
"name" => $name,
"lng" =>
$lng);
263 $notoperations = array();
264 $operations = array();
268 if (count($operations) > 0)
270 foreach ($operations as $val)
272 $this->tpl->setCurrentBlock(
"operation_btn");
273 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
274 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
275 $this->tpl->parseCurrentBlock();
278 $this->tpl->setCurrentBlock(
"operation");
280 $this->tpl->parseCurrentBlock();
289 $this->content_object->checkTree();