19 declare(strict_types=1);
51 protected \ILIAS\Notes\Service
$notes;
76 protected \ILIAS\DI\UIServices
$ui;
82 int $a_id_type = self::REPOSITORY_NODE_ID,
83 int $a_parent_node_id = 0
88 $cs = $DIC->contentStyle();
89 $this->tool_context = $DIC->globalScreen()->tool()->context();
90 $this->notes = $DIC->notes();
95 $this->domain = $domain =
$service->domain();
98 $this->
settings = $domain->settings();
99 $this->
user = $domain->user();
100 $this->tree = $domain->repositoryTree();
101 $this->rbac_review = $domain->rbac()->review();
102 $this->rbacadmin = $domain->rbac()->admin();
103 $this->
lng = $domain->lng();
107 $this->
help = $gui->help();
108 $this->
tabs = $gui->tabs();
109 $this->
toolbar = $gui->toolbar();
110 $this->
ui = $gui->ui();
111 $this->
locator = $gui->locator();
113 $this->nav_history = $DIC[
"ilNavigationHistory"];
114 $this->
ctrl = $gui->ctrl();
119 $this->blpg =
$req->getBlogPage();
120 $this->old_nr =
$req->getOldNr();
121 $this->ppage =
$req->getPPage();
122 $this->user_page =
$req->getUserPage();
123 $this->new_type =
$req->getNewType();
124 $this->prvm =
$req->getPreviewMode();
125 $this->ntf =
$req->getNotification();
126 $this->apid =
$req->getApId();
127 $this->month =
$req->getMonth();
128 $this->keyword =
$req->getKeyword();
129 $this->author =
$req->getAuthor();
133 $blog_page = $this->blog_request->getBlogPage();
134 if ($blog_page > 0 &&
136 throw new ilException(
"Posting ID does not match blog.");
145 if (!$this->month || !$this->items[$this->month]) {
146 $m = array_keys($this->items);
147 $this->month = array_shift($m);
148 $this->month_default =
true;
152 $this->
ctrl->setParameter($this,
"bmn", $this->month);
153 $blog_id = $this->
object->getId();
156 $this->
lng->loadLanguageModule(
"blog");
157 $this->
ctrl->saveParameter($this,
"prvm");
159 $this->content_style_gui = $cs->gui();
160 if (is_object($this->
object)) {
161 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
162 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
164 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
166 $this->blog_settings =
170 $this->reading_time_gui = $gui->
readingTime()->settingsGUI($blog_id);
171 $this->reading_time_manager = $domain->
readingTime();
172 $this->notes = $DIC->notes();
173 $owner = $this->
object?->getOwner() ?? 0;
174 $this->perm = $domain->
perm(
178 $this->
user->getId(),
181 $this->
profile = $domain->profile();
182 $this->profile_gui = $gui->profile();
199 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
209 $this->tabs_gui->addSubTab(
211 $this->
lng->txt(
"general"),
212 $this->
ctrl->getLinkTarget($this,
'edit')
215 $this->tabs_gui->addSubTab(
217 $this->
lng->txt(
"blog_side_blocks"),
218 $this->
ctrl->getLinkTargetByClass(
224 $this->tabs_gui->addSubTab(
226 $this->
lng->txt(
"obj_sty"),
227 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
231 if ($this->id_type === self::REPOSITORY_NODE_ID) {
235 if ($grp_ref_id > 0 || $crs_ref_id > 0) {
237 $this->tabs_gui->addSubTab(
239 $this->
lng->txt(
"notifications"),
240 $this->
ctrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
246 $this->tabs_gui->activateSubTab($a_active);
251 $this->
ctrl->redirectByClass(SettingsGUI::class,
"");
259 if ($this->id_type === self::WORKSPACE_NODE_ID) {
260 $this->
ctrl->setParameter($this,
"wsp_id", $this->node_id);
263 $ilHelp->setScreenIdComponent(
"blog");
266 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
267 $this->tabs_gui->addTab(
270 $this->
ctrl->getLinkTarget($this,
"")
274 $this->tabs_gui->addTab(
277 $this->
ctrl->getLinkTargetByClass(array(
"ilobjbloggui",
"ilinfoscreengui"),
"showSummary")
282 $this->tabs_gui->addTab(
285 $this->
ctrl->getLinkTargetByClass(
286 [SettingsGUI::class],
291 if ($this->id_type === self::REPOSITORY_NODE_ID) {
292 $this->tabs_gui->addTab(
294 $lng->
txt(
"blog_contributors"),
295 $this->
ctrl->getLinkTarget($this,
"contributors")
299 if ($this->id_type === self::REPOSITORY_NODE_ID) {
301 $mdtab = $mdgui->getTab();
303 $this->tabs_gui->addTab(
305 $this->
lng->txt(
"meta_data"),
309 $this->tabs_gui->addTab(
312 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
317 if ($this->perm->mayContribute()) {
318 $this->tabs_gui->addNonTabbedLink(
321 $this->
ctrl->getLinkTarget($this,
"preview")
336 $next_class = $ilCtrl->getNextClass($this);
338 if ($next_class !==
"ilexportgui") {
342 $cmd = $ilCtrl->getCmd();
345 if (($this->id_type === self::REPOSITORY_NODE_ID) && !$this->
getCreationMode() &&
348 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilObjBlogGUI"],
"preview");
349 $ilNavigationHistory->addItem($this->node_id, $link,
"blog");
351 switch ($next_class) {
352 case 'ilblogpostinggui':
353 $this->
ctrl->saveParameter($this,
"user_page");
357 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
362 if ($this->id_type === self::REPOSITORY_NODE_ID) {
366 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
374 $this->perm->mayEditPosting($this->blpg),
381 case "previewFullscreen":
382 $ilCtrl->setParameter($this,
"prvm",
"fsc");
389 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
390 $this->tabs_gui->addNonTabbedLink(
393 $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"previewFullscreen")
395 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
"");
401 $cmd =
"previewFullscreen";
403 if (in_array($cmd, array(
"previewFullscreen"))) {
406 $ret = $ilCtrl->forwardCommand($bpost_gui);
407 if (!$ilTabs->back_target) {
408 $ilCtrl->setParameter($this,
"bmn",
"");
409 $ilTabs->setBackTarget(
411 $ilCtrl->getLinkTarget($this,
"")
417 $is_owner = $this->perm->mayContribute();
418 $is_active = $bpost_gui->getBlogPosting()->getActive();
421 if (($cmd ===
"previewFullscreen")
422 && !$is_owner && !$is_active) {
423 $this->
ctrl->redirect($this,
"preview");
428 case "previewFullscreen":
440 if ($this->id_type === self::WORKSPACE_NODE_ID) {
446 $public_action =
false;
447 if ($cmd !==
"history" && $cmd !==
"edit" && $is_active && empty(
$info)) {
449 $public_action =
true;
451 if ($this->blog_settings->getApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
455 if ($public_action) {
456 $this->tpl->setOnScreenMessage(
'success', implode(
"<br />",
$info));
458 if (count(
$info) > 0) {
459 $this->tpl->setOnScreenMessage(
'info', implode(
"<br />",
$info));
465 if ($cmd !==
"edit") {
470 $this->
tabs->setBackTarget(
"",
"");
477 case "ilinfoscreengui":
487 case "ilcommonactiondispatchergui":
489 $gui->enableCommentsSettings(
false);
491 $this->
ctrl->forwardCommand($gui);
494 case "ilpermissiongui":
496 $ilTabs->activateTab(
"id_permissions");
498 $this->
ctrl->forwardCommand($perm_gui);
501 case "ilobjectcopygui":
504 $cp->setType(
"blog");
505 $this->
ctrl->forwardCommand($cp);
508 case 'ilrepositorysearchgui':
510 $ilTabs->activateTab(
"contributors");
512 $rep_search->setTitle($this->
lng->txt(
"blog_add_contributor"));
513 $rep_search->setCallback($this,
'addContributor', $this->
object->getAllLocalRoles($this->node_id));
514 $this->
ctrl->setReturn($this,
'contributors');
515 $this->
ctrl->forwardCommand($rep_search);
522 case "ilobjectcontentstylesettingsgui":
526 $ilTabs->activateTab(
"settings");
530 if ($this->id_type === self::REPOSITORY_NODE_ID) {
531 $settings_gui = $this->content_style_gui
532 ->objectSettingsGUIForRefId(
537 $settings_gui = $this->content_style_gui
538 ->objectSettingsGUIForObjId(
543 $this->
ctrl->forwardCommand($settings_gui);
547 case "ilblogexercisegui":
548 $this->
ctrl->setReturn($this,
"render");
549 $gui = $this->gui->
exercise()->ilBlogExerciseGUI($this->node_id);
550 $this->
ctrl->forwardCommand($gui);
553 case 'ilobjnotificationsettingsgui':
555 $ilTabs->activateTab(
"settings");
558 $this->
ctrl->forwardCommand($gui);
561 case strtolower(ilObjectMetaDataGUI::class):
564 $ilTabs->activateTab(
"meta_data");
566 $this->
ctrl->forwardCommand($gui);
569 case strtolower(SettingsGUI::class):
572 $ilTabs->activateTab(
"settings");
574 $gui = $this->gui->
settings()->settingsGUI(
576 $this->id_type === self::REPOSITORY_NODE_ID
578 $this->
ctrl->forwardCommand($gui);
581 case strtolower(\
ILIAS\Blog\
Settings\BlockSettingsGUI::class):
584 $ilTabs->activateTab(
"settings");
586 $gui = $this->gui->
settings()->blockSettingsGUI(
588 $this->id_type === self::REPOSITORY_NODE_ID
590 $this->
ctrl->forwardCommand($gui);
594 if ($cmd !==
"gethtml") {
596 if ($cmd ===
"addToDesk" || $cmd ===
"removeFromDesk") {
597 $this->{$cmd .
"Object"}();
608 parent::executeCommand();
615 $this->
tabs->activateTab(
"export");
617 $this->
ctrl->forwardCommand($exp_gui);
624 $this->
tabs->activateTab(
"export");
632 $this->
tabs->activateTab(
"export");
638 $be = $this->domain->exercise($this->node_id);
639 $be_gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
640 $assignments = $be->getAssignmentsOfBlog();
641 if (count($assignments) > 0) {
642 $ass_ids =
array_map(
static function ($i) {
647 $this->tool_context->current()->addAdditionalData(
649 $be_gui->getActionButtons()
659 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
672 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
673 $info->enablePrivateNotes();
681 $info->enableNewsEditing(
false);
684 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
686 if ($enable_internal_rss) {
687 $info->setBlockProperty(
"news",
"settings",
"1");
688 $info->setBlockProperty(
"news",
"public_notifications_option",
"1");
693 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
706 $title = $this->blog_request->
getTitle();
710 $posting->setTitle($title);
711 $posting->setBlogId($this->
object->getId());
712 $posting->setActive(
false);
713 $posting->setAuthor($ilUser->getId());
714 $posting->create(
false);
717 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
719 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
720 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
722 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_title"),
true);
723 $ilCtrl->redirect($this,
"render");
739 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
743 $ilTabs->activateTab(
"content");
746 if ($this->perm->mayContribute()) {
747 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
751 $ilToolbar->addStickyItem($title,
true);
753 document.getElementById('title').setAttribute('data-blog-input', 'posting-title'); 754 document.getElementById('title').setAttribute('placeholder', ' '); 760 )->submit()->toToolbar(
true, $ilToolbar);
763 $keys = array_keys($this->items);
764 $first = array_shift($keys);
765 if ($first != $this->month) {
766 $ilToolbar->addSeparator();
768 $ilCtrl->setParameter($this,
"bmn", $first);
769 $url = $ilCtrl->getLinkTarget($this,
"");
770 $ilCtrl->setParameter($this,
"bmn", $this->month);
775 )->emphasised()->toToolbar(
true, $ilToolbar);
779 $print_view = $this->getPrintView();
780 $modal_elements = $print_view->getModalElements(
781 $this->
ctrl->getLinkTarget(
786 $ilToolbar->addSeparator();
787 $ilToolbar->addComponent($modal_elements->button);
788 $ilToolbar->addComponent($modal_elements->modal);
792 $is_owner = $this->perm->mayContribute();
798 $list = $this->
renderList($list_items,
"preview",
"", $is_owner);
813 bool $a_show_inactive =
false 816 $list_items = array();
817 foreach ($this->items as $month => $items) {
818 foreach ($items as
$id => $item) {
819 if ($item[
"author"] == $this->author ||
820 (isset($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
821 $list_items[
$id] = $item;
825 } elseif ($this->keyword) {
828 $max = $this->blog_settings->getOverviewPostings();
829 if ($this->month_default && $max) {
830 $list_items = array();
831 foreach ($this->items as $month => $postings) {
832 foreach ($postings as
$id => $item) {
833 if (!$a_show_inactive &&
837 $list_items[
$id] = $item;
839 if (count($list_items) >= $max) {
860 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
870 $list = $this->
renderList($list_items,
"previewFullscreen");
882 bool $a_with_comments =
false 903 $owner = $this->
object->getOwner();
905 $ilTabs->clearTargets();
912 if ($owner === $ilUser->getId()) {
914 if ($this->id_type === self::WORKSPACE_NODE_ID) {
915 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" .
$this->node_id;
918 elseif ($this->perm->mayContribute()) {
919 $this->
ctrl->setParameter($this,
"prvm",
"");
920 if ($this->blpg === 0) {
921 $back = $this->
ctrl->getLinkTarget($this,
"");
923 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
924 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
925 $back = $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
927 $this->
ctrl->setParameter($this,
"prvm", $this->prvm);
930 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
935 if ($this->id_type === self::WORKSPACE_NODE_ID) {
936 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
939 elseif ($this->perm->mayContribute()) {
940 $back = $this->
ctrl->getLinkTarget($this,
"");
941 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
954 $this->
ctrl->setParameter($this,
"bmn",
"");
956 $this->
ctrl->setParameter($this,
"bmn", $this->month);
968 bool $a_export =
false 976 $this->
object->getId(),
983 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
985 $name = $name[
"lastname"] .
", " . $name[
"firstname"];
989 if ($this->blog_settings?->getProfilePicture() && !$a_export) {
991 if ($this->id_type === self::REPOSITORY_NODE_ID) {
993 if ($this->blpg > 0 && !$a_export) {
995 $author_id =
$post->getAuthor();
997 $ppic = $this->profile_gui->getPicturePath($author_id);
998 $name = $this->profile_gui->getNamePresentation($author_id);
1007 $ppic = basename($ppic);
1016 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1029 $author_found =
false;
1033 if ($this->author &&
1034 ($posting[
"author"] == $this->author ||
1035 (is_array($posting[
"editors"] ??
false) && in_array($this->author, $posting[
"editors"])))) {
1036 $author_found =
true;
1039 $month = substr($posting[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1040 $items[
$month][$posting[
"id"]] = $posting;
1043 if ($this->author && !$author_found) {
1044 $this->author =
null;
1055 string $a_cmd =
"preview",
1056 string $a_link_template =
"",
1057 bool $a_show_inactive =
false,
1058 string $a_export_directory =
"" 1066 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"components/ILIAS/Blog");
1068 $is_admin = $this->perm->canManage();
1072 foreach ($items as $item) {
1075 if (!$is_active && !$a_show_inactive) {
1082 if (!$this->keyword && !$this->author) {
1083 $month = substr($item[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1086 if (!$last_month || $last_month != $month) {
1088 $wtpl->setCurrentBlock(
"month_bl");
1089 $wtpl->parseCurrentBlock();
1093 if ($this->keyword) {
1095 } elseif ($this->author) {
1096 $title =
$lng->
txt(
"blog_author") .
": " . $this->profile_gui->getNamePresentation($this->author);
1098 $title = $this->gui->presentation()->util()->getMonthPresentation($month);
1102 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1105 if (!$a_link_template) {
1106 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1107 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1108 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1110 $preview = $this->
buildExportLink($a_link_template,
"posting", (
string) $item[
"id"]);
1112 $more_link = $preview;
1115 $posting_edit = $this->perm->mayEditPosting($item[
"id"], $item[
"author"]);
1116 if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd ===
"preview") {
1119 if ($is_active && $this->blog_settings->getApproval() && !$item[
"approved"]) {
1121 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1124 $ilCtrl->getLinkTarget($this,
"approve")
1126 $ilCtrl->setParameter($this,
"apid",
"");
1129 $wtpl->setVariable(
"APPROVAL",
$lng->
txt(
"blog_needs_approval"));
1132 if ($posting_edit) {
1135 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit")
1137 $more_link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1142 $lng->
txt(
"blog_toggle_draft"),
1143 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList")
1147 $lng->
txt(
"blog_toggle_final"),
1148 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList")
1154 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle")
1157 if ($this->blog_settings->getKeywords()) {
1159 $lng->
txt(
"blog_edit_keywords"),
1160 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords")
1166 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate")
1171 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1173 } elseif ($is_admin) {
1176 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1178 $lng->
txt(
"blog_toggle_draft_admin"),
1179 $ilCtrl->getLinkTarget($this,
"deactivateAdmin")
1181 $ilCtrl->setParameter($this,
"apid",
"");
1186 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1190 $dd =
$ui_factory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
1192 $wtpl->setCurrentBlock(
"actions");
1193 $wtpl->setVariable(
"ACTION_SELECTOR",
$ui_renderer->render($dd));
1194 $wtpl->parseCurrentBlock();
1200 $notes_context = $this->notes
1207 $count = $this->notes
1209 ->getNrOfCommentsForContext($notes_context);
1211 if ($a_cmd !==
"preview") {
1212 $wtpl->setCurrentBlock(
"comments");
1213 $wtpl->setVariable(
"TEXT_COMMENTS",
$lng->
txt(
"blog_comments"));
1214 $wtpl->setVariable(
"URL_COMMENTS", $preview);
1215 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1216 $wtpl->parseCurrentBlock();
1221 if ($this->node_id !==
null &&
1222 $a_cmd !==
"preview") {
1223 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1224 $goto = $this->gui->permanentLink(0, (
int) $this->node_id)->getPermanentLink((
int) $item[
"id"]);
1226 $goto = $this->gui->permanentLink((
int) $this->node_id)->getPermanentLink((
int) $item[
"id"]);
1228 $wtpl->setCurrentBlock(
"permalink");
1229 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1230 $wtpl->setVariable(
"TEXT_PERMALINK",
$lng->
txt(
"blog_link"));
1231 $wtpl->parseCurrentBlock();
1236 $this->blog_settings->getAbstractShorten(),
1237 $this->blog_settings->getAbstractShortenLength(),
1239 $this->blog_settings->getAbstractImage(),
1240 $this->blog_settings->getAbstractImageWidth(),
1241 $this->blog_settings->getAbstractImageHeight(),
1246 $wtpl->setCurrentBlock(
"more");
1247 $wtpl->setVariable(
"URL_MORE", $more_link);
1248 $wtpl->setVariable(
"TEXT_MORE",
$lng->
txt(
"blog_list_more"));
1249 $wtpl->parseCurrentBlock();
1255 $wtpl->setCurrentBlock(
"draft_text");
1256 $wtpl->setVariable(
"DRAFT_TEXT",
$lng->
txt(
"blog_draft_text"));
1257 $wtpl->parseCurrentBlock();
1258 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1262 $reading_time = $this->reading_time_manager->getReadingTime(
1266 if (!is_null($reading_time)) {
1267 $this->
lng->loadLanguageModule(
"copg");
1268 $wtpl->setCurrentBlock(
"reading_time");
1271 $this->
lng->txt(
"copg_est_reading_time") .
": " .
1272 sprintf($this->
lng->txt(
"copg_x_minutes"), $reading_time)
1274 $wtpl->parseCurrentBlock();
1277 $wtpl->setCurrentBlock(
"posting");
1280 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1283 $author_id = $item[
"author"];
1285 $authors[] = $this->profile_gui->getNamePresentation($author_id);
1288 if (isset($item[
"editors"])) {
1289 foreach ($item[
"editors"] as $editor_id) {
1290 $authors[] = $this->profile_gui->getNamePresentation($editor_id);
1295 $author = implode(
", ", $authors) .
" - ";
1300 $wtpl->setVariable(
"URL_TITLE", $preview);
1301 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1305 $keywords = (count($kw) > 0)
1306 ?
"<br>" . $this->
lng->txt(
"keywords") .
": " . implode(
", ", $kw)
1309 $wtpl->setVariable(
"DATETIME", $author .
1313 $wtpl->setVariable(
"CONTENT", $snippet);
1315 $wtpl->parseCurrentBlock();
1319 if ($a_cmd ===
"previewFullscreen") {
1320 $ref_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1323 $wsp_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1326 $this->gui->permanentLink(
$ref_id, $wsp_id)->setPermanentLink();
1329 if (!$is_empty || $a_show_inactive) {
1330 return $wtpl->get();
1343 return BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->
getKeywords(
false));
1352 string $a_list_cmd =
"render",
1353 string $a_posting_cmd =
"preview",
1354 ?
string $a_link_template =
null,
1355 bool $a_show_inactive =
false,
1360 $blpg = ($a_blpg > 0)
1366 foreach ($a_items as $month => $postings) {
1367 foreach (array_keys($postings) as
$id) {
1369 if (!$a_show_inactive && !$active) {
1370 unset($a_items[$month][
$id]);
1372 $a_items[
$month][
$id][
"active"] = $active;
1375 if (!count($a_items[$month])) {
1376 unset($a_items[$month]);
1382 $max_months = $this->blog_settings->getNavModeListMonths();
1384 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"components/ILIAS/Blog");
1386 $ilCtrl->setParameter($this,
"blpg",
"");
1388 $counter = $mon_counter = $last_year = 0;
1389 foreach ($a_items as $month => $postings) {
1390 if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1395 $year = substr($month, 0, 4);
1396 if (!$last_year || $year != $last_year) {
1405 if (!$a_link_template) {
1406 $ilCtrl->setParameter($this,
"bmn", $month);
1407 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1409 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1414 if ($mon_counter <= $this->blog_settings->getNavModeListMonthsWithPostings()) {
1416 $wtpl->setCurrentBlock(
"navigation_year_details");
1417 $wtpl->setVariable(
"YEAR", $year);
1418 $wtpl->parseCurrentBlock();
1421 foreach ($postings as
$id => $posting) {
1432 if (!$a_link_template) {
1433 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1434 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1435 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1440 if (!$posting[
"active"]) {
1441 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1442 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1443 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1446 $wtpl->setCurrentBlock(
"navigation_item");
1447 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1448 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1449 $wtpl->parseCurrentBlock();
1452 $wtpl->setCurrentBlock(
"navigation_month_details");
1453 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1454 $wtpl->setVariable(
"URL_MONTH", $month_url);
1459 $wtpl->setCurrentBlock(
"navigation_year");
1460 $wtpl->setVariable(
"YEAR", $year);
1461 $wtpl->parseCurrentBlock();
1464 $wtpl->setCurrentBlock(
"navigation_month");
1465 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1466 $wtpl->setVariable(
"URL_MONTH", $month_url);
1467 $wtpl->setVariable(
"MONTH_COUNT", count($postings));
1469 $wtpl->parseCurrentBlock();
1471 if (!$a_link_template) {
1472 $this->
ctrl->setParameterByClass(self::class,
"bmn",
null);
1473 $url = $this->
ctrl->getLinkTargetByClass(self::class, $a_list_cmd);
1475 $url =
"index.html";
1480 $this->
ui->renderer()->render(
1481 $this->
ui->factory()->link()->standard(
1482 $this->
lng->txt(
"blog_starting_page"),
1490 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"components/ILIAS/Blog");
1492 $ilCtrl->setParameter($this,
"blpg",
"");
1494 $month_options = array();
1495 foreach ($a_items as $month => $postings) {
1496 $month_name = $this->gui->presentation()->util()->getMonthPresentation($month);
1498 $month_options[
$month] = $month_name;
1500 if ($month == $this->month) {
1501 if (!$a_link_template) {
1502 $ilCtrl->setParameter($this,
"bmn", $month);
1503 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1505 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1508 foreach ($postings as
$id => $posting) {
1512 if (!$a_link_template) {
1513 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1514 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1515 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1520 if (!$posting[
"active"]) {
1521 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1522 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1523 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1526 $wtpl->setCurrentBlock(
"navigation_item");
1527 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1528 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1529 $wtpl->parseCurrentBlock();
1532 $wtpl->setCurrentBlock(
"navigation_month_details");
1534 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1535 $wtpl->setVariable(
"URL_MONTH", $month_url);
1537 $wtpl->parseCurrentBlock();
1542 $wtpl->setCurrentBlock(
"option_bl");
1543 foreach ($month_options as $value => $caption) {
1544 $wtpl->setVariable(
"OPTION_VALUE", $value);
1545 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1546 if ($value == $this->month) {
1547 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1549 $wtpl->parseCurrentBlock();
1552 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1555 $ilCtrl->setParameter($this,
"bmn", $this->month);
1556 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1557 return $wtpl->get();
1564 string $a_list_cmd =
"render",
1565 bool $a_show_inactive =
false,
1566 string $a_link_template =
"",
1571 $blpg = ($a_blpg > 0)
1575 $keywords = $this->
getKeywords($a_show_inactive, $blpg);
1577 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"components/ILIAS/Blog");
1579 $max = max($keywords);
1581 $wtpl->setCurrentBlock(
"keyword");
1582 foreach ($keywords as $keyword => $counter) {
1583 if (!$a_link_template) {
1584 $ilCtrl->setParameter($this,
"kwd", urlencode((
string) $keyword));
1585 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1586 $ilCtrl->setParameter($this,
"kwd",
"");
1591 $wtpl->setVariable(
"TXT_KEYWORD", $keyword);
1593 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1594 $wtpl->parseCurrentBlock();
1597 return $wtpl->get();
1604 string $a_list_cmd =
"render",
1605 bool $a_show_inactive =
false 1610 foreach ($a_items as $month => $items) {
1611 foreach ($items as $item) {
1613 if ($item[
"author"]) {
1614 $authors[] = $item[
"author"];
1617 if (isset($item[
"editors"])) {
1618 foreach ($item[
"editors"] as $editor_id) {
1619 if ($editor_id != $item[
"author"]) {
1620 $authors[] = $editor_id;
1628 $authors = array_unique($authors);
1631 $authors = array_filter($authors,
function (
$id) {
1635 if (count($authors) > 1) {
1639 $ilCtrl->setParameter($this,
"ath", $user_id);
1640 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1641 $ilCtrl->setParameter($this,
"ath",
"");
1644 if (substr($base_name, 0, 1) ==
"[") {
1658 $sort = $name_arr[
"lastname"] .
" " . $name_arr[
"firstname"];
1661 $idx = trim(strip_tags($sort)) .
"///" .
$user_id;
1662 $list[$idx] = array($name,
$url);
1667 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"components/ILIAS/Blog");
1669 $wtpl->setCurrentBlock(
"author");
1670 foreach ($list as $author) {
1671 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1672 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1673 $wtpl->parseCurrentBlock();
1676 return $wtpl->get();
1686 bool $single_posting =
false 1688 $nav_renderer = $this->gui->navigation()->toolbarNavigationRenderer();
1689 $nav_renderer->renderToolbarNavigation(
1703 string $a_list_cmd =
"render",
1704 string $a_posting_cmd =
"preview",
1705 ?
string $a_link_template =
null,
1706 bool $a_show_inactive =
false,
1711 $blpg = ($a_blpg > 0)
1715 if ($this->blog_settings->getOrder()) {
1716 $order = array_flip($this->blog_settings->getOrder());
1725 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"components/ILIAS/Blog");
1730 if (count($a_items)) {
1731 $blocks[$order[
"navigation"]] = array(
1732 $this->
lng->txt(
"blog_navigation"),
1733 $this->
renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
1737 if ($this->blog_settings->getKeywords()) {
1739 $may_edit_keywords = ($blpg > 0 &&
1740 $this->perm->mayEditPosting($blpg) &&
1741 $a_list_cmd !==
"preview" &&
1742 $a_list_cmd !==
"gethtml" &&
1745 if ($keywords || $may_edit_keywords) {
1747 $keywords = $this->
lng->txt(
"blog_no_keywords");
1750 $blocks[$order[
"keywords"]] = array(
1751 $this->
lng->txt(
"blog_keywords"),
1754 ? array($cmd, $this->
lng->txt(
"blog_edit_keywords"))
1761 if (!$a_link_template) {
1763 if ($this->id_type === self::REPOSITORY_NODE_ID &&
1764 $this->blog_settings->getAuthors()) {
1767 $blocks[$order[
"authors"]] = array($this->
lng->txt(
"blog_authors"), $authors);
1772 if ($this->blog_settings->getRSS() &&
1774 $a_list_cmd ===
"preview") {
1777 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
1780 $url = ILIAS_HTTP_PATH .
"/feed.php?blog_id=" . $blog_id .
1781 "&client_id=" . rawurlencode(
CLIENT_ID);
1787 if (count($blocks)) {
1794 foreach ($blocks as $block) {
1797 $content = $block[1];
1799 $secondary_panel =
$ui_factory->panel()->secondary()->legacy($title,
$ui_factory->legacy()->content($content));
1801 if (isset($block[2]) && is_array($block[2])) {
1802 $link =
$ui_factory->button()->shy($block[2][1], $block[2][0]);
1803 $secondary_panel = $secondary_panel->withFooter($link);
1806 $wtpl->setCurrentBlock(
"block_bl");
1807 $wtpl->setVariable(
"BLOCK",
$ui_renderer->render($secondary_panel));
1808 $wtpl->parseCurrentBlock();
1812 return $wtpl->get();
1819 bool $a_show_inactive,
1820 ?
int $a_posting_id =
null 1822 $keywords = array();
1823 if ($a_posting_id) {
1825 if (isset($keywords[$keyword])) {
1832 foreach ($this->items as $month => $items) {
1833 foreach ($items as $item) {
1836 if (isset($keywords[$keyword])) {
1849 foreach ($keywords as $keyword => $counter) {
1850 $tmp[] = array(
"keyword" => $keyword,
"counter" => $counter);
1854 $keywords = array();
1855 foreach ($tmp as $item) {
1856 $keywords[(string) $item[
"keyword"]] = $item[
"counter"];
1865 bool $a_include_comments =
false,
1866 bool $print_version =
false 1869 $format = explode(
"_", $this->blog_request->getFormat());
1870 if (($format[1] ??
"") ===
"comments" || $a_include_comments) {
1871 $a_include_comments =
true;
1872 $type =
"html_comments";
1879 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
1880 if ($print_version) {
1885 $blog_export->setPrintVersion($print_version);
1886 $blog_export->includeComments($a_include_comments);
1887 $blog_export->exportHTML();
1888 return $blog_export;
1898 $this->disable_notes = $a_value;
1907 if ($a_cmd ===
"preview" || $a_cmd ===
"previewFullscreen" || $this->prvm) {
1915 $ilCtrl->setParameter($this,
"prvm",
"");
1924 ?
string $sub_type =
null,
1925 ?
int $sub_id =
null,
1926 bool $is_preview =
false 1930 if (!$this->obj_id) {
1933 $sub_type = $sub_id =
null;
1934 if ($this->blpg > 0) {
1939 $lg = parent::initHeaderAction($sub_type, $sub_id);
1943 $lg->enableComments(
false);
1944 $lg->enableNotes(
false);
1947 if ($this->blpg > 0) {
1949 $lg->enableComments(
true);
1951 $lg->enableNotes(
true);
1953 $lg->enableTags(
false);
1956 $ilCtrl->setParameter($this,
"ntf", 1);
1957 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1958 $ilCtrl->setParameter($this,
"ntf",
"");
1960 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
1966 $this->
lng->txt(
"blog_notification_activated")
1969 $ilCtrl->setParameter($this,
"ntf", 2);
1970 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1971 $ilCtrl->setParameter($this,
"ntf",
"");
1972 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
1977 $this->
lng->txt(
"blog_notification_deactivated")
1982 if ($this->perm->mayContribute()) {
1983 $ilCtrl->setParameter($this,
"prvm",
"");
1985 $ilCtrl->setParameter($this,
"bmn",
"");
1986 $ilCtrl->setParameter($this,
"blpg",
"");
1987 $link = $ilCtrl->getLinkTarget($this,
"");
1988 $ilCtrl->setParameter($this,
"blpg", $sub_id);
1989 $ilCtrl->setParameter($this,
"bmn", $this->month);
1990 $lg->addCustomCommand($link,
"blog_edit");
1992 if ($sub_id && $this->perm->mayEditPosting($sub_id)) {
1993 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1994 $lg->addCustomCommand($link,
"blog_edit_posting");
1997 $ilCtrl->setParameter($this,
"prvm",
"fsc");
2000 $ilCtrl->setParameter($this,
"ntf",
"");
2011 switch ($this->ntf) {
2021 $ilCtrl->redirect($this,
"preview");
2033 if (
$post->getBlogId() === $a_blog_id) {
2034 return $post->getTitle();
2044 foreach ($this->items as $month => $postings) {
2045 foreach ($postings as
$id => $item) {
2047 unset($this->items[$month][
$id]);
2048 } elseif ($this->blog_settings->getApproval() && !$item[
"approved"]) {
2049 unset($this->items[$month][
$id]);
2052 if (!count($this->items[$month])) {
2053 unset($this->items[$month]);
2057 if ($this->items && !isset($this->items[$this->month])) {
2058 $keys = array_keys($this->items);
2059 $this->month = array_shift($keys);
2068 foreach ($a_items as $month => $items) {
2069 foreach ($items as $item) {
2085 if (is_object($this->
object)) {
2092 if ($this->perm->canManage() && $this->apid > 0) {
2094 $post->setApproved(
true);
2095 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2096 $post->update(
true,
false,
true,
"new");
2098 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2101 $this->
ctrl->redirect($this,
"render");
2121 $ilTabs->activateTab(
"contributors");
2123 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2130 'auto_complete_name' =>
$lng->
txt(
'user'),
2131 'submit_name' =>
$lng->
txt(
'add'),
2132 'add_search' =>
true,
2134 'user_type' => $local_roles
2139 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2141 $this->tpl->setOnScreenMessage(
'info', sprintf(
$lng->
txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2144 $table = $this->gui->contributor()->contributorTableBuilder(
2145 $this->
object->getAllLocalRoles($this->node_id),
2150 if ($table->handleCommand()) {
2164 $user_login = $this->blog_request->getUserLogin();
2165 $user_type = $this->blog_request->getUserType();
2167 if (trim($user_login) ===
'') {
2168 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'msg_no_search_string'));
2172 $users = explode(
',', $user_login);
2174 $user_ids = array();
2175 foreach ($users as
$user) {
2179 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'user_not_known'));
2194 array $a_user_ids = array(),
2195 ?
string $a_user_type =
null 2201 $a_user_type = (
int) $a_user_type;
2207 if (!count($a_user_ids) || !$a_user_type) {
2208 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"));
2214 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2215 if (!in_array($a_user_type, $local_roles)) {
2216 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2221 foreach ($a_user_ids as
$user_id) {
2222 $user_id = (
int) $user_id;
2223 $a_user_type = (
int) $a_user_type;
2224 if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2225 $rbacadmin->
assignUser($a_user_type, $user_id);
2229 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2230 $ilCtrl->redirect($this,
"contributors");
2239 $ids = $this->blog_request->getIds();
2241 if (count($ids) === 0) {
2242 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
2243 $this->
ctrl->redirect($this,
"contributors");
2247 $confirm->setHeaderText($this->
lng->txt(
'blog_confirm_delete_contributors'));
2248 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'removeContributor'));
2249 $confirm->setConfirm($this->
lng->txt(
'delete'),
'removeContributor');
2250 $confirm->setCancel($this->
lng->txt(
'cancel'),
'contributors');
2256 $this->profile_gui->getNamePresentation($user_id,
false,
"",
true)
2260 $this->tpl->setContent($confirm->getHTML());
2269 $ids = $this->blog_request->getIds();
2271 if (count($ids) === 0) {
2272 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"select_one"),
true);
2273 $ilCtrl->redirect($this,
"contributors");
2277 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2278 if (!$local_roles) {
2279 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2285 foreach ($local_roles as $role_id) {
2290 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2291 $this->
ctrl->redirect($this,
"contributors");
2300 $ids = $this->blog_request->getIds();
2305 $this->
ctrl->redirect($this,
"contributors");
2313 $post->setApproved(
false);
2314 $post->setActive(
false);
2315 $post->update(
true,
false,
false);
2317 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2320 $this->
ctrl->redirect($this,
"render");
2339 $this->content_style_gui->
addCss(
2341 $this->
object->getRefId(),
2342 $this->
object->getId()
2358 public function getPrintView(): \ILIAS\Export\PrintProcessGUI
2360 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
2364 $provider = new \ILIAS\Blog\BlogPrintViewProviderGUI(
2369 $this->access_handler,
2371 $this->blog_request->getObjIds()
2374 return new \ILIAS\Export\PrintProcessGUI(
2384 $view = $this->getPrintView();
2390 $print_view = $this->getPrintView();
2391 $print_view->sendPrintView();
2396 $this->
ctrl->redirectByClass(ilExportGUI::class);
ilNavigationHistory $nav_history
setRightContent(string $a_html)
Sets content of right column.
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.
confirmRemoveContributor(array $ids=[])
Used in ContributorTableBuilder.
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
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.
ReadingTimeManager $reading_time_manager
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)
perm( $access_handler, ?int $node_id, int $id_type, int $user_id, int $owner)
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.
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.
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...
static http()
Fetches the global http state from ILIAS.
addContributorContainerAction(array $ids=[])
Used in ContributorTableBuilder.
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)
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.
InternalDomainService $domain
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
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.
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?