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
"Modules/Blog/classes/class.ilBlogPosting.php";
133 foreach ($blogs_ids as $blog_id)
141 $obj->setOptions($options);
142 $form->addItem($obj);
146 $form->addCommandButton(
"create_blog", $this->lng->txt(
"select"));
147 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
151 $obj->setValue($this->content_obj->getBlogId());
152 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
153 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
167 if($form->checkInput())
172 $form->setValuesByPost();
173 return $this->
insert($form);
178 if($form->checkInput())
180 $this->content_obj =
new ilPCBlog($this->dom);
181 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
182 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
183 $this->updated = $this->pg_obj->update();
184 if ($this->updated ===
true)
186 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
190 $form->setValuesByPost();
203 if($form->checkInput())
208 $this->pg_obj->addHierIDs();
209 $form->setValuesByPost();
210 return $this->
edit($form);
215 if($form->checkInput())
217 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
218 $this->updated = $this->pg_obj->update();
219 if ($this->updated ===
true)
221 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
225 $this->pg_obj->addHierIDs();
226 $form->setValuesByPost();
248 $tpl->setContent($a_form->getHTML());
267 $tpl->setContent($a_form->getHTML());
281 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
283 $form->setFormAction($ilCtrl->getFormAction($this));
286 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
290 $form->setTitle($this->lng->txt(
"cont_update_blog"));
294 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
298 foreach($postings as $post)
301 if($post[
"author"] == $ilUser->getId())
304 $title = $post[
"title"].
" - ".
308 $cbox->setValue($post[
"id"]);
317 $obj->setOptions($options);
318 $form->addItem($obj);
321 $blog_id->setValue($a_blog_id);
322 $form->addItem($blog_id);
326 $form->addCommandButton(
"create_blog", $this->lng->txt(
"save"));
327 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
331 $obj->setValue($this->content_obj->getPostings());
332 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
333 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));