19 declare(strict_types=1);
39 protected \ILIAS\Repository\Profile\ProfileAdapter
$profile;
41 protected \ILIAS\Blog\InternalDomainService
$domain;
42 protected \ILIAS\Blog\InternalGUIService
$gui;
44 protected \ILIAS\Notes\Service
$notes;
69 protected \ILIAS\HTTP\Services
$http;
70 protected \ILIAS\DI\UIServices
$ui;
76 int $a_id_type = self::REPOSITORY_NODE_ID,
77 int $a_parent_node_id = 0
82 $cs = $DIC->contentStyle();
83 $this->tool_context = $DIC->globalScreen()->tool()->context();
84 $this->notes = $DIC->notes();
89 $this->domain = $domain =
$service->domain();
92 $this->
settings = $domain->settings();
93 $this->
user = $domain->user();
94 $this->tree = $domain->repositoryTree();
95 $this->rbac_review = $domain->rbac()->review();
96 $this->rbacadmin = $domain->rbac()->admin();
97 $this->
lng = $domain->lng();
101 $this->
help = $gui->help();
102 $this->
tabs = $gui->tabs();
103 $this->
toolbar = $gui->toolbar();
104 $this->
ui = $gui->ui();
105 $this->
locator = $gui->locator();
106 $this->
http = $gui->http();
108 $this->nav_history = $DIC[
"ilNavigationHistory"];
109 $this->
ctrl = $gui->ctrl();
111 $this->blog_request = $gui->standardRequest();
114 $this->blpg =
$req->getBlogPage();
115 $this->old_nr =
$req->getOldNr();
116 $this->ppage =
$req->getPPage();
117 $this->user_page =
$req->getUserPage();
118 $this->new_type =
$req->getNewType();
119 $this->prvm =
$req->getPreviewMode();
120 $this->ntf =
$req->getNotification();
121 $this->apid =
$req->getApId();
122 $this->month =
$req->getMonth();
123 $this->keyword =
$req->getKeyword();
124 $this->author =
$req->getAuthor();
128 $blog_page = $this->blog_request->getBlogPage();
129 if ($blog_page > 0 &&
131 throw new ilException(
"Posting ID does not match blog.");
140 if (!$this->month || !$this->items[$this->month]) {
141 $m = array_keys($this->items);
142 $this->month = array_shift($m);
143 $this->month_default =
true;
147 $this->
ctrl->setParameter($this,
"bmn", $this->month);
148 $blog_id = $this->
object->getId();
151 $this->
lng->loadLanguageModule(
"blog");
152 $this->
ctrl->saveParameter($this,
"prvm");
154 $this->content_style_gui = $cs->gui();
155 if (is_object($this->
object)) {
156 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
157 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
159 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
161 $this->blog_settings =
162 $domain->blogSettings()->getByObjId($this->
object->getId());
165 $this->reading_time_gui = $gui->readingTime()->settingsGUI($blog_id);
166 $this->reading_time_manager = $domain->readingTime();
167 $this->notes = $DIC->notes();
168 $owner = $this->
object?->getOwner() ?? 0;
169 $this->blog_access = $domain->blogAccess(
173 $this->
user->getId(),
176 $this->
profile = $domain->profile();
177 $this->profile_gui = $gui->profile();
194 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
204 $this->tabs_gui->addSubTab(
206 $this->
lng->txt(
"general"),
207 $this->
ctrl->getLinkTarget($this,
'edit')
210 $this->tabs_gui->addSubTab(
212 $this->
lng->txt(
"blog_side_blocks"),
213 $this->
ctrl->getLinkTargetByClass(
219 $this->tabs_gui->addSubTab(
221 $this->
lng->txt(
"obj_sty"),
222 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
226 if ($this->id_type === self::REPOSITORY_NODE_ID) {
230 if ($grp_ref_id > 0 || $crs_ref_id > 0) {
232 $this->tabs_gui->addSubTab(
234 $this->
lng->txt(
"notifications"),
235 $this->
ctrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
241 $this->tabs_gui->activateSubTab($a_active);
246 $this->
ctrl->redirectByClass(SettingsGUI::class,
"");
254 if ($this->id_type === self::WORKSPACE_NODE_ID) {
255 $this->
ctrl->setParameter($this,
"wsp_id", $this->node_id);
258 $ilHelp->setScreenIdComponent(
"blog");
261 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
262 $this->tabs_gui->addTab(
265 $this->
ctrl->getLinkTarget($this,
"")
269 $this->tabs_gui->addTab(
272 $this->
ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary")
277 $this->tabs_gui->addTab(
280 $this->
ctrl->getLinkTargetByClass(
281 [SettingsGUI::class],
286 if ($this->id_type === self::REPOSITORY_NODE_ID) {
287 $this->tabs_gui->addTab(
289 $lng->
txt(
"blog_contributors"),
290 $this->
ctrl->getLinkTarget($this,
"contributors")
294 if ($this->id_type === self::REPOSITORY_NODE_ID) {
296 $mdtab = $mdgui->getTab();
298 $this->tabs_gui->addTab(
300 $this->
lng->txt(
"meta_data"),
304 $this->tabs_gui->addTab(
307 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
312 if ($this->blog_access->mayContribute()) {
313 $this->tabs_gui->addNonTabbedLink(
316 $this->
ctrl->getLinkTarget($this,
"preview")
331 $next_class = $ilCtrl->getNextClass($this);
333 if ($next_class !==
"ilexportgui") {
337 $cmd = $ilCtrl->getCmd();
340 if (($this->id_type === self::REPOSITORY_NODE_ID) && !$this->
getCreationMode() &&
343 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilObjBlogGUI"],
"preview");
344 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
346 switch ($next_class) {
347 case 'ilblogpostinggui':
348 $this->
ctrl->saveParameter($this,
"user_page");
352 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
357 if ($this->id_type === self::REPOSITORY_NODE_ID) {
361 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
369 $this->blog_access->mayEditPosting($this->blpg),
376 case "previewFullscreen":
377 $ilCtrl->setParameter($this,
"prvm",
"fsc");
384 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
385 $this->tabs_gui->addNonTabbedLink(
388 $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen")
390 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
396 $cmd =
"previewFullscreen";
398 if (in_array($cmd, array(
"previewFullscreen"))) {
401 $ret = $ilCtrl->forwardCommand($bpost_gui);
402 if (!$ilTabs->back_target) {
403 $ilCtrl->setParameter($this,
"bmn",
"");
404 $ilTabs->setBackTarget(
406 $ilCtrl->getLinkTarget($this,
"")
412 $is_owner = $this->blog_access->mayContribute();
413 $is_active = $bpost_gui->getBlogPosting()->getActive();
416 if (($cmd ===
"previewFullscreen")
417 && !$is_owner && !$is_active) {
418 $this->
ctrl->redirect($this,
"preview");
423 case "previewFullscreen":
435 if ($this->id_type === self::WORKSPACE_NODE_ID) {
436 $info[] =
$lng->
txt(
"blog_draft_info");
438 $info[] =
$lng->
txt(
"blog_draft_info_contributors");
441 $public_action =
false;
442 if ($cmd !==
"history" && $cmd !==
"edit" && $is_active && empty($info)) {
443 $info[] =
$lng->
txt(
"blog_new_posting_info");
444 $public_action =
true;
446 if ($this->blog_settings->getApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
448 $info[] =
$lng->
txt(
"blog_posting_edit_approval_info");
450 if ($public_action) {
451 $this->tpl->setOnScreenMessage(
'success', implode(
"<br />", $info));
453 if (count($info) > 0) {
454 $this->tpl->setOnScreenMessage(
'info', implode(
"<br />", $info));
460 if ($cmd !==
"edit") {
465 $this->
tabs->setBackTarget(
"",
"");
472 case "ilinfoscreengui":
482 case "ilcommonactiondispatchergui":
484 $gui->enableCommentsSettings(
false);
486 $this->
ctrl->forwardCommand($gui);
489 case "ilpermissiongui":
491 $ilTabs->activateTab(
"id_permissions");
493 $this->
ctrl->forwardCommand($perm_gui);
496 case "ilobjectcopygui":
499 $cp->setType(
"blog");
500 $this->
ctrl->forwardCommand($cp);
503 case 'ilrepositorysearchgui':
505 $ilTabs->activateTab(
"contributors");
507 $rep_search->setTitle($this->
lng->txt(
"blog_add_contributor"));
508 $rep_search->setCallback($this,
'addContributor', $this->
object->getAllLocalRoles($this->node_id));
509 $this->
ctrl->setReturn($this,
'contributors');
510 $this->
ctrl->forwardCommand($rep_search);
517 case "ilobjectcontentstylesettingsgui":
521 $ilTabs->activateTab(
"settings");
525 if ($this->id_type === self::REPOSITORY_NODE_ID) {
526 $settings_gui = $this->content_style_gui
527 ->objectSettingsGUIForRefId(
532 $settings_gui = $this->content_style_gui
533 ->objectSettingsGUIForObjId(
538 $this->
ctrl->forwardCommand($settings_gui);
542 case "ilblogexercisegui":
543 $this->
ctrl->setReturn($this,
"render");
544 $gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
545 $this->
ctrl->forwardCommand($gui);
548 case 'ilobjnotificationsettingsgui':
550 $ilTabs->activateTab(
"settings");
553 $this->
ctrl->forwardCommand($gui);
556 case strtolower(ilObjectMetaDataGUI::class):
559 $ilTabs->activateTab(
"meta_data");
561 $this->
ctrl->forwardCommand($gui);
564 case strtolower(SettingsGUI::class):
567 $ilTabs->activateTab(
"settings");
569 $gui = $this->gui->settings()->settingsGUI(
571 $this->id_type === self::REPOSITORY_NODE_ID
573 $this->
ctrl->forwardCommand($gui);
576 case strtolower(\
ILIAS\Blog\
Settings\BlockSettingsGUI::class):
579 $ilTabs->activateTab(
"settings");
581 $gui = $this->gui->settings()->blockSettingsGUI(
583 $this->id_type === self::REPOSITORY_NODE_ID
585 $this->
ctrl->forwardCommand($gui);
589 if ($cmd !==
"gethtml") {
591 if ($cmd ===
"addToDesk" || $cmd ===
"removeFromDesk") {
592 $this->{$cmd .
"Object"}();
603 parent::executeCommand();
610 $this->
tabs->activateTab(
"export");
612 $this->
ctrl->forwardCommand($exp_gui);
619 $this->
tabs->activateTab(
"export");
627 $this->
tabs->activateTab(
"export");
633 $be = $this->domain->exercise($this->node_id);
634 $be_gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
635 $assignments = $be->getAssignmentsOfBlog();
636 if (count($assignments) > 0) {
637 $ass_ids =
array_map(
static function ($i) {
642 $this->tool_context->current()->addAdditionalData(
644 $be_gui->getActionButtons()
654 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
667 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
668 $info->enablePrivateNotes();
676 $info->enableNewsEditing(
false);
679 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
681 if ($enable_internal_rss) {
682 $info->setBlockProperty(
"news",
"settings",
"1");
683 $info->setBlockProperty(
"news",
"public_notifications_option",
"1");
688 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
690 $this->
ctrl->forwardCommand($info);
701 $title = $this->blog_request->
getTitle();
705 $posting->setTitle($title);
706 $posting->setBlogId($this->
object->getId());
707 $posting->setActive(
false);
708 $posting->setAuthor($ilUser->getId());
709 $posting->create(
false);
712 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
714 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
715 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
717 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_title"),
true);
718 $ilCtrl->redirect($this,
"render");
734 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
738 $ilTabs->activateTab(
"content");
741 if ($this->blog_access->mayContribute()) {
742 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
746 $ilToolbar->addStickyItem($title,
true);
748 document.getElementById('title').setAttribute('data-blog-input', 'posting-title'); 749 document.getElementById('title').setAttribute('placeholder', ' '); 755 )->submit()->toToolbar(
true, $ilToolbar);
758 $keys = array_keys($this->items);
759 $first = array_shift($keys);
760 if ($first != $this->month) {
761 $ilToolbar->addSeparator();
763 $ilCtrl->setParameter($this,
"bmn", $first);
764 $url = $ilCtrl->getLinkTarget($this,
"");
765 $ilCtrl->setParameter($this,
"bmn", $this->month);
770 )->emphasised()->toToolbar(
true, $ilToolbar);
774 $print_view = $this->getPrintView();
775 $modal_elements = $print_view->getModalElements(
776 $this->
ctrl->getLinkTarget(
781 $ilToolbar->addSeparator();
782 $ilToolbar->addComponent($modal_elements->button);
783 $ilToolbar->addComponent($modal_elements->modal);
787 $is_owner = $this->blog_access->mayContribute();
793 $list = $this->
renderList($list_items,
"preview",
"", $is_owner);
808 bool $a_show_inactive =
false 811 $list_items = array();
812 foreach ($this->items as $month => $items) {
813 foreach ($items as
$id => $item) {
814 if ($item[
"author"] == $this->author ||
815 (isset($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
816 $list_items[
$id] = $item;
820 } elseif ($this->keyword) {
823 $max = $this->blog_settings->getOverviewPostings();
824 if ($this->month_default && $max) {
825 $list_items = array();
826 foreach ($this->items as $month => $postings) {
827 foreach ($postings as
$id => $item) {
828 if (!$a_show_inactive &&
832 $list_items[
$id] = $item;
834 if (count($list_items) >= $max) {
855 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
865 $list = $this->
renderList($list_items,
"previewFullscreen");
877 bool $a_with_comments =
false 898 $owner = $this->
object->getOwner();
900 $ilTabs->clearTargets();
907 if ($owner === $ilUser->getId()) {
909 if ($this->id_type === self::WORKSPACE_NODE_ID) {
910 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" .
$this->node_id;
913 elseif ($this->blog_access->mayContribute()) {
914 $this->
ctrl->setParameter($this,
"prvm",
"");
915 if ($this->blpg === 0) {
916 $back = $this->
ctrl->getLinkTarget($this,
"");
918 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
919 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
920 $back = $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
922 $this->
ctrl->setParameter($this,
"prvm", $this->prvm);
925 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
930 if ($this->id_type === self::WORKSPACE_NODE_ID) {
931 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
934 elseif ($this->blog_access->mayContribute()) {
935 $back = $this->
ctrl->getLinkTarget($this,
"");
936 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
949 $this->
ctrl->setParameter($this,
"bmn",
"");
951 $this->
ctrl->setParameter($this,
"bmn", $this->month);
963 bool $a_export =
false 971 $this->
object->getId(),
978 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
980 $name = $name[
"lastname"] .
", " . $name[
"firstname"];
984 if ($this->blog_settings?->getProfilePicture()) {
986 if ($this->id_type === self::REPOSITORY_NODE_ID) {
988 if ($this->blpg > 0 && !$a_export) {
990 $author_id =
$post->getAuthor();
992 $ppic = $this->profile_gui->getPicturePath($author_id);
993 $name = $this->profile_gui->getNamePresentation($author_id);
1002 $ppic = basename($ppic);
1009 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1022 $author_found =
false;
1026 if ($this->author &&
1027 ($posting[
"author"] == $this->author ||
1028 (is_array($posting[
"editors"] ??
false) && in_array($this->author, $posting[
"editors"])))) {
1029 $author_found =
true;
1032 $month = substr($posting[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1033 $items[
$month][$posting[
"id"]] = $posting;
1036 if ($this->author && !$author_found) {
1037 $this->author =
null;
1048 string $a_cmd =
"preview",
1049 string $a_link_template =
"",
1050 bool $a_show_inactive =
false,
1051 string $a_export_directory =
"" 1059 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"components/ILIAS/Blog");
1065 foreach ($items as $item) {
1068 if (!$is_active && !$a_show_inactive) {
1075 if (!$this->keyword && !$this->author) {
1076 $month = substr($item[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1079 if (!$last_month || $last_month != $month) {
1081 $wtpl->setCurrentBlock(
"month_bl");
1082 $wtpl->parseCurrentBlock();
1086 if ($this->keyword) {
1088 } elseif ($this->author) {
1089 $title =
$lng->
txt(
"blog_author") .
": " . $this->profile_gui->getNamePresentation($this->author);
1091 $title = $this->gui->presentation()->util()->getMonthPresentation($month);
1095 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1098 if (!$a_link_template) {
1099 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1100 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1101 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1103 $preview = $this->
buildExportLink($a_link_template,
"posting", (
string) $item[
"id"]);
1105 $more_link = $preview;
1108 $posting_edit = $this->blog_access->mayEditPosting($item[
"id"], $item[
"author"]);
1109 if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd ===
"preview") {
1112 if ($is_active && $this->blog_settings->getApproval() && !$item[
"approved"]) {
1114 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1117 $ilCtrl->getLinkTarget($this,
"approve")
1119 $ilCtrl->setParameter($this,
"apid",
"");
1122 $wtpl->setVariable(
"APPROVAL",
$lng->
txt(
"blog_needs_approval"));
1125 if ($posting_edit) {
1128 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit")
1130 $more_link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1135 $lng->
txt(
"blog_toggle_draft"),
1136 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList")
1140 $lng->
txt(
"blog_toggle_final"),
1141 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList")
1147 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle")
1150 if ($this->blog_settings->getKeywords()) {
1152 $lng->
txt(
"blog_edit_keywords"),
1153 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords")
1159 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate")
1164 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1166 } elseif ($is_admin) {
1169 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1171 $lng->
txt(
"blog_toggle_draft_admin"),
1172 $ilCtrl->getLinkTarget($this,
"deactivateAdmin")
1174 $ilCtrl->setParameter($this,
"apid",
"");
1179 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1183 $dd =
$ui_factory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
1185 $wtpl->setCurrentBlock(
"actions");
1186 $wtpl->setVariable(
"ACTION_SELECTOR",
$ui_renderer->render($dd));
1187 $wtpl->parseCurrentBlock();
1193 $notes_context = $this->notes
1200 $count = $this->notes
1202 ->getNrOfCommentsForContext($notes_context);
1204 if ($a_cmd !==
"preview") {
1205 $wtpl->setCurrentBlock(
"comments");
1206 $wtpl->setVariable(
"TEXT_COMMENTS",
$lng->
txt(
"blog_comments"));
1207 $wtpl->setVariable(
"URL_COMMENTS", $preview);
1208 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1209 $wtpl->parseCurrentBlock();
1214 if ($a_cmd !==
"preview") {
1215 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1216 $goto = $this->gui->permanentLink(0, $this->node_id)->getPermanentLink((
int) $item[
"id"]);
1218 $goto = $this->gui->permanentLink($this->node_id)->getPermanentLink((
int) $item[
"id"]);
1220 $wtpl->setCurrentBlock(
"permalink");
1221 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1222 $wtpl->setVariable(
"TEXT_PERMALINK",
$lng->
txt(
"blog_link"));
1223 $wtpl->parseCurrentBlock();
1228 $this->blog_settings->getAbstractShorten(),
1229 $this->blog_settings->getAbstractShortenLength(),
1231 $this->blog_settings->getAbstractImage(),
1232 $this->blog_settings->getAbstractImageWidth(),
1233 $this->blog_settings->getAbstractImageHeight(),
1238 $wtpl->setCurrentBlock(
"more");
1239 $wtpl->setVariable(
"URL_MORE", $more_link);
1240 $wtpl->setVariable(
"TEXT_MORE",
$lng->
txt(
"blog_list_more"));
1241 $wtpl->parseCurrentBlock();
1247 $wtpl->setCurrentBlock(
"draft_text");
1248 $wtpl->setVariable(
"DRAFT_TEXT",
$lng->
txt(
"blog_draft_text"));
1249 $wtpl->parseCurrentBlock();
1250 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1254 $reading_time = $this->reading_time_manager->getReadingTime(
1258 if (!is_null($reading_time)) {
1259 $this->
lng->loadLanguageModule(
"copg");
1260 $wtpl->setCurrentBlock(
"reading_time");
1263 $this->
lng->txt(
"copg_est_reading_time") .
": " .
1264 sprintf($this->
lng->txt(
"copg_x_minutes"), $reading_time)
1266 $wtpl->parseCurrentBlock();
1269 $wtpl->setCurrentBlock(
"posting");
1272 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1275 $author_id = $item[
"author"];
1277 $authors[] = $this->profile_gui->getNamePresentation($author_id);
1280 if (isset($item[
"editors"])) {
1281 foreach ($item[
"editors"] as $editor_id) {
1282 $authors[] = $this->profile_gui->getNamePresentation($editor_id);
1287 $author = implode(
", ", $authors) .
" - ";
1292 $wtpl->setVariable(
"URL_TITLE", $preview);
1293 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1297 $keywords = (count($kw) > 0)
1298 ?
"<br>" . $this->
lng->txt(
"keywords") .
": " . implode(
", ", $kw)
1301 $wtpl->setVariable(
"DATETIME", $author .
1305 $wtpl->setVariable(
"CONTENT", $snippet);
1307 $wtpl->parseCurrentBlock();
1311 if ($a_cmd ===
"previewFullscreen") {
1312 $ref_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1315 $wsp_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1318 $this->gui->permanentLink(
$ref_id, $wsp_id)->setPermanentLink();
1321 if (!$is_empty || $a_show_inactive) {
1322 return $wtpl->get();
1335 return BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->
getKeywords(
false));
1344 string $a_list_cmd =
"render",
1345 string $a_posting_cmd =
"preview",
1346 ?
string $a_link_template =
null,
1347 bool $a_show_inactive =
false,
1352 $blpg = ($a_blpg > 0)
1358 foreach ($a_items as $month => $postings) {
1359 foreach (array_keys($postings) as
$id) {
1361 if (!$a_show_inactive && !$active) {
1362 unset($a_items[$month][
$id]);
1364 $a_items[
$month][
$id][
"active"] = $active;
1367 if (!count($a_items[$month])) {
1368 unset($a_items[$month]);
1374 $max_months = $this->blog_settings->getNavModeListMonths();
1376 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"components/ILIAS/Blog");
1378 $ilCtrl->setParameter($this,
"blpg",
"");
1380 $counter = $mon_counter = $last_year = 0;
1381 foreach ($a_items as $month => $postings) {
1382 if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1387 $year = substr($month, 0, 4);
1388 if (!$last_year || $year != $last_year) {
1397 if (!$a_link_template) {
1398 $ilCtrl->setParameter($this,
"bmn", $month);
1399 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1401 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1406 if ($mon_counter <= $this->blog_settings->getNavModeListMonthsWithPostings()) {
1408 $wtpl->setCurrentBlock(
"navigation_year_details");
1409 $wtpl->setVariable(
"YEAR", $year);
1410 $wtpl->parseCurrentBlock();
1413 foreach ($postings as
$id => $posting) {
1424 if (!$a_link_template) {
1425 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1426 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1427 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1432 if (!$posting[
"active"]) {
1433 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1434 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1435 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1438 $wtpl->setCurrentBlock(
"navigation_item");
1439 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1440 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1441 $wtpl->parseCurrentBlock();
1444 $wtpl->setCurrentBlock(
"navigation_month_details");
1445 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1446 $wtpl->setVariable(
"URL_MONTH", $month_url);
1451 $wtpl->setCurrentBlock(
"navigation_year");
1452 $wtpl->setVariable(
"YEAR", $year);
1453 $wtpl->parseCurrentBlock();
1456 $wtpl->setCurrentBlock(
"navigation_month");
1457 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1458 $wtpl->setVariable(
"URL_MONTH", $month_url);
1459 $wtpl->setVariable(
"MONTH_COUNT", count($postings));
1461 $wtpl->parseCurrentBlock();
1463 if (!$a_link_template) {
1464 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
1465 $url = $this->
ctrl->getLinkTargetByClass(self::class, $a_list_cmd);
1467 $url =
"index.html";
1472 $this->
ui->renderer()->render(
1473 $this->
ui->factory()->link()->standard(
1474 $this->
lng->txt(
"blog_starting_page"),
1482 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"components/ILIAS/Blog");
1484 $ilCtrl->setParameter($this,
"blpg",
"");
1486 $month_options = array();
1487 foreach ($a_items as $month => $postings) {
1488 $month_name = $this->gui->presentation()->util()->getMonthPresentation($month);
1490 $month_options[
$month] = $month_name;
1492 if ($month == $this->month) {
1493 if (!$a_link_template) {
1494 $ilCtrl->setParameter($this,
"bmn", $month);
1495 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1497 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1500 foreach ($postings as
$id => $posting) {
1504 if (!$a_link_template) {
1505 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1506 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1507 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1512 if (!$posting[
"active"]) {
1513 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1514 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1515 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1518 $wtpl->setCurrentBlock(
"navigation_item");
1519 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1520 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1521 $wtpl->parseCurrentBlock();
1524 $wtpl->setCurrentBlock(
"navigation_month_details");
1526 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1527 $wtpl->setVariable(
"URL_MONTH", $month_url);
1529 $wtpl->parseCurrentBlock();
1534 $wtpl->setCurrentBlock(
"option_bl");
1535 foreach ($month_options as $value => $caption) {
1536 $wtpl->setVariable(
"OPTION_VALUE", $value);
1537 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1538 if ($value == $this->month) {
1539 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1541 $wtpl->parseCurrentBlock();
1544 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1547 $ilCtrl->setParameter($this,
"bmn", $this->month);
1548 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1549 return $wtpl->get();
1556 string $a_list_cmd =
"render",
1557 bool $a_show_inactive =
false,
1558 string $a_link_template =
"",
1563 $blpg = ($a_blpg > 0)
1567 $keywords = $this->
getKeywords($a_show_inactive, $blpg);
1569 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"components/ILIAS/Blog");
1571 $max = max($keywords);
1573 $wtpl->setCurrentBlock(
"keyword");
1574 foreach ($keywords as $keyword => $counter) {
1575 if (!$a_link_template) {
1576 $ilCtrl->setParameter($this,
"kwd", urlencode((
string) $keyword));
1577 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1578 $ilCtrl->setParameter($this,
"kwd",
"");
1583 $wtpl->setVariable(
"TXT_KEYWORD", $keyword);
1585 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1586 $wtpl->parseCurrentBlock();
1589 return $wtpl->get();
1596 string $a_list_cmd =
"render",
1597 bool $a_show_inactive =
false 1602 foreach ($a_items as $month => $items) {
1603 foreach ($items as $item) {
1605 if ($item[
"author"]) {
1606 $authors[] = $item[
"author"];
1609 if (isset($item[
"editors"])) {
1610 foreach ($item[
"editors"] as $editor_id) {
1611 if ($editor_id != $item[
"author"]) {
1612 $authors[] = $editor_id;
1620 $authors = array_unique($authors);
1623 $authors = array_filter($authors,
function (
$id) {
1627 if (count($authors) > 1) {
1631 $ilCtrl->setParameter($this,
"ath", $user_id);
1632 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1633 $ilCtrl->setParameter($this,
"ath",
"");
1636 if (substr($base_name, 0, 1) ==
"[") {
1650 $sort = $name_arr[
"lastname"] .
" " . $name_arr[
"firstname"];
1653 $idx = trim(strip_tags($sort)) .
"///" .
$user_id;
1654 $list[$idx] = array($name,
$url);
1659 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"components/ILIAS/Blog");
1661 $wtpl->setCurrentBlock(
"author");
1662 foreach ($list as $author) {
1663 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1664 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1665 $wtpl->parseCurrentBlock();
1668 return $wtpl->get();
1678 bool $single_posting =
false 1680 $nav_renderer = $this->gui->navigation()->toolbarNavigationRenderer();
1681 $nav_renderer->renderToolbarNavigation(
1695 string $a_list_cmd =
"render",
1696 string $a_posting_cmd =
"preview",
1697 ?
string $a_link_template =
null,
1698 bool $a_show_inactive =
false,
1703 $blpg = ($a_blpg > 0)
1707 if ($this->blog_settings->getOrder()) {
1708 $order = array_flip($this->blog_settings->getOrder());
1717 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"components/ILIAS/Blog");
1722 if (count($a_items)) {
1723 $blocks[$order[
"navigation"]] = array(
1724 $this->
lng->txt(
"blog_navigation"),
1725 $this->
renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
1729 if ($this->blog_settings->getKeywords()) {
1731 $may_edit_keywords = ($blpg > 0 &&
1732 $this->blog_access->mayEditPosting($blpg) &&
1733 $a_list_cmd !==
"preview" &&
1734 $a_list_cmd !==
"gethtml" &&
1737 if ($keywords || $may_edit_keywords) {
1739 $keywords = $this->
lng->txt(
"blog_no_keywords");
1742 $blocks[$order[
"keywords"]] = array(
1743 $this->
lng->txt(
"blog_keywords"),
1746 ? array($cmd, $this->
lng->txt(
"blog_edit_keywords"))
1753 if (!$a_link_template) {
1755 if ($this->id_type === self::REPOSITORY_NODE_ID &&
1756 $this->blog_settings->getAuthors()) {
1759 $blocks[$order[
"authors"]] = array($this->
lng->txt(
"blog_authors"), $authors);
1764 if ($this->blog_settings->getRSS() &&
1766 $a_list_cmd ===
"preview") {
1769 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
1772 $url = ILIAS_HTTP_PATH .
"/feed.php?blog_id=" . $blog_id .
1773 "&client_id=" . rawurlencode(
CLIENT_ID);
1779 if (count($blocks)) {
1786 foreach ($blocks as $block) {
1789 $content = $block[1];
1791 $secondary_panel =
$ui_factory->panel()->secondary()->legacy($title,
$ui_factory->legacy()->content($content));
1793 if (isset($block[2]) && is_array($block[2])) {
1794 $link =
$ui_factory->button()->shy($block[2][1], $block[2][0]);
1795 $secondary_panel = $secondary_panel->withFooter($link);
1798 $wtpl->setCurrentBlock(
"block_bl");
1799 $wtpl->setVariable(
"BLOCK",
$ui_renderer->render($secondary_panel));
1800 $wtpl->parseCurrentBlock();
1804 return $wtpl->get();
1811 bool $a_show_inactive,
1812 ?
int $a_posting_id =
null 1814 $keywords = array();
1815 if ($a_posting_id) {
1817 if (isset($keywords[$keyword])) {
1824 foreach ($this->items as $month => $items) {
1825 foreach ($items as $item) {
1828 if (isset($keywords[$keyword])) {
1841 foreach ($keywords as $keyword => $counter) {
1842 $tmp[] = array(
"keyword" => $keyword,
"counter" => $counter);
1846 $keywords = array();
1847 foreach ($tmp as $item) {
1848 $keywords[(string) $item[
"keyword"]] = $item[
"counter"];
1857 bool $a_include_comments =
false,
1858 bool $print_version =
false 1861 $format = explode(
"_", $this->blog_request->getFormat());
1862 if (($format[1] ??
"") ===
"comments" || $a_include_comments) {
1863 $a_include_comments =
true;
1864 $type =
"html_comments";
1871 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
1872 if ($print_version) {
1877 $blog_export->setPrintVersion($print_version);
1878 $blog_export->includeComments($a_include_comments);
1879 $blog_export->exportHTML();
1880 return $blog_export;
1890 $this->disable_notes = $a_value;
1899 if ($a_cmd ===
"preview" || $a_cmd ===
"previewFullscreen" || $this->prvm) {
1907 $ilCtrl->setParameter($this,
"prvm",
"");
1916 ?
string $sub_type =
null,
1917 ?
int $sub_id =
null,
1918 bool $is_preview =
false 1922 if (!$this->obj_id) {
1925 $sub_type = $sub_id =
null;
1926 if ($this->blpg > 0) {
1931 $lg = parent::initHeaderAction($sub_type, $sub_id);
1935 $lg->enableComments(
false);
1936 $lg->enableNotes(
false);
1939 if ($this->blpg > 0) {
1941 $lg->enableComments(
true);
1943 $lg->enableNotes(
true);
1945 $lg->enableTags(
false);
1948 $ilCtrl->setParameter($this,
"ntf", 1);
1949 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1950 $ilCtrl->setParameter($this,
"ntf",
"");
1952 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
1958 $this->
lng->txt(
"blog_notification_activated")
1961 $ilCtrl->setParameter($this,
"ntf", 2);
1962 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1963 $ilCtrl->setParameter($this,
"ntf",
"");
1964 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
1969 $this->
lng->txt(
"blog_notification_deactivated")
1974 if ($this->blog_access->mayContribute()) {
1975 $ilCtrl->setParameter($this,
"prvm",
"");
1977 $ilCtrl->setParameter($this,
"bmn",
"");
1978 $ilCtrl->setParameter($this,
"blpg",
"");
1979 $link = $ilCtrl->getLinkTarget($this,
"");
1980 $ilCtrl->setParameter($this,
"blpg", $sub_id);
1981 $ilCtrl->setParameter($this,
"bmn", $this->month);
1982 $lg->addCustomCommand($link,
"blog_edit");
1984 if ($sub_id && $this->blog_access->mayEditPosting($sub_id)) {
1985 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1986 $lg->addCustomCommand($link,
"blog_edit_posting");
1989 $ilCtrl->setParameter($this,
"prvm",
"fsc");
1992 $ilCtrl->setParameter($this,
"ntf",
"");
2003 switch ($this->ntf) {
2013 $ilCtrl->redirect($this,
"preview");
2025 if (
$post->getBlogId() === $a_blog_id) {
2026 return $post->getTitle();
2036 foreach ($this->items as $month => $postings) {
2037 foreach ($postings as
$id => $item) {
2039 unset($this->items[$month][
$id]);
2040 } elseif ($this->blog_settings->getApproval() && !$item[
"approved"]) {
2041 unset($this->items[$month][
$id]);
2044 if (!count($this->items[$month])) {
2045 unset($this->items[$month]);
2049 if ($this->items && !isset($this->items[$this->month])) {
2050 $keys = array_keys($this->items);
2051 $this->month = array_shift($keys);
2060 foreach ($a_items as $month => $items) {
2061 foreach ($items as $item) {
2086 if (is_object($this->
object)) {
2093 if ($this->
isAdmin() && $this->apid > 0) {
2095 $post->setApproved(
true);
2096 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2097 $post->update(
true,
false,
true,
"new");
2099 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2102 $this->
ctrl->redirect($this,
"render");
2122 $ilTabs->activateTab(
"contributors");
2124 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2131 'auto_complete_name' =>
$lng->
txt(
'user'),
2132 'submit_name' =>
$lng->
txt(
'add'),
2133 'add_search' =>
true,
2135 'user_type' => $local_roles
2140 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2142 $this->tpl->setOnScreenMessage(
'info', sprintf(
$lng->
txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2145 $tbl = $this->gui->contributor()->ilContributorTableGUI(
2148 $this->
object->getAllLocalRoles($this->node_id)
2161 $user_login = $this->blog_request->getUserLogin();
2162 $user_type = $this->blog_request->getUserType();
2164 if (trim($user_login) ===
'') {
2165 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'msg_no_search_string'));
2169 $users = explode(
',', $user_login);
2171 $user_ids = array();
2172 foreach ($users as
$user) {
2176 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'user_not_known'));
2191 array $a_user_ids = array(),
2192 ?
string $a_user_type =
null 2198 $a_user_type = (
int) $a_user_type;
2204 if (!count($a_user_ids) || !$a_user_type) {
2205 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"));
2211 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2212 if (!in_array($a_user_type, $local_roles)) {
2213 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2218 foreach ($a_user_ids as
$user_id) {
2219 $user_id = (
int) $user_id;
2220 $a_user_type = (
int) $a_user_type;
2221 if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2222 $rbacadmin->
assignUser($a_user_type, $user_id);
2226 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2227 $ilCtrl->redirect($this,
"contributors");
2235 $ids = $this->blog_request->getIds();
2237 if (count($ids) === 0) {
2238 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
2239 $this->
ctrl->redirect($this,
"contributors");
2243 $confirm->setHeaderText($this->
lng->txt(
'blog_confirm_delete_contributors'));
2244 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'removeContributor'));
2245 $confirm->setConfirm($this->
lng->txt(
'delete'),
'removeContributor');
2246 $confirm->setCancel($this->
lng->txt(
'cancel'),
'contributors');
2252 $this->profile_gui->getNamePresentation($user_id,
false,
"",
true)
2256 $this->tpl->setContent($confirm->getHTML());
2265 $ids = $this->blog_request->getIds();
2267 if (count($ids) === 0) {
2268 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"select_one"),
true);
2269 $ilCtrl->redirect($this,
"contributors");
2273 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2274 if (!$local_roles) {
2275 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2281 foreach ($local_roles as $role_id) {
2286 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2287 $this->
ctrl->redirect($this,
"contributors");
2295 $post->setApproved(
false);
2296 $post->setActive(
false);
2297 $post->update(
true,
false,
false);
2299 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2302 $this->
ctrl->redirect($this,
"render");
2321 $this->content_style_gui->
addCss(
2323 $this->
object->getRefId(),
2324 $this->
object->getId()
2340 public function getPrintView(): \ILIAS\Export\PrintProcessGUI
2342 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
2346 $provider = new \ILIAS\Blog\BlogPrintViewProviderGUI(
2351 $this->access_handler,
2353 $this->blog_request->getObjIds()
2356 return new \ILIAS\Export\PrintProcessGUI(
2366 $view = $this->getPrintView();
2372 $print_view = $this->getPrintView();
2373 $print_view->sendPrintView();
2378 $this->
ctrl->redirectByClass(ilExportGUI::class);
ilNavigationHistory $nav_history
setRightContent(string $a_html)
Sets content of right column.
ILIAS Blog InternalDomainService $domain
filterInactivePostings()
Filter inactive items from items list.
export(bool $a_with_comments=false)
Build and deliver export file.
ilRbacReview $rbac_review
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
addUserFromAutoComplete()
Autocomplete submit.
renderNavigationByKeywords(string $a_list_cmd="render", bool $a_show_inactive=false, string $a_link_template="", int $a_blpg=0)
Build navigation by keywords block.
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.
preview()
Render fullscreen presentation.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 _numericMonthToString(int $a_month, bool $a_long=true, ?ilLanguage $lng=null)
numeric month to string
ILIAS Blog Settings Settings $blog_settings
ILIAS Blog ReadingTime ReadingTimeManager $reading_time_manager
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
addHeaderActionForCommand(string $a_cmd)
buildPostingList(int $a_obj_id)
Gather all blog postings.
createExportFileWithComments()
insertHeaderAction(?ilObjectListGUI $list_gui=null)
Insert header action into main template.
Interface Observer Contains several chained tasks and infos about them.
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.
Class ilBlogPosting GUI class.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
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) ...
renderNavigationByAuthors(array $a_items, string $a_list_cmd="render", bool $a_show_inactive=false)
assignUser(int $a_rol_id, int $a_usr_id)
Assigns an user to a role.
StandardGUIRequest $blog_request
exportWithComments()
Handle export choice.
static _lookupName(int $a_user_id)
lookup user name
static _lookupId($a_user_str)
setContent(string $a_html)
Sets content for standard template.
setContentStyleSheet(?ilGlobalTemplateInterface $a_tpl=null)
prepareOutput(bool $show_sub_objects=true)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ILIAS Blog InternalGUIService $gui
static getRelevanceClass(int $cnt, int $max)
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.
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
setLocator()
Insert locator.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
ILIAS Blog Access BlogAccess $blog_access
catch(\Exception $e) $req
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
ILIAS Style Content GUIService $content_style_gui
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getListItems(bool $a_show_inactive=false)
Filter blog postings by month, keyword or author.
initHeaderAction(?string $sub_type=null, ?int $sub_id=null, bool $is_preview=false)
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...
ILIAS Repository Profile ProfileAdapter $profile
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
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:
disableNotes(bool $a_value=false)
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
ilObjBlogGUI: ilBlogPostingGUI, ilWorkspaceAccessGUI ilObjBlogGUI: ilInfoScreenGUI, ilNoteGUI, ilCommonActionDispatcherGUI ilObjBlogGUI: ilPermissionGUI, ilObjectCopyGUI, ilRepositorySearchGUI ilObjBlogGUI: ilExportGUI, ilObjectContentStyleSettingsGUI, ilBlogExerciseGUI, ilObjNotificationSettingsGUI ilObjBlogGUI: ilObjectMetaDataGUI ilObjBlogGUI: ILIAS ilObjBlogGUI: ILIAS
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
confirmRemoveContributor()
Used in ilContributorTableGUI.
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
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)
ILIAS Style Content Object ObjectFacade $content_style_domain
ilGlobalTemplateInterface $tpl
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
afterSave(ilObject $new_object)
render()
Render object context.
ContextServices $tool_context
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
getParentId(int $a_node_id)
get parent id of given node
buildExportFile(bool $a_include_comments=false, bool $print_version=false)
Build export file.
setSettingsSubTabs(string $a_active)
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
getKeywords(bool $a_show_inactive, ?int $a_posting_id=null)
Get keywords for single posting or complete blog.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
renderFullscreenHeader(ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
Last visited history for repository items.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
createPosting()
Create new posting.
static lookupBlogId(int $a_posting_id)
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)
ILIAS Blog ReadingTime BlogSettingsGUI $reading_time_gui
activateTab(string $a_id)
setDescription(string $a_descr)
Sets description below title in standard template.
infoScreen()
this one is called from the info button in the repository
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
ILIAS HTTP Services $http
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
addContributor(array $a_user_ids=array(), ?string $a_user_type=null)
Centralized method to add contributors.
ILIAS Repository Profile ProfileGUI $profile_gui
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...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static lookupSubObjectTitle(int $a_blog_id, int $a_posting_id)
Get title for blog posting (used in ilNotesGUI)
static getKeywords(int $a_obj_id, int $a_posting_id)
filterItemsByKeyword(array $a_items, string $a_keyword)
renderToolbarNavigation(array $a_items, bool $single_posting=false)
Toolbar navigation.
const CMD_LIST_EXPORT_FILES
Class ilRbacAdmin Core functions for role based access control.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
renderList(array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
Build posting month list.
static _lookupType(int $id, bool $reference=false)
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
buildExportLink(string $a_template, string $a_type, string $a_id)
Build export link.
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
deassignUser(int $a_rol_id, int $a_usr_id)
Deassigns a user from a role.
ILIAS Notes Service $notes
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?