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)
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;
49 $this->may_contribute = (bool)$a_may_contribute;
53 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
55 $tpl->setCurrentBlock(
"SyntaxStyle");
56 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
58 $tpl->parseCurrentBlock();
60 $tpl->setCurrentBlock(
"ContentStyle");
61 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
63 $tpl->parseCurrentBlock();
99 $next_class = $ilCtrl->getNextClass($this);
100 $cmd = $ilCtrl->getCmd();
103 $ilCtrl->setParameter($this,
"blpg", $posting->getId());
123 case "ilpageobjectgui":
131 return $ilCtrl->forwardCommand($page_gui);
139 $posting->getTitle());
141 $this->lng->txt(
"obj_blog"));
143 $ilLocator->addItem($posting->getTitle(),
144 $ilCtrl->getLinkTarget($this,
"preview"));
178 if($a_cmd ==
"contribute")
182 return $this->access_handler->checkAccess($a_cmd,
"", $this->node_id);
194 $wtpl =
new ilTemplate(
"tpl.blog_page_view_main_column.html",
195 true,
true,
"Modules/Blog");
220 $callback = array($this,
"observeNoteAction");
224 false, $this->enable_public_notes, $this->
checkAccess(
"contribute"), $callback));
228 if($a_mode !=
"embedded")
230 $append = (
$_GET[
"blpg"] !=
"")
237 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
239 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
242 $wtpl->setVariable(
"PAGE", parent::preview());
244 $tpl->setLoginTargetPar(
"blog_".$this->node_id.$append);
246 $ilCtrl->setParameter($this,
"blpg", $this->
getBlogPosting()->getId());
258 return $this->
preview(
"embedded");
268 $this->add_date =
true;
269 return $this->
preview(
"fullscreen");
297 return stristr(get_class($this->access_handler),
"workspace");
318 include_once
"Services/User/classes/class.ilUserUtil.php";
326 $prefix =
"<div class=\"il_BlockInfo\" style=\"text-align:right\">".
327 $author.ilDatePresentation::formatDate($this->
getBlogPosting()->getCreated()).
331 $a_output = $prefix.$a_output;
346 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"blpg", $this->
getBlogPosting()->getId());
360 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
362 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
363 $confirmation_gui->setHeaderText($lng->txt(
"blog_posting_deletion_confirmation"));
364 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelBlogPostingDeletion");
365 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmBlogPostingDeletion");
367 $dtpl =
new ilTemplate(
"tpl.blog_posting_deletion_confirmation.html",
true,
368 true,
"Modules/Blog");
370 $dtpl->setVariable(
"PAGE_TITLE", $this->
getBlogPosting()->getTitle());
373 include_once(
"./Services/Notes/classes/class.ilNote.php");
376 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
377 $lng->txt(
"blog_number_users_notes_or_comments"));
378 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
380 $confirmation_gui->addItem(
"",
"", $dtpl->get());
382 $tpl->setContent($confirmation_gui->getHTML());
393 $ilCtrl->redirect($this,
"preview");
407 foreach($md_section->getKeywordIds() as $id)
409 $md_key = $md_section->getKeyword($id);
417 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"blpg",
"");
418 $ilCtrl->redirectByClass(
"ilobjbloggui",
"render");
423 global
$tpl, $ilTabs;
425 $ilTabs->activateTab(
"edit");
432 $tpl->setContent($a_form->getHTML());
440 if($form->checkInput())
443 $page->setTitle($form->getInput(
"title"));
447 $ilCtrl->redirect($this,
"preview");
450 $form->setValuesByPost();
458 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
460 $form->setFormAction($ilCtrl->getFormAction($this));
461 $form->setTitle($lng->txt(
'blog_rename_posting'));
464 $title->setRequired(
true);
469 $form->addCommandButton(
'updateTitle', $lng->txt(
'save'));
470 $form->addCommandButton(
'preview', $lng->txt(
'cancel'));
477 global
$tpl, $ilTabs;
479 $ilTabs->activateTab(
"edit");
486 $tpl->setContent($a_form->getHTML());
494 if($form->checkInput())
496 $dt = $form->getInput(
"date");
500 $page->setCreated($dt);
504 $ilCtrl->redirect($this,
"preview");
507 $form->setValuesByPost();
515 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
517 $form->setFormAction($ilCtrl->getFormAction($this));
518 $form->setTitle($lng->txt(
'blog_edit_date'));
522 $date->setShowTime(
true);
523 $date->setInfo($lng->txt(
'blog_edit_date_info'));
524 $form->addItem($date);
528 $form->addCommandButton(
'updateDate', $lng->txt(
'save'));
529 $form->addCommandButton(
'preview', $lng->txt(
'cancel'));
537 include_once
"Services/Notes/classes/class.ilNote.php";
538 $note =
new ilNote($a_note_id);
539 $note = $note->getText();
541 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
549 return array(
"deactivatePage" => $lng->txt(
"blog_toggle_draft"),
550 "activatePage" => $lng->txt(
"blog_toggle_final"));
558 $this->ctrl->redirect($this,
"edit");
564 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
569 $this->ctrl->redirect($this,
"edit");
574 global $ilTabs,
$tpl;
581 $ilTabs->activateTab(
"pg");
588 $tpl->setContent($a_form->getHTML());
595 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
597 $form->setFormAction($this->ctrl->getFormAction($this,
"saveKeywordsForm"));
598 $form->setTitle($this->lng->txt(
"blog_edit_keywords"));
600 $txt =
new ilTextInputGUI($this->lng->txt(
"blog_keywords"),
"keywords");
603 $txt->setDataSource($this->ctrl->getLinkTarget($this,
"keywordAutocomplete",
"",
true));
604 $txt->setMaxLength(200);
606 $txt->setInfo($this->lng->txt(
"blog_keywords_info"));
607 $form->addItem($txt);
612 foreach($ids = $md_section->getKeywordIds() as $id)
614 $md_key = $md_section->getKeyword($id);
615 if (trim($md_key->getKeyword()) !=
"")
617 $keywords[$md_key->getKeywordLanguageCode()][]
618 = $md_key->getKeyword();
623 $ulang = $ilUser->getLanguage();
624 if($keywords[$ulang])
626 asort($keywords[$ulang]);
627 $txt->setValue($keywords[$ulang]);
630 $form->addCommandButton(
"saveKeywordsForm", $this->lng->txt(
"save"));
631 $form->addCommandButton(
"preview", $this->lng->txt(
"cancel"));
642 return $this->access_handler->getTree()->lookupObjectId($this->node_id);
654 include_once
'Services/MetaData/classes/class.ilMD.php';
657 if(!is_object($md_section = $md_obj->getGeneral()))
659 $md_section = $md_obj->addGeneral();
671 if($form->checkInput())
673 $keywords = $form->getInput(
"keywords");
674 if(is_array($keywords))
677 $ulang = $ilUser->getLanguage();
678 $keywords = array($ulang=>$keywords);
680 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
684 $this->ctrl->redirect($this,
"preview");
687 $form->setValuesByPost();
693 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
699 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
711 $entry =
new stdClass();
717 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
730 $bpgui =
new self(0, null, $a_id);
731 $bpgui->setRawPageContent(
true);
732 $bpgui->setAbstractOnly(
true);
735 $bpgui->setFileDownloadLink(
".");
736 $bpgui->setFullscreenLink(
".");
737 $bpgui->setSourcecodeDownloadScript(
".");
739 return $bpgui->showPage();