33 protected \ILIAS\Notes\Service
$notes;
62 protected \ILIAS\HTTP\Services
$http;
63 protected \ILIAS\DI\UIServices
$ui;
69 int $a_id_type = self::REPOSITORY_NODE_ID,
70 int $a_parent_node_id = 0
75 $this->
help = $DIC[
"ilHelp"];
76 $this->
tabs = $DIC->tabs();
77 $this->nav_history =
$DIC[
"ilNavigationHistory"];
78 $this->
user = $DIC->user();
79 $this->
toolbar = $DIC->toolbar();
80 $this->tree =
$DIC->repositoryTree();
81 $this->
locator = $DIC[
"ilLocator"];
82 $this->rbac_review =
$DIC->rbac()->review();
83 $this->rbacadmin =
$DIC->rbac()->admin();
84 $this->
http = $DIC->http();
85 $this->
ui = $DIC->ui();
88 $ilCtrl =
$DIC->ctrl();
90 $this->blog_request =
$DIC->blog()
97 $this->gtp =
$req->getGotoPage();
98 $this->edt =
$req->getEditing();
99 $this->blpg =
$req->getBlogPage();
100 $this->old_nr =
$req->getOldNr();
101 $this->ppage =
$req->getPPage();
102 $this->user_page =
$req->getUserPage();
103 $this->new_type =
$req->getNewType();
104 $this->prvm =
$req->getPreviewMode();
105 $this->ntf =
$req->getNotification();
106 $this->apid =
$req->getApId();
107 $this->month =
$req->getMonth();
108 $this->keyword =
$req->getKeyword();
109 $this->author =
$req->getAuthor();
110 $this->prt_id =
$req->getPrtId();
112 $this->tool_context =
$DIC->globalScreen()->tool()->context();
116 $blog_page = $this->blog_request->getBlogPage();
117 if ($blog_page > 0 &&
119 throw new ilException(
"Posting ID does not match blog.");
128 if (!$this->month || !$this->items[$this->month]) {
129 $m = array_keys($this->items);
130 $this->month = array_shift($m);
131 $this->month_default =
true;
135 $ilCtrl->setParameter($this,
"bmn", $this->month);
136 $blog_id = $this->
object->getId();
140 $ilCtrl->saveParameter($this,
"prvm");
142 $cs =
$DIC->contentStyle();
143 $this->content_style_gui = $cs->gui();
144 if (is_object($this->
object)) {
145 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
146 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
148 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
152 $this->reading_time_gui = new \ILIAS\Blog\ReadingTime\BlogSettingsGUI($blog_id);
153 $this->reading_time_manager = new \ILIAS\Blog\ReadingTime\ReadingTimeManager();
154 $this->notes =
$DIC->notes();
170 $forms = parent::initCreationForms(
$new_type);
172 if ($this->id_type === self::WORKSPACE_NODE_ID) {
173 unset($forms[self::CFORM_IMPORT], $forms[self::CFORM_CLONE]);
183 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
195 $this->tabs_gui->addSubTab(
197 $this->
lng->txt(
"blog_properties"),
198 $this->ctrl->getLinkTarget($this,
'edit')
201 $this->tabs_gui->addSubTab(
203 $this->
lng->txt(
"obj_sty"),
204 $this->ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
208 if ($this->id_type === self::REPOSITORY_NODE_ID) {
212 if ($grp_ref_id > 0 || $crs_ref_id > 0) {
214 $this->tabs_gui->addSubTab(
216 $this->
lng->txt(
"notifications"),
217 $this->ctrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
223 $this->tabs_gui->activateSubTab($a_active);
235 if ($this->id_type === self::REPOSITORY_NODE_ID) {
237 $appr->setInfo(
$lng->
txt(
"blog_enable_approval_info"));
244 if (
$ilSetting->get(
'enable_global_profiles')) {
246 $rss->setInfo(
$lng->
txt(
"blog_enable_rss_info"));
254 $nav->setTitle(
$lng->
txt(
"blog_settings_navigation"));
258 $nav_mode->setRequired(
true);
262 $opt->setInfo(
$lng->
txt(
"blog_nav_mode_month_list_info"));
263 $nav_mode->addOption($opt);
267 $mon_num->setInfo(
$lng->
txt(
"blog_nav_mode_month_list_num_month_info"));
268 $mon_num->setSize(3);
269 $mon_num->setMinValue(1);
270 $opt->addSubItem($mon_num);
272 $detail_num =
new ilNumberInputGUI(
$lng->
txt(
"blog_nav_mode_month_list_num_month_with_post"),
"nav_list_mon_with_post");
273 $detail_num->setInfo(
$lng->
txt(
"blog_nav_mode_month_list_num_month_with_post_info"));
275 $detail_num->setSize(3);
277 $opt->addSubItem($detail_num);
280 $opt->setInfo(
$lng->
txt(
"blog_nav_mode_month_single_info"));
281 $nav_mode->addOption($opt);
283 $order_options = array();
284 if ($this->
object->getOrder()) {
285 foreach ($this->
object->getOrder() as $item) {
286 $order_options[] =
$lng->
txt(
"blog_" . $item);
290 if (!in_array(
$lng->
txt(
"blog_navigation"), $order_options)) {
291 $order_options[] =
$lng->
txt(
"blog_navigation");
294 if ($this->id_type === self::REPOSITORY_NODE_ID) {
295 if (!in_array(
$lng->
txt(
"blog_authors"), $order_options)) {
296 $order_options[] =
$lng->
txt(
"blog_authors");
300 $auth->setInfo(
$lng->
txt(
"blog_enable_nav_authors_info"));
305 $keyw->setInfo(
$lng->
txt(
"blog_enable_keywords_info"));
308 if (!in_array(
$lng->
txt(
"blog_keywords"), $order_options)) {
309 $order_options[] =
$lng->
txt(
"blog_keywords");
313 $order->setMultiValues($order_options);
314 $order->setValue(array_shift($order_options));
315 $order->setMulti(
true,
true,
false);
322 $pres->setTitle(
$lng->
txt(
"blog_presentation_frame"));
325 if ($this->id_type === self::REPOSITORY_NODE_ID) {
326 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
332 if ($this->id_type === self::REPOSITORY_NODE_ID) {
333 $ppic->setInfo(
$lng->
txt(
"blog_profile_picture_repository_info"));
337 if ($blga_set->get(
"banner")) {
338 $dimensions =
" (" . $blga_set->get(
"banner_width") .
"x" .
339 $blga_set->get(
"banner_height") .
")";
345 $file = $this->
object->getImageFullPath(
true);
351 $this->reading_time_gui->addSettingToForm($a_form);
364 $list->setTitle(
$lng->
txt(
"blog_presentation_overview"));
369 $post_num->setInfo(
$lng->
txt(
"blog_list_num_postings_info"));
370 $post_num->setSize(3);
371 $post_num->setMinValue(1);
372 $post_num->setRequired(
true);
376 $a_form->
addItem($abs_shorten);
379 $abs_shorten_len->setSize(5);
380 $abs_shorten_len->setRequired(
true);
381 $abs_shorten_len->setSuffix(
$lng->
txt(
"blog_abstract_shorten_characters"));
382 $abs_shorten_len->setMinValue(50,
true);
383 $abs_shorten->addSubItem($abs_shorten_len);
386 $abs_img->setInfo(
$lng->
txt(
"blog_abstract_image_info"));
390 $abs_img_width->setSize(5);
391 $abs_img_width->setRequired(
true);
392 $abs_img_width->setSuffix(
$lng->
txt(
"blog_abstract_image_pixels"));
393 $abs_img_width->setMinValue(32,
true);
394 $abs_img->addSubItem($abs_img_width);
397 $abs_img_height->setSize(5);
398 $abs_img_height->setRequired(
true);
399 $abs_img_height->setSuffix(
$lng->
txt(
"blog_abstract_image_pixels"));
400 $abs_img_height->setMinValue(32,
true);
401 $abs_img->addSubItem($abs_img_height);
406 if ($this->id_type === self::REPOSITORY_NODE_ID) {
407 $a_values[
"approval"] = $this->
object->hasApproval();
408 $a_values[
"nav_authors"] = $this->
object->hasAuthors();
410 $a_values[
"keywords"] = $this->
object->hasKeywords();
411 $a_values[
"notes"] = $this->
object->getNotesStatus();
412 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
417 $a_values[
"banner"] = $this->
object->getImage();
418 $a_values[
"rss"] = $this->
object->hasRSS();
419 $a_values[
"abss"] = $this->
object->hasAbstractShorten();
420 $a_values[
"absi"] = $this->
object->hasAbstractImage();
421 $a_values[
"nav"] = $this->
object->getNavMode();
422 $a_values[
"nav_list_mon_with_post"] = $this->
object->getNavModeListMonthsWithPostings();
423 $a_values[
"nav_list_mon"] = $this->
object->getNavModeListMonths();
424 $a_values[
"ov_list_post_num"] = $this->
object->getOverviewPostings();
430 $a_values = $this->reading_time_gui->addValueToArray($a_values);
436 $obj_service = $this->getObjectService();
438 if ($this->id_type === self::REPOSITORY_NODE_ID) {
439 $this->
object->setApproval($form->
getInput(
"approval"));
440 $this->
object->setAuthors($form->
getInput(
"nav_authors"));
441 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
443 $this->
object->setKeywords($form->
getInput(
"keywords"));
444 $this->
object->setNotesStatus($form->
getInput(
"notes"));
445 $this->
object->setProfilePicture($form->
getInput(
"ppic"));
446 $this->
object->setRSS($form->
getInput(
"rss"));
447 $this->
object->setAbstractShorten($form->
getInput(
"abss"));
448 $this->
object->setAbstractShortenLength($form->
getInput(
"abssl"));
449 $this->
object->setAbstractImage($form->
getInput(
"absi"));
450 $this->
object->setAbstractImageWidth($form->
getInput(
"absiw"));
451 $this->
object->setAbstractImageHeight($form->
getInput(
"absih"));
452 $this->
object->setNavMode($form->
getInput(
"nav"));
453 $this->
object->setNavModeListMonthsWithPostings($form->
getInput(
"nav_list_mon_with_post"));
454 $this->
object->setNavModeListMonths($form->
getInput(
"nav_list_mon"));
455 $this->
object->setOverviewPostings($form->
getInput(
"ov_list_post_num"));
456 $this->reading_time_gui->saveSettingFromForm($form);
458 $order = (array) $form->
getInput(
"order");
460 foreach ($order as $idx => $value) {
461 if ($value ==
$lng->txt(
"blog_navigation")) {
462 $order[$idx] =
"navigation";
463 } elseif ($value ==
$lng->txt(
"blog_keywords")) {
464 $order[$idx] =
"keywords";
466 $order[$idx] =
"authors";
469 $this->
object->setOrder($order);
473 if ($_FILES[
"banner"][
"tmp_name"]) {
474 $this->
object->uploadImage($_FILES[
"banner"]);
475 } elseif ($banner->getDeletionFlag()) {
476 $this->
object->deleteImage();
484 $ilHelp = $this->help;
486 if ($this->id_type === self::WORKSPACE_NODE_ID) {
487 $this->
ctrl->setParameter($this,
"wsp_id", $this->node_id);
490 $ilHelp->setScreenIdComponent(
"blog");
492 if ($this->checkPermissionBool(
"read")) {
493 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
494 $this->tabs_gui->addTab(
496 $lng->txt(
"content"),
497 $this->ctrl->getLinkTarget($this,
"")
500 if ($this->checkPermissionBool(
"read") && !$this->prtf_embed) {
501 $this->tabs_gui->addTab(
503 $lng->txt(
"info_short"),
504 $this->ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary")
508 if ($this->checkPermissionBool(
"write")) {
509 $this->tabs_gui->addTab(
511 $lng->txt(
"settings"),
512 $this->ctrl->getLinkTarget($this,
"edit")
515 if (!$this->prtf_embed) {
516 if ($this->id_type === self::REPOSITORY_NODE_ID) {
517 $this->tabs_gui->addTab(
519 $lng->txt(
"blog_contributors"),
520 $this->ctrl->getLinkTarget($this,
"contributors")
524 if ($this->id_type === self::REPOSITORY_NODE_ID) {
525 $this->tabs_gui->addTab(
528 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
534 if (!$this->prtf_embed) {
535 if ($this->mayContribute()) {
536 $this->tabs_gui->addNonTabbedLink(
538 $lng->txt(
"blog_preview"),
539 $this->ctrl->getLinkTarget($this,
"preview")
548 $ilCtrl = $this->ctrl;
550 $ilTabs = $this->tabs;
552 $ilNavigationHistory = $this->nav_history;
555 $next_class = $ilCtrl->getNextClass($this);
557 if ($next_class !==
"ilexportgui") {
558 $this->triggerAssignmentTool();
562 if ($this->gtp > 0) {
563 $page_id = $this->gtp;
566 $ilCtrl->setCmdClass(
"ilblogpostinggui");
567 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $page_id);
568 if ($this->edt ===
"edit") {
569 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
571 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"previewFullscreen");
574 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"blog_posting_not_found"));
579 $cmd = $ilCtrl->getCmd();
582 if (($this->id_type === self::REPOSITORY_NODE_ID) && !$this->getCreationMode() &&
583 $this->getAccessHandler()->checkAccess(
"read",
"", $this->node_id)) {
585 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilObjBlogGUI"],
"preview");
586 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
588 switch ($next_class) {
589 case 'ilblogpostinggui':
590 $this->
ctrl->saveParameter($this,
"user_page");
591 if (!$this->prtf_embed) {
592 $tpl->loadStandardTemplate();
595 if (!$this->checkPermissionBool(
"read") && !$this->prtf_embed) {
596 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_permission"));
601 if ($this->id_type === self::REPOSITORY_NODE_ID) {
605 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
609 $this->getAccessHandler(),
612 ($this->
object->getNotesStatus() && !$this->disable_notes),
613 $this->mayEditPosting($this->blpg),
620 case "previewFullscreen":
621 $ilCtrl->setParameter($this,
"prvm",
"fsc");
625 case "previewEmbedded":
626 $ilCtrl->setParameter($this,
"prvm",
"emb");
631 $this->setContentStyleSheet();
634 if (!$this->prtf_embed) {
635 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
636 $this->tabs_gui->addNonTabbedLink(
638 $lng->txt(
"blog_preview"),
639 $this->ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen")
641 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
643 $this->
ctrl->setParameterByClass(
"ilobjportfoliogui",
"user_page", $this->ppage);
644 $this->tabs_gui->addNonTabbedLink(
646 $lng->txt(
"blog_preview"),
647 $this->ctrl->getLinkTargetByClass(
"ilobjportfoliogui",
"preview")
649 $this->
ctrl->setParameterByClass(
"ilobjportfoliogui",
"user_page",
"");
656 $cmd =
"preview" . (($this->prvm ===
"fsc") ?
"Fullscreen" :
"Embedded");
658 if (in_array($cmd, array(
"previewFullscreen",
"previewEmbedded"))) {
659 $this->renderToolbarNavigation($this->items,
true);
661 $ret = $ilCtrl->forwardCommand($bpost_gui);
662 if (!$ilTabs->back_target) {
663 $ilCtrl->setParameter($this,
"bmn",
"");
664 $ilTabs->setBackTarget(
666 $ilCtrl->getLinkTarget($this,
"")
673 $is_owner = $this->mayContribute();
674 $is_active = $bpost_gui->getBlogPosting()->getActive();
677 if (($cmd ===
"previewFullscreen" || $cmd ===
"previewEmbedded")
678 && !$is_owner && !$is_active) {
679 $this->
ctrl->redirect($this,
"preview");
684 case "previewFullscreen":
685 $this->addHeaderActionForCommand($cmd);
686 $this->filterInactivePostings();
687 $nav = $this->renderNavigation(
"preview", $cmd);
688 $this->renderFullScreen($ret, $nav);
692 case "previewEmbedded":
693 $this->addHeaderActionForCommand($cmd);
694 $this->filterInactivePostings();
695 $nav = $this->renderNavigation(
"gethtml", $cmd);
697 $this->rendered_content = $this->buildEmbedded($ret, $nav);
706 if ($this->id_type === self::WORKSPACE_NODE_ID) {
707 $info[] =
$lng->txt(
"blog_draft_info");
709 $info[] =
$lng->txt(
"blog_draft_info_contributors");
712 $public_action =
false;
713 if ($cmd !==
"history" && $cmd !==
"edit" && $is_active && empty($info)) {
714 $info[] =
$lng->txt(
"blog_new_posting_info");
715 $public_action =
true;
717 if ($this->
object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
719 $info[] =
$lng->txt(
"blog_posting_edit_approval_info");
721 if ($public_action) {
722 $this->tpl->setOnScreenMessage(
'success', implode(
"<br />", $info));
724 if (count($info) > 0) {
725 $this->tpl->setOnScreenMessage(
'info', implode(
"<br />", $info));
730 $tpl->setContent($ret);
731 if ($cmd !==
"edit") {
732 $this->addHeaderActionForCommand(
"render");
733 $nav = $this->renderNavigation(
"render", $cmd,
"", $is_owner);
734 $tpl->setRightContent($nav);
736 $this->
tabs->setBackTarget(
"",
"");
743 case "ilinfoscreengui":
744 $this->prepareOutput();
745 $this->addHeaderActionForCommand(
"render");
746 $this->infoScreenForward();
753 case "ilcommonactiondispatchergui":
755 $gui->enableCommentsSettings(
false);
756 $this->prepareOutput();
757 $this->
ctrl->forwardCommand($gui);
760 case "ilpermissiongui":
761 $this->prepareOutput();
762 $ilTabs->activateTab(
"id_permissions");
764 $this->
ctrl->forwardCommand($perm_gui);
767 case "ilobjectcopygui":
768 $this->prepareOutput();
770 $cp->setType(
"blog");
771 $this->
ctrl->forwardCommand($cp);
774 case 'ilrepositorysearchgui':
775 $this->prepareOutput();
776 $ilTabs->activateTab(
"contributors");
778 $rep_search->setTitle($this->
lng->txt(
"blog_add_contributor"));
779 $rep_search->setCallback($this,
'addContributor', $this->
object->getAllLocalRoles($this->node_id));
780 $this->
ctrl->setReturn($this,
'contributors');
781 $this->
ctrl->forwardCommand($rep_search);
785 $this->prepareOutput();
786 $ilTabs->activateTab(
"export");
788 $exp_gui->addFormat(
"xml");
789 $exp_gui->addFormat(
"html",
"", $this,
"buildExportFile");
791 $exp_gui->addFormat(
"html_comments",
"HTML (" . $this->
lng->txt(
"blog_incl_comments") .
")", $this,
"buildExportFile");
793 $ilCtrl->forwardCommand($exp_gui);
796 case "ilobjectcontentstylesettingsgui":
797 $this->checkPermission(
"write");
798 $this->prepareOutput();
799 $this->addHeaderAction();
800 $ilTabs->activateTab(
"settings");
801 $this->setSettingsSubTabs(
"style");
804 if ($this->id_type === self::REPOSITORY_NODE_ID) {
805 $settings_gui = $this->content_style_gui
806 ->objectSettingsGUIForRefId(
811 $settings_gui = $this->content_style_gui
812 ->objectSettingsGUIForObjId(
817 $this->
ctrl->forwardCommand($settings_gui);
821 case "ilblogexercisegui":
822 $this->
ctrl->setReturn($this,
"render");
824 $this->
ctrl->forwardCommand($gui);
827 case 'ilobjnotificationsettingsgui':
828 $this->prepareOutput();
829 $ilTabs->activateTab(
"settings");
830 $this->setSettingsSubTabs(
"notifications");
832 $this->
ctrl->forwardCommand($gui);
836 if ($cmd !==
"gethtml") {
838 if ($cmd ===
"addToDesk" || $cmd ===
"removeFromDesk") {
839 $this->{$cmd .
"Object"}();
845 $ilCtrl->setCmd($cmd);
847 $this->addHeaderActionForCommand($cmd);
849 if (!$this->prtf_embed) {
850 parent::executeCommand();
859 $this->rendered_content = (string) $this->$cmd();
865 return $this->rendered_content;
872 $assignments = $be->getAssignmentsOfBlog();
873 if (count($assignments) > 0) {
874 $ass_ids = array_map(
static function (
$i) {
879 $this->tool_context->current()->addAdditionalData(
881 $be_gui->getActionButtons()
891 $this->
ctrl->setCmd(
"showSummary");
892 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
893 $this->infoScreenForward();
898 $ilTabs = $this->tabs;
900 $ilTabs->activateTab(
"id_info");
902 $this->checkPermission(
"visible");
906 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
907 $info->enablePrivateNotes();
910 if ($this->checkPermissionBool(
"read")) {
915 $info->enableNewsEditing(
false);
916 if ($this->checkPermissionBool(
"write")) {
918 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
920 if ($enable_internal_rss) {
921 $info->setBlockProperty(
"news",
"settings",
true);
922 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
927 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
929 if ($this->id_type === self::WORKSPACE_NODE_ID) {
930 $info->addProperty($this->
lng->txt(
"perma_link"), $this->getPermanentLinkWidget());
933 $this->
ctrl->forwardCommand($info);
941 $ilCtrl = $this->ctrl;
944 $title = $this->blog_request->getTitle();
948 $posting->setTitle($title);
949 $posting->setBlogId($this->
object->getId());
950 $posting->setActive(
false);
951 $posting->setAuthor(
$ilUser->getId());
952 $posting->create(
false);
955 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
957 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
958 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
960 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_title"),
true);
961 $ilCtrl->redirect($this,
"render");
971 $ilTabs = $this->tabs;
972 $ilCtrl = $this->ctrl;
976 if (!$this->checkPermissionBool(
"read")) {
977 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_permission"));
981 $ilTabs->activateTab(
"content");
984 if ($this->mayContribute()) {
985 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
989 $ilToolbar->addStickyItem($title,
$lng->txt(
"title"));
990 $tpl->addOnLoadCode(
"
991 document.getElementById('title').setAttribute('data-blog-input', 'posting-title');
992 document.getElementById('title').setAttribute('placeholder', ' ');
996 $button->setCaption(
"blog_add_posting");
997 $button->setCommand(
"createPosting");
998 $ilToolbar->addStickyItem($button);
1001 $keys = array_keys($this->items);
1002 $first = array_shift(
$keys);
1003 if ($first != $this->month) {
1004 $ilToolbar->addSeparator();
1006 $ilCtrl->setParameter($this,
"bmn", $first);
1007 $url = $ilCtrl->getLinkTarget($this,
"");
1008 $ilCtrl->setParameter($this,
"bmn", $this->month);
1011 $button->setCaption(
"blog_show_latest");
1012 $button->setUrl(
$url);
1013 $ilToolbar->addButtonInstance($button);
1017 $print_view = $this->getPrintView();
1018 $modal_elements = $print_view->getModalElements(
1019 $this->
ctrl->getLinkTarget(
1021 "printViewSelection"
1024 $ilToolbar->addSeparator();
1025 $ilToolbar->addComponent($modal_elements->button);
1026 $ilToolbar->addComponent($modal_elements->modal);
1030 $is_owner = $this->mayContribute();
1032 $list_items = $this->getListItems($is_owner);
1036 $list = $this->renderList($list_items,
"preview",
"", $is_owner);
1037 $nav = $this->renderNavigation(
"render",
"edit",
"", $is_owner);
1040 $this->setContentStyleSheet();
1042 $tpl->setContent($ilToolbar->getHTML() . $list);
1043 $tpl->setRightContent($nav);
1052 $ilCtrl = $this->ctrl;
1056 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1062 $this->filterInactivePostings();
1064 $list_items = $this->getListItems();
1068 $list = $this->renderList($list_items,
"previewEmbedded");
1069 $nav = $this->renderNavigation(
"gethtml",
"previewEmbedded");
1072 elseif ($this->prt_id) {
1076 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", $this->user_page);
1077 $link = $ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1078 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1080 $this->
toolbar->addComponent($this->
ui->factory()->button()->standard(
1081 $this->lng->txt(
"blog_edit"),
1087 return $this->buildEmbedded($list, $nav);
1094 bool $a_show_inactive =
false
1096 if ($this->author) {
1097 $list_items = array();
1098 foreach ($this->items as $month => $items) {
1099 foreach ($items as
$id => $item) {
1100 if ($item[
"author"] == $this->author ||
1101 (isset($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
1102 $list_items[
$id] = $item;
1106 } elseif ($this->keyword) {
1107 $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1109 $max = $this->
object->getOverviewPostings();
1110 if ($this->month_default && $max) {
1111 $list_items = array();
1112 foreach ($this->items as $month => $postings) {
1113 foreach ($postings as
$id => $item) {
1114 if (!$a_show_inactive &&
1118 $list_items[
$id] = $item;
1120 if (count($list_items) >= $max) {
1126 $list_items = $this->items[$this->month] ?? [];
1140 $toolbar =
$DIC->toolbar();
1142 if (!$this->checkPermissionBool(
"read")) {
1143 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_permission"));
1147 $this->filterInactivePostings();
1149 $list_items = $this->getListItems();
1153 $list = $this->renderList($list_items,
"previewFullscreen");
1154 $nav = $this->renderNavigation(
"preview",
"previewFullscreen");
1155 $this->renderToolbarNavigation($this->items);
1156 $list .= $toolbar->getHTML();
1159 $this->renderFullScreen($list, $nav);
1166 bool $a_with_comments =
false
1168 $zip = $this->buildExportFile($a_with_comments);
1184 $wtpl->setVariable(
"VAL_NAVIGATION", $a_nav);
1185 return $wtpl->get();
1193 string $a_navigation
1197 $ilTabs = $this->tabs;
1198 $ilLocator = $this->locator;
1200 $owner = $this->
object->getOwner();
1202 $ilTabs->clearTargets();
1209 if ($owner ===
$ilUser->getId()) {
1211 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1212 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" . $this->node_id;
1215 elseif ($this->mayContribute()) {
1216 $this->
ctrl->setParameter($this,
"prvm",
"");
1217 if ($this->blpg === 0) {
1218 $back = $this->
ctrl->getLinkTarget($this,
"");
1220 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1221 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
1222 $back = $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
1224 $this->
ctrl->setParameter($this,
"prvm", $this->prvm);
1227 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
1232 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1233 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1236 elseif ($this->mayContribute()) {
1237 $back = $this->
ctrl->getLinkTarget($this,
"");
1238 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
1242 $tree = $this->tree;
1243 $parent_id = $tree->getParentId($this->node_id);
1248 $this->renderFullscreenHeader(
$tpl, $owner);
1251 $this->
ctrl->setParameter($this,
"bmn",
"");
1253 $this->
ctrl->setParameter($this,
"bmn", $this->month);
1255 $this->setContentStyleSheet();
1258 $tpl->setContent($a_content);
1259 $tpl->setRightContent($a_navigation);
1268 bool $a_export =
false
1274 $this->
object->getType(),
1276 $this->object->getId(),
1283 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
1292 $banner_height =
"";
1293 if ($blga_set->get(
"banner")) {
1295 $banner_width = $blga_set->get(
"banner_width");
1296 $banner_height = $blga_set->get(
"banner_height");
1298 $banner = basename($banner);
1303 if ($this->
object->hasProfilePicture()) {
1305 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1307 if ($this->blpg > 0 && !$a_export) {
1309 $author_id =
$post->getAuthor();
1322 $ppic = basename($ppic);
1328 $a_tpl->setBanner($banner);
1331 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1344 $author_found = false;
1348 if ($this->author &&
1349 ($posting[
"author"] == $this->author ||
1350 (is_array($posting[
"editors"] ??
false) && in_array($this->author, $posting[
"editors"])))) {
1351 $author_found =
true;
1354 $month = substr($posting[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1355 $items[$month][$posting[
"id"]] = $posting;
1358 if ($this->author && !$author_found) {
1359 $this->author =
null;
1370 string $a_cmd =
"preview",
1371 string $a_link_template =
"",
1372 bool $a_show_inactive =
false,
1373 string $a_export_directory =
""
1376 $ilCtrl = $this->ctrl;
1379 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"Modules/Blog");
1382 if ($this->prt_id > 0 &&
1385 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage", $this->user_page);
1386 $link = $ilCtrl->getLinkTargetByClass(array(
"ilportfoliopagegui",
"ilobjbloggui"),
"render");
1387 $ilCtrl->setParameterByClass(
"ilportfoliopagegui",
"ppage",
"");
1388 $b = $this->
ui->factory()->button()->standard(
1389 $this->
lng->txt(
"blog_edit"),
1395 $is_admin = $this->isAdmin();
1399 foreach ($items as $item) {
1402 if (!$is_active && !$a_show_inactive) {
1409 if (!$this->keyword && !$this->author) {
1410 $month = substr($item[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1413 if (!$last_month || $last_month != $month) {
1415 $wtpl->setCurrentBlock(
"month_bl");
1416 $wtpl->parseCurrentBlock();
1420 if ($this->keyword) {
1421 $title =
$lng->txt(
"blog_keyword") .
": " . $this->keyword;
1422 } elseif ($this->author) {
1426 " " . substr($month, 0, 4);
1428 $last_month = $month;
1431 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1434 if (!$a_link_template) {
1435 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1436 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1437 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1439 $preview = $this->buildExportLink($a_link_template,
"posting", $item[
"id"]);
1444 $posting_edit = $this->mayEditPosting($item[
"id"], $item[
"author"]);
1445 if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd ===
"preview") {
1447 $alist->setId($item[
"id"]);
1448 $alist->setListTitle(
$lng->txt(
"actions"));
1450 if ($is_active && $this->
object->hasApproval() && !$item[
"approved"]) {
1452 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1454 $lng->txt(
"blog_approve"),
1456 $ilCtrl->getLinkTarget($this,
"approve")
1458 $ilCtrl->setParameter($this,
"apid",
"");
1461 $wtpl->setVariable(
"APPROVAL",
$lng->txt(
"blog_needs_approval"));
1464 if ($posting_edit) {
1466 $lng->txt(
"edit_content"),
1468 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit")
1470 $more_link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1475 $lng->txt(
"blog_toggle_draft"),
1477 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList")
1481 $lng->txt(
"blog_toggle_final"),
1483 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList")
1488 $lng->txt(
"rename"),
1490 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle")
1493 if ($this->
object->hasKeywords()) {
1495 $lng->txt(
"blog_edit_keywords"),
1497 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords")
1502 $lng->txt(
"blog_edit_date"),
1504 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate")
1507 $lng->txt(
"delete"),
1509 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1511 } elseif ($is_admin) {
1514 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1516 $lng->txt(
"blog_toggle_draft_admin"),
1518 $ilCtrl->getLinkTarget($this,
"deactivateAdmin")
1520 $ilCtrl->setParameter($this,
"apid",
"");
1524 $lng->txt(
"delete"),
1526 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1530 $wtpl->setCurrentBlock(
"actions");
1531 $wtpl->setVariable(
"ACTION_SELECTOR", $alist->getHTML());
1532 $wtpl->parseCurrentBlock();
1536 if ($this->
object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
1538 $notes_context = $this->notes
1545 $count = $this->notes
1547 ->getNrOfCommentsForContext($notes_context);
1549 if ($a_cmd !==
"preview") {
1550 $wtpl->setCurrentBlock(
"comments");
1551 $wtpl->setVariable(
"TEXT_COMMENTS",
$lng->txt(
"blog_comments"));
1552 $wtpl->setVariable(
"URL_COMMENTS",
$preview);
1553 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1554 $wtpl->parseCurrentBlock();
1559 if ($a_cmd !==
"preview" && $a_cmd !==
"previewEmbedded") {
1560 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1561 $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id,
"_" . $item[
"id"]);
1565 $wtpl->setCurrentBlock(
"permalink");
1566 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1567 $wtpl->setVariable(
"TEXT_PERMALINK",
$lng->txt(
"blog_link"));
1568 $wtpl->parseCurrentBlock();
1573 $this->
object->hasAbstractShorten(),
1574 $this->object->getAbstractShortenLength(),
1576 $this->object->hasAbstractImage(),
1577 $this->object->getAbstractImageWidth(),
1578 $this->object->getAbstractImageHeight(),
1583 $wtpl->setCurrentBlock(
"more");
1584 $wtpl->setVariable(
"URL_MORE", $more_link);
1585 $wtpl->setVariable(
"TEXT_MORE",
$lng->txt(
"blog_list_more"));
1586 $wtpl->parseCurrentBlock();
1592 $wtpl->setCurrentBlock(
"draft_text");
1593 $wtpl->setVariable(
"DRAFT_TEXT",
$lng->txt(
"blog_draft_text"));
1594 $wtpl->parseCurrentBlock();
1595 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1599 $reading_time = $this->reading_time_manager->getReadingTime(
1603 if (!is_null($reading_time)) {
1604 $this->
lng->loadLanguageModule(
"copg");
1605 $wtpl->setCurrentBlock(
"reading_time");
1608 $this->
lng->txt(
"copg_est_reading_time") .
": " .
1609 sprintf($this->
lng->txt(
"copg_x_minutes"), $reading_time)
1611 $wtpl->parseCurrentBlock();
1614 $wtpl->setCurrentBlock(
"posting");
1617 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1620 $author_id = $item[
"author"];
1625 if (isset($item[
"editors"])) {
1626 foreach ($item[
"editors"] as $editor_id) {
1632 $author = implode(
", ", $authors) .
" - ";
1637 $wtpl->setVariable(
"URL_TITLE",
$preview);
1638 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1642 $keywords = (count($kw) > 0)
1643 ?
"<br>" . $this->
lng->txt(
"keywords") .
": " . implode(
", ", $kw)
1646 $wtpl->setVariable(
"DATETIME", $author .
1650 $wtpl->setVariable(
"CONTENT", $snippet);
1652 $wtpl->parseCurrentBlock();
1656 if ($a_cmd ===
"previewFullscreen") {
1657 $this->tpl->setPermanentLink(
1660 ($this->id_type === self::WORKSPACE_NODE_ID)
1666 if (!$is_empty || $a_show_inactive) {
1667 return $wtpl->get();
1680 return \
ILIAS\Blog\Export\BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->getKeywords(false));
1689 string $a_list_cmd =
"render",
1690 string $a_posting_cmd =
"preview",
1691 ?
string $a_link_template =
null,
1692 bool $a_show_inactive =
false,
1695 $ilCtrl = $this->
ctrl;
1697 $blpg = ($a_blpg > 0)
1703 foreach ($a_items as $month => $postings) {
1704 foreach (array_keys($postings) as
$id) {
1706 if (!$a_show_inactive && !$active) {
1707 unset($a_items[$month][
$id]);
1709 $a_items[$month][
$id][
"active"] = $active;
1712 if (!count($a_items[$month])) {
1713 unset($a_items[$month]);
1720 $max_months = $this->
object->getNavModeListMonths();
1722 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"Modules/Blog");
1724 $ilCtrl->setParameter($this,
"blpg",
"");
1726 $counter = $mon_counter = $last_year = 0;
1727 foreach ($a_items as $month => $postings) {
1728 if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1733 $year = substr($month, 0, 4);
1734 if (!$last_year || $year != $last_year) {
1744 if (!$a_link_template) {
1745 $ilCtrl->setParameter($this,
"bmn", $month);
1746 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1748 $month_url = $this->buildExportLink($a_link_template,
"list", $month);
1753 if ($mon_counter <= $this->
object->getNavModeListMonthsWithPostings()) {
1755 $wtpl->setCurrentBlock(
"navigation_year_details");
1756 $wtpl->setVariable(
"YEAR", $year);
1757 $wtpl->parseCurrentBlock();
1760 foreach ($postings as
$id => $posting) {
1771 if (!$a_link_template) {
1772 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1773 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1774 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1776 $url = $this->buildExportLink($a_link_template,
"posting",
$id);
1779 if (!$posting[
"active"]) {
1780 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1781 } elseif ($this->
object->hasApproval() && !$posting[
"approved"]) {
1782 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1785 $wtpl->setCurrentBlock(
"navigation_item");
1786 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1787 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1788 $wtpl->parseCurrentBlock();
1791 $wtpl->setCurrentBlock(
"navigation_month_details");
1792 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1793 $wtpl->setVariable(
"URL_MONTH", $month_url);
1798 $wtpl->setCurrentBlock(
"navigation_year");
1799 $wtpl->setVariable(
"YEAR", $year);
1800 $wtpl->parseCurrentBlock();
1803 $wtpl->setCurrentBlock(
"navigation_month");
1804 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1805 $wtpl->setVariable(
"URL_MONTH", $month_url);
1806 $wtpl->setVariable(
"MONTH_COUNT", count($postings));
1808 $wtpl->parseCurrentBlock();
1811 if (!$a_link_template) {
1812 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
1813 $url = $this->
ctrl->getLinkTargetByClass(self::class, $a_list_cmd);
1815 $url =
"index.html";
1819 $this->
ui->renderer()->render(
1820 $this->ui->factory()->link()->standard(
1821 $this->lng->txt(
"blog_starting_page"),
1829 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"Modules/Blog");
1831 $ilCtrl->setParameter($this,
"blpg",
"");
1833 $month_options = array();
1834 foreach ($a_items as $month => $postings) {
1836 " " . substr($month, 0, 4);
1838 $month_options[$month] = $month_name;
1840 if ($month == $this->month) {
1841 if (!$a_link_template) {
1842 $ilCtrl->setParameter($this,
"bmn", $month);
1843 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1845 $month_url = $this->buildExportLink($a_link_template,
"list", $month);
1848 foreach ($postings as
$id => $posting) {
1852 if (!$a_link_template) {
1853 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1854 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1855 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1857 $url = $this->buildExportLink($a_link_template,
"posting",
$id);
1860 if (!$posting[
"active"]) {
1861 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1862 } elseif ($this->
object->hasApproval() && !$posting[
"approved"]) {
1863 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1866 $wtpl->setCurrentBlock(
"navigation_item");
1867 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1868 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1869 $wtpl->parseCurrentBlock();
1872 $wtpl->setCurrentBlock(
"navigation_month_details");
1874 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1875 $wtpl->setVariable(
"URL_MONTH", $month_url);
1877 $wtpl->parseCurrentBlock();
1882 $wtpl->setCurrentBlock(
"option_bl");
1883 foreach ($month_options as $value => $caption) {
1884 $wtpl->setVariable(
"OPTION_VALUE", $value);
1885 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1886 if ($value == $this->month) {
1887 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1889 $wtpl->parseCurrentBlock();
1892 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1895 $ilCtrl->setParameter($this,
"bmn", $this->month);
1896 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1897 return $wtpl->get();
1904 string $a_list_cmd =
"render",
1905 bool $a_show_inactive =
false,
1906 string $a_link_template =
"",
1909 $ilCtrl = $this->
ctrl;
1911 $blpg = ($a_blpg > 0)
1915 $keywords = $this->getKeywords($a_show_inactive, $blpg);
1917 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"Modules/Blog");
1919 $max = max($keywords);
1921 $wtpl->setCurrentBlock(
"keyword");
1922 foreach ($keywords as $keyword => $counter) {
1923 if (!$a_link_template) {
1924 $ilCtrl->setParameter($this,
"kwd", urlencode((
string) $keyword));
1925 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1926 $ilCtrl->setParameter($this,
"kwd",
"");
1928 $url = $this->buildExportLink($a_link_template,
"keyword", $keyword);
1931 $wtpl->setVariable(
"TXT_KEYWORD", $keyword);
1933 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1934 $wtpl->parseCurrentBlock();
1937 return $wtpl->get();
1944 string $a_list_cmd =
"render",
1945 bool $a_show_inactive =
false
1947 $ilCtrl = $this->
ctrl;
1950 foreach ($a_items as $month => $items) {
1951 foreach ($items as $item) {
1953 if ($item[
"author"]) {
1954 $authors[] = $item[
"author"];
1957 if (isset($item[
"editors"])) {
1958 foreach ($item[
"editors"] as $editor_id) {
1959 if ($editor_id != $item[
"author"]) {
1960 $authors[] = $editor_id;
1968 $authors = array_unique($authors);
1971 $authors = array_filter($authors,
function (
$id) {
1975 if (count($authors) > 1) {
1977 foreach ($authors as $user_id) {
1979 $ilCtrl->setParameter($this,
"ath", $user_id);
1980 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1981 $ilCtrl->setParameter($this,
"ath",
"");
1984 if (substr($base_name, 0, 1) ==
"[") {
1998 $sort = $name_arr[
"lastname"] .
" " . $name_arr[
"firstname"];
2001 $idx = trim(strip_tags($sort)) .
"///" . $user_id;
2007 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"Modules/Blog");
2009 $wtpl->setCurrentBlock(
"author");
2010 foreach ($list as $author) {
2011 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
2012 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
2013 $wtpl->parseCurrentBlock();
2016 return $wtpl->get();
2026 bool $single_posting =
false
2030 $toolbar =
$DIC->toolbar();
2032 $ctrl =
$DIC->ctrl();
2034 $f =
$DIC->ui()->factory();
2036 $cmd = ($this->prtf_embed)
2038 :
"previewFullscreen";
2040 if ($single_posting) {
2041 $latest_posting = $this->getLatestPosting($a_items);
2042 if ($latest_posting > 0 && $this->blpg !== $latest_posting) {
2043 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $latest_posting);
2044 $mb =
$f->button()->standard(
2045 $lng->txt(
"blog_latest_posting"),
2046 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2049 $mb =
$f->button()->standard(
$lng->txt(
"blog_latest_posting"),
"#")->withUnavailableAction();
2052 $prev_posting = $this->getPreviousPosting($a_items);
2053 if ($prev_posting > 0) {
2054 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $prev_posting);
2055 $pb =
$f->button()->standard(
2056 $lng->txt(
"previous"),
2057 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2060 $pb =
$f->button()->standard(
$lng->txt(
"previous"),
"#")->withUnavailableAction();
2063 $next_posting = $this->getNextPosting($a_items);
2064 if ($next_posting > 0) {
2065 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $next_posting);
2066 $nb =
$f->button()->standard(
2068 $ctrl->getLinkTargetByClass(
"ilblogpostinggui", $cmd)
2071 $nb =
$f->button()->standard(
$lng->txt(
"next"),
"#")->withUnavailableAction();
2073 $ctrl->setParameter($this,
"blpg", $this->blpg);
2074 $vc =
$f->viewControl()->section($pb, $mb, $nb);
2075 $toolbar->addComponent($vc);
2076 if ($this->mayContribute() && $this->mayEditPosting($this->blpg)) {
2077 $ctrl->setParameter($this,
"prvm",
"");
2080 $ctrl->setParameter($this,
"bmn",
"");
2081 $ctrl->setParameter($this,
"blpg",
"");
2082 $link = $ctrl->getLinkTarget($this,
"");
2083 $ctrl->setParameter($this,
"blpg", $this->blpg);
2084 $ctrl->setParameter($this,
"bmn", $this->month);
2085 $toolbar->addSeparator();
2086 $toolbar->addComponent(
$f->button()->standard(
$lng->txt(
"blog_edit"), $link));
2089 $ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
2093 $link = $ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2094 $toolbar->addComponent(
$f->button()->standard(
$lng->txt(
"blog_edit_posting"), $link));
2097 $latest_month = $this->getLatestMonth($a_items);
2098 if ($latest_month !==
"" && $this->month !== $latest_month) {
2099 $ctrl->setParameter($this,
"bmn", $latest_month);
2100 $mb =
$f->button()->standard(
2101 $lng->txt(
"blog_latest_posting"),
2102 $ctrl->getLinkTarget($this,
"preview")
2105 $mb =
$f->button()->standard(
$lng->txt(
"blog_latest_posting"),
"#")->withUnavailableAction();
2108 $prev_month = $this->getPreviousMonth($a_items);
2109 if ($prev_month !==
"") {
2110 $ctrl->setParameter($this,
"bmn", $prev_month);
2111 $pb =
$f->button()->standard(
$lng->txt(
"previous"), $ctrl->getLinkTarget($this,
"preview"));
2113 $pb =
$f->button()->standard(
$lng->txt(
"previous"),
"#")->withUnavailableAction();
2116 $next_month = $this->getNextMonth($a_items);
2117 if ($next_month !==
"") {
2118 $ctrl->setParameter($this,
"bmn", $next_month);
2119 $nb =
$f->button()->standard(
$lng->txt(
"next"), $ctrl->getLinkTarget($this,
"preview"));
2121 $nb =
$f->button()->standard(
$lng->txt(
"next"),
"#")->withUnavailableAction();
2123 $ctrl->setParameter($this,
"bmn", $this->month);
2124 $vc =
$f->viewControl()->section($pb, $mb, $nb);
2125 $toolbar->addComponent($vc);
2127 if ($this->mayContribute()) {
2128 $ctrl->setParameter($this,
"prvm",
"");
2130 $ctrl->setParameter($this,
"bmn",
"");
2131 $ctrl->setParameter($this,
"blpg",
"");
2132 $link = $ctrl->getLinkTarget($this,
"");
2133 $ctrl->setParameter($this,
"blpg", $this->blpg);
2134 $ctrl->setParameter($this,
"bmn", $this->month);
2135 $toolbar->addSeparator();
2136 $toolbar->addComponent(
$f->button()->standard(
$lng->txt(
"blog_edit"), $link));
2149 foreach ($a_items as $month => $items) {
2150 if ($month > $this->month) {
2162 foreach ($a_items as $month => $items) {
2163 if ($month < $this->month && $found ===
"") {
2177 return key($a_items);
2191 foreach ($a_items as $month => $items) {
2192 foreach ($items as $item) {
2193 if ($item[
"id"] == $this->blpg) {
2197 $next_blpg = (
int) $item[
"id"];
2215 foreach ($a_items as $month => $items) {
2216 foreach ($items as $item) {
2217 if ($found && $prev_blpg === 0) {
2218 $prev_blpg = (
int) $item[
"id"];
2220 if ((
int) $item[
"id"] === $this->blpg) {
2237 $month = current($a_items);
2238 if (is_array($month)) {
2239 return (
int) current($month)[
"id"];
2248 string $a_list_cmd =
"render",
2249 string $a_posting_cmd =
"preview",
2250 string $a_link_template =
null,
2251 bool $a_show_inactive =
false,
2255 $a_items = $this->items;
2257 $blpg = ($a_blpg > 0)
2261 if ($this->
object->getOrder()) {
2262 $order = array_flip($this->
object->getOrder());
2271 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"Modules/Blog");
2276 if (count($a_items)) {
2277 $blocks[$order[
"navigation"]] = array(
2278 $this->
lng->txt(
"blog_navigation"),
2279 $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
2283 if ($this->
object->hasKeywords()) {
2285 $may_edit_keywords = ($blpg > 0 &&
2286 $this->mayEditPosting($blpg) &&
2287 $a_list_cmd !==
"preview" &&
2288 $a_list_cmd !==
"gethtml" &&
2290 $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, (
bool) $a_link_template, $a_blpg);
2291 if ($keywords || $may_edit_keywords) {
2293 $keywords = $this->
lng->txt(
"blog_no_keywords");
2296 $blocks[$order[
"keywords"]] = array(
2297 $this->
lng->txt(
"blog_keywords"),
2300 ? array($cmd, $this->
lng->txt(
"blog_edit_keywords"))
2307 if (!$a_link_template) {
2309 if ($this->id_type === self::REPOSITORY_NODE_ID &&
2310 $this->
object->hasAuthors()) {
2311 $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2313 $blocks[$order[
"authors"]] = array($this->
lng->txt(
"blog_authors"), $authors);
2318 if ($this->
object->hasRSS() &&
2320 $a_list_cmd ===
"preview") {
2322 $blog_id = $this->node_id;
2323 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
2326 $url = ILIAS_HTTP_PATH .
"/feed.php?blog_id=" . $blog_id .
2327 "&client_id=" . rawurlencode(
CLIENT_ID);
2333 if (count($blocks)) {
2336 $ui_factory =
$DIC->ui()->factory();
2337 $ui_renderer =
$DIC->ui()->renderer();
2340 foreach ($blocks as $block) {
2343 $content = $block[1];
2345 $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy($content));
2347 if (isset($block[2]) && is_array($block[2])) {
2348 $link = $ui_factory->button()->shy($block[2][1], $block[2][0]);
2349 $secondary_panel = $secondary_panel->withFooter($link);
2352 $wtpl->setCurrentBlock(
"block_bl");
2353 $wtpl->setVariable(
"BLOCK", $ui_renderer->render($secondary_panel));
2354 $wtpl->parseCurrentBlock();
2358 return $wtpl->get();
2365 bool $a_show_inactive,
2366 ?
int $a_posting_id =
null
2368 $keywords = array();
2369 if ($a_posting_id) {
2371 if (isset($keywords[$keyword])) {
2372 $keywords[$keyword]++;
2374 $keywords[$keyword] = 1;
2378 foreach ($this->items as $month => $items) {
2379 foreach ($items as $item) {
2382 if (isset($keywords[$keyword])) {
2383 $keywords[$keyword]++;
2385 $keywords[$keyword] = 1;
2395 foreach ($keywords as $keyword => $counter) {
2396 $tmp[] = array(
"keyword" => $keyword,
"counter" => $counter);
2400 $keywords = array();
2401 foreach ($tmp as $item) {
2402 $keywords[(string) $item[
"keyword"]] = $item[
"counter"];
2411 bool $a_include_comments =
false,
2412 bool $print_version =
false
2415 $format = explode(
"_", $this->blog_request->getFormat());
2416 if ((
$format[1] ??
"") ===
"comments" || $a_include_comments) {
2417 $a_include_comments =
true;
2418 $type =
"html_comments";
2425 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
2426 if ($print_version) {
2430 $blog_export = new \ILIAS\Blog\Export\BlogHtmlExport($this, $exp_dir, $subdir);
2431 $blog_export->setPrintVersion($print_version);
2432 $blog_export->includeComments($a_include_comments);
2433 return $blog_export->exportHTML();
2443 $this->disable_notes = $a_value;
2450 $ilCtrl = $this->ctrl;
2452 if ($a_cmd ===
"preview" || $a_cmd ===
"previewEmbedded" || $a_cmd ===
"previewFullscreen" || $this->prvm) {
2456 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2458 $this->insertHeaderAction($this->initHeaderAction(
null,
null,
true));
2460 $ilCtrl->setParameter($this,
"prvm",
"");
2464 $this->addHeaderAction();
2469 ?
string $sub_type =
null,
2470 ?
int $sub_id =
null,
2471 bool $is_preview =
false
2474 $ilCtrl = $this->ctrl;
2475 if (!$this->obj_id) {
2478 $sub_type = $sub_id =
null;
2479 if ($this->blpg > 0) {
2481 $sub_id = $this->blpg;
2484 $lg = parent::initHeaderAction($sub_type, $sub_id);
2488 $lg->enableComments(
false);
2489 $lg->enableNotes(
false);
2492 if ($this->blpg > 0) {
2493 if (($this->
object->getNotesStatus() && !$this->disable_notes)) {
2494 $lg->enableComments(
true);
2496 $lg->enableNotes(
true);
2498 $lg->enableTags(
false);
2500 if (!$this->prtf_embed) {
2502 $ilCtrl->setParameter($this,
"ntf", 1);
2503 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2504 $ilCtrl->setParameter($this,
"ntf",
"");
2506 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
2512 $this->
lng->txt(
"blog_notification_activated")
2515 $ilCtrl->setParameter($this,
"ntf", 2);
2516 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
2517 $ilCtrl->setParameter($this,
"ntf",
"");
2518 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
2523 $this->
lng->txt(
"blog_notification_deactivated")
2529 if ($this->mayContribute()) {
2530 $ilCtrl->setParameter($this,
"prvm",
"");
2532 $ilCtrl->setParameter($this,
"bmn",
"");
2533 $ilCtrl->setParameter($this,
"blpg",
"");
2534 $link = $ilCtrl->getLinkTarget($this,
"");
2535 $ilCtrl->setParameter($this,
"blpg", $sub_id);
2536 $ilCtrl->setParameter($this,
"bmn", $this->month);
2537 $lg->addCustomCommand($link,
"blog_edit");
2539 if ($sub_id && $this->mayEditPosting($sub_id)) {
2540 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
2541 $lg->addCustomCommand($link,
"blog_edit_posting");
2544 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2547 $ilCtrl->setParameter($this,
"ntf",
"");
2556 $ilCtrl = $this->ctrl;
2558 switch ($this->ntf) {
2568 $ilCtrl->redirect($this,
"preview");
2580 if (
$post->getBlogId() === $a_blog_id) {
2581 return $post->getTitle();
2591 foreach ($this->items as $month => $postings) {
2592 foreach ($postings as
$id => $item) {
2594 unset($this->items[$month][
$id]);
2595 } elseif ($this->
object->hasApproval() && !$item[
"approved"]) {
2596 unset($this->items[$month][
$id]);
2599 if (!count($this->items[$month])) {
2600 unset($this->items[$month]);
2604 if ($this->items && !isset($this->items[$this->month])) {
2605 $keys = array_keys($this->items);
2606 $this->month = array_shift(
$keys);
2615 foreach ($a_items as $month => $items) {
2616 foreach ($items as $item) {
2633 return ($this->checkPermissionBool(
"redact") ||
2634 $this->checkPermissionBool(
"write"));
2642 int $a_author_id =
null
2647 if ($this->id_type === self::WORKSPACE_NODE_ID) {
2648 return $this->checkPermissionBool(
"write");
2654 if ($this->checkPermissionBool(
"redact")) {
2659 if ($this->checkPermissionBool(
"contribute")) {
2661 if (!$a_author_id) {
2663 $a_author_id =
$post->getAuthor();
2665 return $ilUser->getId() === $a_author_id;
2676 if ($this->id_type == self::WORKSPACE_NODE_ID) {
2677 return $this->checkPermissionBool(
"write");
2680 return ($this->checkPermissionBool(
"redact") ||
2681 $this->checkPermissionBool(
"contribute"));
2686 $ilLocator = $this->locator;
2688 if (is_object($this->
object)) {
2689 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"preview"),
"", $this->node_id);
2695 if ($this->isAdmin() && $this->apid > 0) {
2697 $post->setApproved(
true);
2698 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2699 $post->update(
true,
false,
true,
"new");
2701 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2704 $this->
ctrl->redirect($this,
"render");
2714 $ilTabs = $this->tabs;
2715 $ilToolbar = $this->toolbar;
2716 $ilCtrl = $this->ctrl;
2720 if (!$this->checkPermissionBool(
"write")) {
2724 $ilTabs->activateTab(
"contributors");
2726 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2733 'auto_complete_name' =>
$lng->txt(
'user'),
2734 'submit_name' =>
$lng->txt(
'add'),
2735 'add_search' =>
true,
2736 'add_from_container' => $this->node_id,
2737 'user_type' => $local_roles
2742 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2744 $this->tpl->setOnScreenMessage(
'info', sprintf(
$lng->txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2749 $tpl->setContent($tbl->getHTML());
2759 $user_login = $this->blog_request->getUserLogin();
2760 $user_type = $this->blog_request->getUserType();
2762 if (trim($user_login) ===
'') {
2763 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
'msg_no_search_string'));
2764 $this->contributors();
2767 $users = explode(
',', $user_login);
2769 $user_ids = array();
2770 foreach ($users as $user) {
2774 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
'user_not_known'));
2775 $this->contributors();
2779 $user_ids[] = (
int) $user_id;
2782 $this->addContributor($user_ids, $user_type);
2789 array $a_user_ids = array(),
2790 ?
string $a_user_type =
null
2792 $ilCtrl = $this->
ctrl;
2794 $rbacreview = $this->rbac_review;
2795 $rbacadmin = $this->rbacadmin;
2796 $a_user_type = (
int) $a_user_type;
2798 if (!$this->checkPermissionBool(
"write")) {
2802 if (!count($a_user_ids) || !$a_user_type) {
2803 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"));
2804 $this->contributors();
2809 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2810 if (!in_array($a_user_type, $local_roles)) {
2811 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"missing_perm"));
2812 $this->contributors();
2816 foreach ($a_user_ids as $user_id) {
2817 if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2818 $rbacadmin->
assignUser($a_user_type, $user_id);
2822 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
2823 $ilCtrl->redirect($this,
"contributors");
2831 $ids = $this->blog_request->getIds();
2833 if (count($ids) === 0) {
2834 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
2835 $this->
ctrl->redirect($this,
"contributors");
2839 $confirm->setHeaderText($this->
lng->txt(
'blog_confirm_delete_contributors'));
2840 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'removeContributor'));
2841 $confirm->setConfirm($this->
lng->txt(
'delete'),
'removeContributor');
2842 $confirm->setCancel($this->
lng->txt(
'cancel'),
'contributors');
2844 foreach ($ids as $user_id) {
2852 $this->tpl->setContent($confirm->getHTML());
2857 $ilCtrl = $this->ctrl;
2859 $rbacadmin = $this->rbacadmin;
2861 $ids = $this->blog_request->getIds();
2863 if (count($ids) === 0) {
2864 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"select_one"),
true);
2865 $ilCtrl->redirect($this,
"contributors");
2869 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2870 if (!$local_roles) {
2871 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"missing_perm"));
2872 $this->contributors();
2876 foreach ($ids as $user_id) {
2877 foreach ($local_roles as $role_id) {
2882 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
2883 $this->
ctrl->redirect($this,
"contributors");
2888 if ($this->checkPermissionBool(
"write") && $this->apid > 0) {
2891 $post->setApproved(
false);
2892 $post->setActive(
false);
2893 $post->update(
true,
false,
false);
2895 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2898 $this->
ctrl->redirect($this,
"render");
2917 $this->content_style_gui->addCss(
2919 $this->
object->getRefId(),
2920 $this->object->getId()
2927 public static function _goto(
string $a_target): void
2931 $ilCtrl =
$DIC->ctrl();
2932 $access =
$DIC->access();
2934 $id = explode(
"_", $a_target);
2935 if (substr($a_target, -3) ===
"wsp") {
2936 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"wsp_id",
$id[0]);
2938 if (count(
$id) >= 2) {
2939 if (is_numeric(
$id[1])) {
2940 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"gtp",
$id[1]);
2942 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"kwd",
$id[1]);
2944 if ((
$id[2] ??
"") ===
"edit") {
2945 $ilCtrl->setParameterByClass(
"ilSharedResourceGUI",
"edt",
$id[2]);
2948 $ilCtrl->redirectByClass(
"ilSharedResourceGUI",
"");
2950 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"ref_id",
$id[0]);
2952 if (count(
$id) >= 2) {
2953 if (is_numeric(
$id[1])) {
2954 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"gtp",
$id[1]);
2956 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"kwd",
$id[1]);
2959 if ((
$id[2] ??
"") ===
"edit") {
2960 $ilCtrl->setParameterByClass(
"ilRepositoryGUI",
"edt",
$id[2]);
2963 if ($access->checkAccess(
"read",
"",
$id[0])) {
2964 $ilCtrl->redirectByClass(
"ilRepositoryGUI",
"preview");
2966 if ($access->checkAccess(
"visible",
"",
$id[0])) {
2967 $ilCtrl->redirectByClass(
"ilRepositoryGUI",
"infoScreen");
2977 $this->export(
true);
2984 public function getPrintView(): \
ILIAS\Export\PrintProcessGUI
2986 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
2989 $blog = $this->object;
2990 $provider = new \ILIAS\Blog\BlogPrintViewProviderGUI(
2995 $this->access_handler,
2997 $this->blog_request->getObjIds()
3000 return new \ILIAS\Export\PrintProcessGUI(
3010 $view = $this->getPrintView();
3016 $print_view = $this->getPrintView();
3017 $print_view->sendPrintView();
3022 $this->
ctrl->redirectByClass(ilExportGUI::class);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
setVariable($variable, $value='')
Sets a variable value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilBlogPosting GUI class.
static getSnippet(int $a_id, bool $a_truncate=false, int $a_truncate_length=500, string $a_truncate_sign="...", bool $a_include_picture=false, int $a_picture_width=144, int $a_picture_height=144, string $a_export_directory=null)
Get first text paragraph of page.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static exists(int $a_blog_id, int $a_posting_id)
Checks whether a posting exists.
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
static lookupBlogId(int $a_posting_id)
static getKeywords(int $a_obj_id, int $a_posting_id)
static _numericMonthToString(int $a_month, bool $a_long=true)
numeric month to string
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
Navigation History of Repository Items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static isCommentsExportPossible(int $blog_id)
getNextPosting(array $a_items)
Get next posting.
infoScreen()
this one is called from the info button in the repository
afterSave(ilObject $new_object)
Post (successful) object creation hook.
initHeaderAction(?string $sub_type=null, ?int $sub_id=null, bool $is_preview=false)
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
ILIAS Style Content GUIService $content_style_gui
static _goto(string $a_target)
Deep link.
getLatestMonth(array $a_items)
executeCommand()
execute command
addUserFromAutoComplete()
Autocomplete submit.
getType()
Functions that must be overwritten.
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
mayEditPosting(int $a_posting_id, int $a_author_id=null)
Check if user may edit posting.
static lookupSubObjectTitle(int $a_blog_id, int $a_posting_id)
Get title for blog posting (used in ilNotesGUI)
addHeaderActionForCommand(string $a_cmd)
renderList(array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
Build posting month list.
addLocatorItems()
Functions to be overwritten.
getKeywords(bool $a_show_inactive, ?int $a_posting_id=null)
Get keywords for single posting or complete blog.
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
renderNavigationByAuthors(array $a_items, string $a_list_cmd="render", bool $a_show_inactive=false)
getPreviousMonth(array $a_items)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
addContributor(array $a_user_ids=array(), ?string $a_user_type=null)
Centralized method to add contributors.
setSettingsSubTabs(string $a_active)
getHTML()
Return embeddable HTML chunk.
buildExportLink(string $a_template, string $a_type, string $a_id)
Build export link.
exportWithComments()
Handle export choice.
ILIAS Blog ReadingTime ReadingTimeManager $reading_time_manager
getPreviousPosting(array $a_items)
Get previous posting.
renderNavigationByDate(array $a_items, string $a_list_cmd="render", string $a_posting_cmd="preview", ?string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation by date block.
ContextServices $tool_context
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
ILIAS Blog ReadingTime BlogSettingsGUI $reading_time_gui
buildExportFile(bool $a_include_comments=false, bool $print_version=false)
Build export file.
render()
Render object context.
filterItemsByKeyword(array $a_items, string $a_keyword)
filterInactivePostings()
Filter inactive items from items list.
mayContribute()
Check if user may contribute at all.
StandardGUIRequest $blog_request
buildEmbedded(string $a_content, string $a_nav)
Combine content (list/posting) and navigation to html chunk.
setTabs()
create tabs (repository/workspace switch)
initCreationForms(string $new_type)
Init creation forms.
renderFullscreenHeader(ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
Render banner, user name.
disableNotes(bool $a_value=false)
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
ILIAS HTTP Services $http
renderToolbarNavigation(array $a_items, bool $single_posting=false)
Toolbar navigation.
getNextMonth(array $a_items)
Get next month.
ILIAS Style Content Object ObjectFacade $content_style_domain
buildPostingList(int $a_obj_id)
Gather all blog postings.
preview()
Render fullscreen presentation.
confirmRemoveContributor()
Used in ilContributorTableGUI.
export(bool $a_with_comments=false)
Build and deliver export file.
createPosting()
Create new posting.
renderNavigationByKeywords(string $a_list_cmd="render", bool $a_show_inactive=false, string $a_link_template="", int $a_blpg=0)
Build navigation by keywords block.
getLatestPosting(array $a_items)
Get previous posting.
ILIAS Notes Service $notes
ilNavigationHistory $nav_history
renderNavigation(string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation blocks.
getListItems(bool $a_show_inactive=false)
Filter blog postings by month, keyword or author.
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
const ABSTRACT_DEFAULT_IMAGE_WIDTH
const ABSTRACT_DEFAULT_IMAGE_HEIGHT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupId($a_user_str)
static _lookupName(int $a_user_id)
lookup user name
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilRbacAdmin Core functions for role based access control.
deassignUser(int $a_rol_id, int $a_usr_id)
Deassigns a user from a role.
assignUser(int $a_rol_id, int $a_usr_id)
Assigns an user to a role.
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRelevanceClass(int $cnt, int $max)
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static signFile(string $path_to_file)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDescription(string $a_descr)
Sets description below title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
catch(\Exception $e) $req