24 require_once(
"./Services/COPage/classes/class.ilPCBlog.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
44 function ilPCBlogGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
55 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
85 $tpl->setContent($a_form->getHTML());
103 $tpl->setContent($a_form->getHTML());
116 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
118 $form->setFormAction($ilCtrl->getFormAction($this));
121 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
125 $form->setTitle($this->lng->txt(
"cont_update_blog"));
129 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
135 foreach ($tree->getSubTree($root) as $node)
137 if ($node[
"type"] ==
"blog")
139 $options[$node[
"obj_id"]] = $node[
"title"];
146 $obj->setOptions($options);
147 $form->addItem($obj);
151 $form->addCommandButton(
"create_blog", $this->lng->txt(
"select"));
152 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
156 $obj->setValue($this->content_obj->getBlogId());
157 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
158 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
172 if($form->checkInput())
177 $form->setValuesByPost();
178 return $this->
insert($form);
183 if($form->checkInput())
185 $this->content_obj =
new ilPCBlog($this->dom);
186 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
187 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
188 $this->updated = $this->pg_obj->update();
189 if ($this->updated ===
true)
191 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
195 $form->setValuesByPost();
208 if($form->checkInput())
213 $this->pg_obj->addHierIDs();
214 $form->setValuesByPost();
215 return $this->
edit($form);
220 if($form->checkInput())
222 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
223 $this->updated = $this->pg_obj->update();
224 if ($this->updated ===
true)
226 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
230 $this->pg_obj->addHierIDs();
231 $form->setValuesByPost();
253 $tpl->setContent($a_form->getHTML());
272 $tpl->setContent($a_form->getHTML());
286 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
288 $form->setFormAction($ilCtrl->getFormAction($this));
291 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
295 $form->setTitle($this->lng->txt(
"cont_update_blog"));
299 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
303 foreach($postings as $post)
306 $title = $post[
"title"].
" - ".
310 $cbox->setValue($post[
"id"]);
318 $obj->setOptions($options);
319 $form->addItem($obj);
322 $blog_id->setValue($a_blog_id);
323 $form->addItem($blog_id);
327 $form->addCommandButton(
"create_blog", $this->lng->txt(
"save"));
328 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
332 $obj->setValue($this->content_obj->getPostings());
333 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
334 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));