5 require_once(
"./Services/COPage/classes/class.ilPCBlog.php");
6 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
30 public function __construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id =
"")
34 $this->tpl = $DIC[
"tpl"];
35 $this->ctrl = $DIC->ctrl();
36 $this->
user = $DIC->user();
37 $this->lng = $DIC->language();
38 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
47 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
52 switch ($next_class) {
75 $tpl->setContent($a_form->getHTML());
92 $tpl->setContent($a_form->getHTML());
107 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
111 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
113 $form->setTitle($this->lng->txt(
"cont_update_blog"));
117 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
120 foreach ($blogs_ids as $blog_id) {
128 $form->addItem($obj);
131 $form->addCommandButton(
"create_blog", $this->lng->txt(
"select"));
132 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
134 $obj->setValue($this->content_obj->getBlogId());
135 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
136 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
149 if (
$form->checkInput()) {
153 $form->setValuesByPost();
157 if (
$form->checkInput()) {
159 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
160 $this->content_obj->setData(
$form->getInput(
"blog_id"),
$form->getInput(
"posting"));
161 $this->updated = $this->pg_obj->update();
162 if ($this->updated ===
true) {
163 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
167 $form->setValuesByPost();
179 if (
$form->checkInput()) {
183 $this->pg_obj->addHierIDs();
184 $form->setValuesByPost();
188 if (
$form->checkInput()) {
189 $this->content_obj->setData(
$form->getInput(
"blog_id"),
$form->getInput(
"posting"));
190 $this->updated = $this->pg_obj->update();
191 if ($this->updated ===
true) {
192 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
196 $this->pg_obj->addHierIDs();
197 $form->setValuesByPost();
218 $tpl->setContent($a_form->getHTML());
236 $tpl->setContent($a_form->getHTML());
251 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
255 $form->setTitle($this->lng->txt(
"cont_insert_blog"));
257 $form->setTitle($this->lng->txt(
"cont_update_blog"));
261 include_once
"Modules/Blog/classes/class.ilBlogPosting.php";
264 foreach ($postings as
$post) {
266 if ($post[
"author"] ==
$ilUser->getId()) {
268 $title = $post[
"title"] .
" - " .
272 $cbox->setValue($post[
"id"]);
282 $form->addItem($obj);
285 $blog_id->setValue($a_blog_id);
286 $form->addItem($blog_id);
289 $form->addCommandButton(
"create_blog", $this->lng->txt(
"save"));
290 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
292 $obj->setValue($this->content_obj->getPostings());
293 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
294 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
editPosting($a_blog_id, ilPropertyFormGUI $a_form=null)
Edit blog posting form.
initPostingForm($a_blog_id, $a_insert=false)
Init blog posting form.
static _lookupTitle($a_id)
lookup object title
edit(ilPropertyFormGUI $a_form=null)
Edit blog form.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
initForm($a_insert=false)
Init blog form.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static searchBlogsByAuthor($a_user_id)
Get all blogs where user has postings.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
executeCommand()
execute command
if(isset($_POST['submit'])) $form
insert(ilPropertyFormGUI $a_form=null)
Insert blog form.
__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
displayValidationError()
display validation errors
insertPosting($a_blog_id, ilPropertyFormGUI $a_form=null)
Insert new blog posting form.