5 require_once(
"./Services/COPage/classes/class.ilPCBlog.php");
6 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
25 function ilPCBlogGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id =
"")
36 $next_class = $this->ctrl->getNextClass($this);
39 $cmd = $this->ctrl->getCmd();
66 $tpl->setContent($a_form->getHTML());
84 $tpl->setContent($a_form->getHTML());
97 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
99 $form->setFormAction($ilCtrl->getFormAction($this));
102 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
106 $form->setTitle($this->lng->txt(
"cont_update_blog"));
110 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
114 foreach ($blogs_ids as $blog_id)
123 $form->addItem($obj);
127 $form->addCommandButton(
"create_blog", $this->lng->txt(
"select"));
128 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
132 $obj->setValue($this->content_obj->getBlogId());
133 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
134 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
148 if($form->checkInput())
153 $form->setValuesByPost();
154 return $this->
insert($form);
159 if($form->checkInput())
162 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
163 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
164 $this->updated = $this->pg_obj->update();
165 if ($this->updated ===
true)
167 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
171 $form->setValuesByPost();
184 if($form->checkInput())
189 $this->pg_obj->addHierIDs();
190 $form->setValuesByPost();
191 return $this->
edit($form);
196 if($form->checkInput())
198 $this->content_obj->setData($form->getInput(
"blog_id"), $form->getInput(
"posting"));
199 $this->updated = $this->pg_obj->update();
200 if ($this->updated ===
true)
202 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
206 $this->pg_obj->addHierIDs();
207 $form->setValuesByPost();
229 $tpl->setContent($a_form->getHTML());
248 $tpl->setContent($a_form->getHTML());
262 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
264 $form->setFormAction($ilCtrl->getFormAction($this));
267 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
271 $form->setTitle($this->lng->txt(
"cont_update_blog"));
275 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
279 foreach($postings as $post)
282 if($post[
"author"] == $ilUser->getId())
285 $title = $post[
"title"].
" - ".
289 $cbox->setValue($post[
"id"]);
299 $form->addItem($obj);
302 $blog_id->setValue($a_blog_id);
303 $form->addItem($blog_id);
307 $form->addCommandButton(
"create_blog", $this->lng->txt(
"save"));
308 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
312 $obj->setValue($this->content_obj->getPostings());
313 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
314 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));