4 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
5 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
36 function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes =
true, $a_may_contribute =
true, $a_style_sheet_id = 0)
40 $lng->loadLanguageModule(
"blog");
42 $this->node_id = $a_node_id;
43 $this->access_handler = $a_access_handler;
44 $this->enable_public_notes = (bool)$a_enable_public_notes;
52 $this->may_contribute = (bool)$a_may_contribute;
56 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
58 $tpl->setCurrentBlock(
"SyntaxStyle");
59 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
61 $tpl->parseCurrentBlock();
64 $tpl->setCurrentBlock(
"ContentStyle");
65 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
67 $tpl->parseCurrentBlock();
80 $next_class = $ilCtrl->getNextClass($this);
81 $cmd = $ilCtrl->getCmd();
84 $ilCtrl->setParameter($this,
"blpg", $posting->getId());
104 case "ilpageobjectgui":
105 die(
"Deprecated. Blog Posting gui forwarding to ilpageobject");
114 $posting->getTitle());
116 $this->lng->txt(
"obj_blog"));
118 $ilLocator->addItem($posting->getTitle(),
119 $ilCtrl->getLinkTarget($this,
"preview"));
153 if($a_cmd ==
"contribute")
157 return $this->access_handler->checkAccess($a_cmd,
"", $this->node_id);
169 $wtpl =
new ilTemplate(
"tpl.blog_page_view_main_column.html",
170 true,
true,
"Modules/Blog");
195 $callback = array($this,
"observeNoteAction");
199 false, $this->enable_public_notes, $this->
checkAccess(
"contribute"), $callback));
203 if($a_mode !=
"embedded")
205 $append = (
$_GET[
"blpg"] !=
"")
212 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
214 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
217 $wtpl->setVariable(
"PAGE", parent::preview());
219 $tpl->setLoginTargetPar(
"blog_".$this->node_id.$append);
233 return $this->
preview(
"embedded");
243 $this->add_date =
true;
244 return $this->
preview(
"fullscreen");
272 return stristr(get_class($this->access_handler),
"workspace");
293 include_once
"Services/User/classes/class.ilUserUtil.php";
301 $prefix =
"<div class=\"il_BlockInfo\" style=\"text-align:right\">".
302 $author.ilDatePresentation::formatDate($this->
getBlogPosting()->getCreated()).
306 $a_output = $prefix.$a_output;
335 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
337 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
338 $confirmation_gui->setHeaderText($lng->txt(
"blog_posting_deletion_confirmation"));
339 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelBlogPostingDeletion");
340 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmBlogPostingDeletion");
342 $dtpl =
new ilTemplate(
"tpl.blog_posting_deletion_confirmation.html",
true,
343 true,
"Modules/Blog");
345 $dtpl->setVariable(
"PAGE_TITLE", $this->
getBlogPosting()->getTitle());
348 include_once(
"./Services/Notes/classes/class.ilNote.php");
351 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
352 $lng->txt(
"blog_number_users_notes_or_comments"));
353 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
355 $confirmation_gui->addItem(
"",
"", $dtpl->get());
357 $tpl->setContent($confirmation_gui->getHTML());
368 $ilCtrl->redirect($this,
"preview");
382 foreach($md_section->getKeywordIds() as $id)
384 $md_key = $md_section->getKeyword($id);
392 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"blpg",
"");
393 $ilCtrl->redirectByClass(
"ilobjbloggui",
"render");
398 global
$tpl, $ilTabs;
400 $ilTabs->activateTab(
"edit");
407 $tpl->setContent($a_form->getHTML());
415 if($form->checkInput())
418 $page->setTitle($form->getInput(
"title"));
422 $ilCtrl->redirect($this,
"preview");
425 $form->setValuesByPost();
433 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
435 $form->setFormAction($ilCtrl->getFormAction($this));
436 $form->setTitle($lng->txt(
'blog_rename_posting'));
440 $form->addItem($title);
444 $form->addCommandButton(
'updateTitle', $lng->txt(
'save'));
445 $form->addCommandButton(
'preview', $lng->txt(
'cancel'));
452 global
$tpl, $ilTabs;
454 $ilTabs->activateTab(
"edit");
461 $tpl->setContent($a_form->getHTML());
469 if($form->checkInput())
471 $dt = $form->getInput(
"date");
475 $page->setCreated($dt);
479 $ilCtrl->redirect($this,
"preview");
482 $form->setValuesByPost();
490 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
492 $form->setFormAction($ilCtrl->getFormAction($this));
493 $form->setTitle($lng->txt(
'blog_edit_date'));
497 $date->setShowTime(
true);
498 $date->setInfo($lng->txt(
'blog_edit_date_info'));
499 $form->addItem($date);
503 $form->addCommandButton(
'updateDate', $lng->txt(
'save'));
504 $form->addCommandButton(
'preview', $lng->txt(
'cancel'));
512 include_once
"Services/Notes/classes/class.ilNote.php";
513 $note =
new ilNote($a_note_id);
514 $note = $note->getText();
516 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
524 return array(
"deactivatePage" => $lng->txt(
"blog_toggle_draft"),
525 "activatePage" => $lng->txt(
"blog_toggle_final"));
540 $this->ctrl->redirect($this,
"edit");
544 $this->ctrl->redirectByClass(
"ilobjbloggui",
"");
556 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
563 $this->ctrl->redirect($this,
"edit");
567 $this->ctrl->redirectByClass(
"ilobjbloggui",
"");
573 global $ilTabs,
$tpl;
580 $ilTabs->activateTab(
"pg");
587 $tpl->setContent($a_form->getHTML());
594 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
596 $form->setFormAction($this->ctrl->getFormAction($this,
"saveKeywordsForm"));
597 $form->setTitle($this->lng->txt(
"blog_edit_keywords"));
599 $txt =
new ilTextInputGUI($this->lng->txt(
"blog_keywords"),
"keywords");
602 $txt->setDataSource($this->ctrl->getLinkTarget($this,
"keywordAutocomplete",
"",
true));
603 $txt->setMaxLength(200);
605 $txt->setInfo($this->lng->txt(
"blog_keywords_info"));
606 $form->addItem($txt);
611 foreach($ids = $md_section->getKeywordIds() as $id)
613 $md_key = $md_section->getKeyword($id);
614 if (trim($md_key->getKeyword()) !=
"")
616 $keywords[$md_key->getKeywordLanguageCode()][]
617 = $md_key->getKeyword();
622 $ulang = $ilUser->getLanguage();
623 if($keywords[$ulang])
625 asort($keywords[$ulang]);
626 $txt->setValue($keywords[$ulang]);
629 $form->addCommandButton(
"saveKeywordsForm", $this->lng->txt(
"save"));
630 $form->addCommandButton(
"preview", $this->lng->txt(
"cancel"));
641 return $this->access_handler->getTree()->lookupObjectId($this->node_id);
653 include_once
'Services/MetaData/classes/class.ilMD.php';
656 if(!is_object($md_section = $md_obj->getGeneral()))
658 $md_section = $md_obj->addGeneral();
670 if($form->checkInput())
672 $keywords = $form->getInput(
"keywords");
673 if(is_array($keywords))
676 $ulang = $ilUser->getLanguage();
677 $keywords = array($ulang=>$keywords);
679 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
683 $this->ctrl->redirect($this,
"preview");
686 $form->setValuesByPost();
692 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
698 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
710 $entry =
new stdClass();
716 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
729 $bpgui =
new self(0, null, $a_id);
730 $bpgui->setRawPageContent(
true);
731 $bpgui->setAbstractOnly(
true);
734 $bpgui->setFileDownloadLink(
".");
735 $bpgui->setFullscreenLink(
".");
736 $bpgui->setSourcecodeDownloadScript(
".");
738 return $bpgui->showPage();