4 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
5 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
34 function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes =
true)
38 $lng->loadLanguageModule(
"blog");
40 $this->node_id = $a_node_id;
41 $this->access_handler = $a_access_handler;
42 $this->enable_public_notes = (bool)$a_enable_public_notes;
47 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
49 $tpl->setCurrentBlock(
"SyntaxStyle");
50 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
52 $tpl->parseCurrentBlock();
54 $tpl->setCurrentBlock(
"ContentStyle");
55 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
57 $tpl->parseCurrentBlock();
90 $next_class = $ilCtrl->getNextClass($this);
91 $cmd = $ilCtrl->getCmd();
94 $ilCtrl->setParameter($this,
"blpg", $posting->getId());
114 case "ilpageobjectgui":
122 return $ilCtrl->forwardCommand($page_gui);
130 $posting->getTitle());
132 $ilLocator->addItem($posting->getTitle(),
133 $ilCtrl->getLinkTarget($this,
"preview"));
167 return $this->access_handler->checkAccess($a_cmd,
"", $this->node_id);
179 $wtpl =
new ilTemplate(
"tpl.blog_page_view_main_column.html",
180 true,
true,
"Modules/Blog");
186 $page_commands =
false;
189 $wtpl->setCurrentBlock(
"page_command");
190 $wtpl->setVariable(
"HREF_PAGE_CMD",
191 $ilCtrl->getLinkTarget($this,
"deleteBlogPostingConfirmationScreen"));
192 $wtpl->setVariable(
"TXT_PAGE_CMD", $lng->txt(
"delete"));
193 $wtpl->parseCurrentBlock();
197 $wtpl->setCurrentBlock(
"page_commands");
198 $wtpl->parseCurrentBlock();
203 $callback = array($this,
"observeNoteAction");
207 false, $this->enable_public_notes, $this->
checkAccess(
"write"), $callback));
211 if($a_mode !=
"embedded")
213 $append = (
$_GET[
"blpg"] !=
"")
216 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
218 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
221 $wtpl->setVariable(
"PAGE", parent::preview());
223 $tpl->setLoginTargetPar(
"blog_".$this->node_id.$append);
225 $ilCtrl->setParameter($this,
"blpg", $this->
getBlogPosting()->getId());
237 return $this->
preview(
"embedded");
247 $this->add_date =
true;
248 return $this->
preview(
"fullscreen");
284 $prefix =
"<div class=\"il_BlockInfo\" style=\"text-align:right\">".
289 $a_output = $prefix.$a_output;
305 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"blpg", $this->
getBlogPosting()->getId());
319 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
321 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
322 $confirmation_gui->setHeaderText($lng->txt(
"blog_posting_deletion_confirmation"));
323 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelBlogPostingDeletion");
324 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmBlogPostingDeletion");
326 $dtpl =
new ilTemplate(
"tpl.blog_posting_deletion_confirmation.html",
true,
327 true,
"Modules/Blog");
329 $dtpl->setVariable(
"PAGE_TITLE", $this->
getBlogPosting()->getTitle());
332 include_once(
"./Services/Notes/classes/class.ilNote.php");
335 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
336 $lng->txt(
"blog_number_users_notes_or_comments"));
337 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
339 $confirmation_gui->addItem(
"",
"", $dtpl->get());
341 $tpl->setContent($confirmation_gui->getHTML());
352 $ilCtrl->redirect($this,
"preview");
368 $ilCtrl->redirectByClass(
"ilobjbloggui",
"render");
373 global
$tpl, $ilTabs;
375 $ilTabs->activateTab(
"edit");
382 $tpl->setContent($a_form->getHTML());
390 if($form->checkInput())
393 $page->setTitle($form->getInput(
"title"));
397 $ilCtrl->redirect($this,
"preview");
400 $form->setValuesByPost();
408 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
410 $form->setFormAction($ilCtrl->getFormAction($this));
411 $form->setTitle($lng->txt(
'blog_rename_posting'));
414 $title->setRequired(
true);
419 $form->addCommandButton(
'updateTitle', $lng->txt(
'save'));
420 $form->addCommandButton(
'preview', $lng->txt(
'cancel'));
427 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
435 return array(
"deactivatePage" => $lng->txt(
"blog_toggle_draft"),
436 "activatePage" => $lng->txt(
"blog_toggle_final"));
442 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
447 $this->ctrl->redirect($this,
"edit");