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"}();
602 parent::executeCommand();
609 $this->
tabs->activateTab(
"export");
611 $this->
ctrl->forwardCommand($exp_gui);
618 $this->
tabs->activateTab(
"export");
626 $this->
tabs->activateTab(
"export");
632 $be = $this->domain->exercise($this->node_id);
633 $be_gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
634 $assignments = $be->getAssignmentsOfBlog();
635 if (count($assignments) > 0) {
636 $ass_ids =
array_map(
static function ($i) {
641 $this->tool_context->current()->addAdditionalData(
643 $be_gui->getActionButtons()
653 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
666 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
667 $info->enablePrivateNotes();
675 $info->enableNewsEditing(
false);
678 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
680 if ($enable_internal_rss) {
681 $info->setBlockProperty(
"news",
"settings",
"1");
682 $info->setBlockProperty(
"news",
"public_notifications_option",
"1");
687 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
689 $this->
ctrl->forwardCommand($info);
700 $title = $this->blog_request->
getTitle();
704 $posting->setTitle($title);
705 $posting->setBlogId($this->
object->getId());
706 $posting->setActive(
false);
707 $posting->setAuthor($ilUser->getId());
708 $posting->create(
false);
711 $ilCtrl->setParameter($this,
"bmn", date(
"Y-m"));
713 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $posting->getId());
714 $ilCtrl->redirectByClass(
"ilblogpostinggui",
"edit");
716 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_title"),
true);
717 $ilCtrl->redirect($this,
"render");
733 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
737 $ilTabs->activateTab(
"content");
740 if ($this->blog_access->mayContribute()) {
741 $ilToolbar->setFormAction($ilCtrl->getFormAction($this,
"createPosting"));
745 $ilToolbar->addStickyItem($title,
true);
747 document.getElementById('title').setAttribute('data-blog-input', 'posting-title'); 748 document.getElementById('title').setAttribute('placeholder', ' '); 754 )->submit()->toToolbar(
true, $ilToolbar);
757 $keys = array_keys($this->items);
758 $first = array_shift($keys);
759 if ($first != $this->month) {
760 $ilToolbar->addSeparator();
762 $ilCtrl->setParameter($this,
"bmn", $first);
763 $url = $ilCtrl->getLinkTarget($this,
"");
764 $ilCtrl->setParameter($this,
"bmn", $this->month);
769 )->emphasised()->toToolbar(
true, $ilToolbar);
773 $print_view = $this->getPrintView();
774 $modal_elements = $print_view->getModalElements(
775 $this->
ctrl->getLinkTarget(
780 $ilToolbar->addSeparator();
781 $ilToolbar->addComponent($modal_elements->button);
782 $ilToolbar->addComponent($modal_elements->modal);
786 $is_owner = $this->blog_access->mayContribute();
792 $list = $this->
renderList($list_items,
"preview",
"", $is_owner);
807 bool $a_show_inactive =
false 810 $list_items = array();
811 foreach ($this->items as $month => $items) {
812 foreach ($items as
$id => $item) {
813 if ($item[
"author"] == $this->author ||
814 (isset($item[
"editors"]) && in_array($this->author, $item[
"editors"]))) {
815 $list_items[
$id] = $item;
819 } elseif ($this->keyword) {
822 $max = $this->blog_settings->getOverviewPostings();
823 if ($this->month_default && $max) {
824 $list_items = array();
825 foreach ($this->items as $month => $postings) {
826 foreach ($postings as
$id => $item) {
827 if (!$a_show_inactive &&
831 $list_items[
$id] = $item;
833 if (count($list_items) >= $max) {
854 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_permission"));
864 $list = $this->
renderList($list_items,
"previewFullscreen");
876 bool $a_with_comments =
false 897 $owner = $this->
object->getOwner();
899 $ilTabs->clearTargets();
906 if ($owner === $ilUser->getId()) {
908 if ($this->id_type === self::WORKSPACE_NODE_ID) {
909 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" .
$this->node_id;
912 elseif ($this->blog_access->mayContribute()) {
913 $this->
ctrl->setParameter($this,
"prvm",
"");
914 if ($this->blpg === 0) {
915 $back = $this->
ctrl->getLinkTarget($this,
"");
917 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
918 $this->
ctrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $this->blpg);
919 $back = $this->
ctrl->getLinkTargetByClass(
"ilblogpostinggui",
"preview");
921 $this->
ctrl->setParameter($this,
"prvm", $this->prvm);
924 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
929 if ($this->id_type === self::WORKSPACE_NODE_ID) {
930 $back =
"ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
933 elseif ($this->blog_access->mayContribute()) {
934 $back = $this->
ctrl->getLinkTarget($this,
"");
935 $back_caption = $this->
lng->txt(
"blog_back_to_blog_owner");
948 $this->
ctrl->setParameter($this,
"bmn",
"");
950 $this->
ctrl->setParameter($this,
"bmn", $this->month);
962 bool $a_export =
false 970 $this->
object->getId(),
977 if ($this->id_type !== self::REPOSITORY_NODE_ID) {
979 $name = $name[
"lastname"] .
", " . $name[
"firstname"];
983 if ($this->blog_settings?->getProfilePicture() && !$a_export) {
985 if ($this->id_type === self::REPOSITORY_NODE_ID) {
987 if ($this->blpg > 0 && !$a_export) {
989 $author_id =
$post->getAuthor();
991 $ppic = $this->profile_gui->getPicturePath($author_id);
992 $name = $this->profile_gui->getNamePresentation($author_id);
1001 $ppic = basename($ppic);
1010 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1023 $author_found =
false;
1027 if ($this->author &&
1028 ($posting[
"author"] == $this->author ||
1029 (is_array($posting[
"editors"] ??
false) && in_array($this->author, $posting[
"editors"])))) {
1030 $author_found =
true;
1033 $month = substr($posting[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1034 $items[
$month][$posting[
"id"]] = $posting;
1037 if ($this->author && !$author_found) {
1038 $this->author = null;
1049 string $a_cmd =
"preview",
1050 string $a_link_template =
"",
1051 bool $a_show_inactive =
false,
1052 string $a_export_directory =
"" 1060 $wtpl =
new ilTemplate(
"tpl.blog_list.html",
true,
true,
"components/ILIAS/Blog");
1066 foreach ($items as $item) {
1069 if (!$is_active && !$a_show_inactive) {
1076 if (!$this->keyword && !$this->author) {
1077 $month = substr($item[
"created"]->
get(
IL_CAL_DATE), 0, 7);
1080 if (!$last_month || $last_month != $month) {
1082 $wtpl->setCurrentBlock(
"month_bl");
1083 $wtpl->parseCurrentBlock();
1087 if ($this->keyword) {
1089 } elseif ($this->author) {
1090 $title =
$lng->
txt(
"blog_author") .
": " . $this->profile_gui->getNamePresentation($this->author);
1092 $title = $this->gui->presentation()->util()->getMonthPresentation($month);
1096 $wtpl->setVariable(
"TXT_CURRENT_MONTH", $title);
1099 if (!$a_link_template) {
1100 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $this->month);
1101 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg", $item[
"id"]);
1102 $preview = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_cmd);
1104 $preview = $this->
buildExportLink($a_link_template,
"posting", (
string) $item[
"id"]);
1106 $more_link = $preview;
1109 $posting_edit = $this->blog_access->mayEditPosting($item[
"id"], $item[
"author"]);
1110 if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd ===
"preview") {
1113 if ($is_active && $this->blog_settings->getApproval() && !$item[
"approved"]) {
1115 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1118 $ilCtrl->getLinkTarget($this,
"approve")
1120 $ilCtrl->setParameter($this,
"apid",
"");
1123 $wtpl->setVariable(
"APPROVAL",
$lng->
txt(
"blog_needs_approval"));
1126 if ($posting_edit) {
1129 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit")
1131 $more_link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1136 $lng->
txt(
"blog_toggle_draft"),
1137 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deactivatePageToList")
1141 $lng->
txt(
"blog_toggle_final"),
1142 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"activatePageToList")
1148 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edittitle")
1151 if ($this->blog_settings->getKeywords()) {
1153 $lng->
txt(
"blog_edit_keywords"),
1154 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editKeywords")
1160 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"editdate")
1165 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1167 } elseif ($is_admin) {
1170 $ilCtrl->setParameter($this,
"apid", $item[
"id"]);
1172 $lng->
txt(
"blog_toggle_draft_admin"),
1173 $ilCtrl->getLinkTarget($this,
"deactivateAdmin")
1175 $ilCtrl->setParameter($this,
"apid",
"");
1180 $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"deleteBlogPostingConfirmationScreen")
1184 $dd =
$ui_factory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
1186 $wtpl->setCurrentBlock(
"actions");
1187 $wtpl->setVariable(
"ACTION_SELECTOR",
$ui_renderer->render($dd));
1188 $wtpl->parseCurrentBlock();
1194 $notes_context = $this->notes
1201 $count = $this->notes
1203 ->getNrOfCommentsForContext($notes_context);
1205 if ($a_cmd !==
"preview") {
1206 $wtpl->setCurrentBlock(
"comments");
1207 $wtpl->setVariable(
"TEXT_COMMENTS",
$lng->
txt(
"blog_comments"));
1208 $wtpl->setVariable(
"URL_COMMENTS", $preview);
1209 $wtpl->setVariable(
"COUNT_COMMENTS", $count);
1210 $wtpl->parseCurrentBlock();
1215 if ($this->node_id !== null &&
1216 $a_cmd !==
"preview") {
1217 if ($this->id_type === self::WORKSPACE_NODE_ID) {
1218 $goto = $this->gui->permanentLink(0, (
int) $this->node_id)->getPermanentLink((
int) $item[
"id"]);
1220 $goto = $this->gui->permanentLink((
int) $this->node_id)->getPermanentLink((
int) $item[
"id"]);
1222 $wtpl->setCurrentBlock(
"permalink");
1223 $wtpl->setVariable(
"URL_PERMALINK", $goto);
1224 $wtpl->setVariable(
"TEXT_PERMALINK",
$lng->
txt(
"blog_link"));
1225 $wtpl->parseCurrentBlock();
1230 $this->blog_settings->getAbstractShorten(),
1231 $this->blog_settings->getAbstractShortenLength(),
1233 $this->blog_settings->getAbstractImage(),
1234 $this->blog_settings->getAbstractImageWidth(),
1235 $this->blog_settings->getAbstractImageHeight(),
1240 $wtpl->setCurrentBlock(
"more");
1241 $wtpl->setVariable(
"URL_MORE", $more_link);
1242 $wtpl->setVariable(
"TEXT_MORE",
$lng->
txt(
"blog_list_more"));
1243 $wtpl->parseCurrentBlock();
1249 $wtpl->setCurrentBlock(
"draft_text");
1250 $wtpl->setVariable(
"DRAFT_TEXT",
$lng->
txt(
"blog_draft_text"));
1251 $wtpl->parseCurrentBlock();
1252 $wtpl->setVariable(
"DRAFT_CLASS",
" ilBlogListItemDraft");
1256 $reading_time = $this->reading_time_manager->getReadingTime(
1260 if (!is_null($reading_time)) {
1261 $this->
lng->loadLanguageModule(
"copg");
1262 $wtpl->setCurrentBlock(
"reading_time");
1265 $this->
lng->txt(
"copg_est_reading_time") .
": " .
1266 sprintf($this->
lng->txt(
"copg_x_minutes"), $reading_time)
1268 $wtpl->parseCurrentBlock();
1271 $wtpl->setCurrentBlock(
"posting");
1274 if ($this->id_type === self::REPOSITORY_NODE_ID) {
1277 $author_id = $item[
"author"];
1279 $authors[] = $this->profile_gui->getNamePresentation($author_id);
1282 if (isset($item[
"editors"])) {
1283 foreach ($item[
"editors"] as $editor_id) {
1284 $authors[] = $this->profile_gui->getNamePresentation($editor_id);
1289 $author = implode(
", ", $authors) .
" - ";
1294 $wtpl->setVariable(
"URL_TITLE", $preview);
1295 $wtpl->setVariable(
"TITLE", $item[
"title"]);
1299 $keywords = (count($kw) > 0)
1300 ?
"<br>" . $this->
lng->txt(
"keywords") .
": " . implode(
", ", $kw)
1303 $wtpl->setVariable(
"DATETIME", $author .
1307 $wtpl->setVariable(
"CONTENT", $snippet);
1309 $wtpl->parseCurrentBlock();
1313 if ($a_cmd ===
"previewFullscreen") {
1314 $ref_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1317 $wsp_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1320 $this->gui->permanentLink(
$ref_id, $wsp_id)->setPermanentLink();
1323 if (!$is_empty || $a_show_inactive) {
1324 return $wtpl->get();
1337 return BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->
getKeywords(
false));
1346 string $a_list_cmd =
"render",
1347 string $a_posting_cmd =
"preview",
1348 ?
string $a_link_template = null,
1349 bool $a_show_inactive =
false,
1354 $blpg = ($a_blpg > 0)
1360 foreach ($a_items as $month => $postings) {
1361 foreach (array_keys($postings) as
$id) {
1363 if (!$a_show_inactive && !$active) {
1364 unset($a_items[$month][
$id]);
1366 $a_items[
$month][
$id][
"active"] = $active;
1369 if (!count($a_items[$month])) {
1370 unset($a_items[$month]);
1376 $max_months = $this->blog_settings->getNavModeListMonths();
1378 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_by_date.html",
true,
true,
"components/ILIAS/Blog");
1380 $ilCtrl->setParameter($this,
"blpg",
"");
1382 $counter = $mon_counter = $last_year = 0;
1383 foreach ($a_items as $month => $postings) {
1384 if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1389 $year = substr($month, 0, 4);
1390 if (!$last_year || $year != $last_year) {
1399 if (!$a_link_template) {
1400 $ilCtrl->setParameter($this,
"bmn", $month);
1401 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1403 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1408 if ($mon_counter <= $this->blog_settings->getNavModeListMonthsWithPostings()) {
1410 $wtpl->setCurrentBlock(
"navigation_year_details");
1411 $wtpl->setVariable(
"YEAR", $year);
1412 $wtpl->parseCurrentBlock();
1415 foreach ($postings as
$id => $posting) {
1426 if (!$a_link_template) {
1427 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1428 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1429 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1434 if (!$posting[
"active"]) {
1435 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1436 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1437 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1440 $wtpl->setCurrentBlock(
"navigation_item");
1441 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1442 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1443 $wtpl->parseCurrentBlock();
1446 $wtpl->setCurrentBlock(
"navigation_month_details");
1447 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1448 $wtpl->setVariable(
"URL_MONTH", $month_url);
1453 $wtpl->setCurrentBlock(
"navigation_year");
1454 $wtpl->setVariable(
"YEAR", $year);
1455 $wtpl->parseCurrentBlock();
1458 $wtpl->setCurrentBlock(
"navigation_month");
1459 $wtpl->setVariable(
"MONTH_NAME", $month_name);
1460 $wtpl->setVariable(
"URL_MONTH", $month_url);
1461 $wtpl->setVariable(
"MONTH_COUNT", count($postings));
1463 $wtpl->parseCurrentBlock();
1465 if (!$a_link_template) {
1466 $this->
ctrl->setParameterByClass(self::class,
"bmn", null);
1467 $url = $this->
ctrl->getLinkTargetByClass(self::class, $a_list_cmd);
1469 $url =
"index.html";
1474 $this->
ui->renderer()->render(
1475 $this->
ui->factory()->link()->standard(
1476 $this->
lng->txt(
"blog_starting_page"),
1484 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_month.html",
true,
true,
"components/ILIAS/Blog");
1486 $ilCtrl->setParameter($this,
"blpg",
"");
1488 $month_options = array();
1489 foreach ($a_items as $month => $postings) {
1490 $month_name = $this->gui->presentation()->util()->getMonthPresentation($month);
1492 $month_options[
$month] = $month_name;
1494 if ($month == $this->month) {
1495 if (!$a_link_template) {
1496 $ilCtrl->setParameter($this,
"bmn", $month);
1497 $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1499 $month_url = $this->
buildExportLink($a_link_template,
"list", (
string) $month);
1502 foreach ($postings as
$id => $posting) {
1506 if (!$a_link_template) {
1507 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn", $month);
1508 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"blpg",
$id);
1509 $url = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui", $a_posting_cmd);
1514 if (!$posting[
"active"]) {
1515 $wtpl->setVariable(
"NAV_ITEM_DRAFT", $this->
lng->txt(
"blog_draft"));
1516 } elseif ($this->blog_settings->getApproval() && !$posting[
"approved"]) {
1517 $wtpl->setVariable(
"NAV_ITEM_APPROVAL", $this->
lng->txt(
"blog_needs_approval"));
1520 $wtpl->setCurrentBlock(
"navigation_item");
1521 $wtpl->setVariable(
"NAV_ITEM_URL",
$url);
1522 $wtpl->setVariable(
"NAV_ITEM_CAPTION", $caption);
1523 $wtpl->parseCurrentBlock();
1526 $wtpl->setCurrentBlock(
"navigation_month_details");
1528 $wtpl->setVariable(
"NAV_MONTH", $month_name);
1529 $wtpl->setVariable(
"URL_MONTH", $month_url);
1531 $wtpl->parseCurrentBlock();
1536 $wtpl->setCurrentBlock(
"option_bl");
1537 foreach ($month_options as $value => $caption) {
1538 $wtpl->setVariable(
"OPTION_VALUE", $value);
1539 $wtpl->setVariable(
"OPTION_CAPTION", $caption);
1540 if ($value == $this->month) {
1541 $wtpl->setVariable(
"OPTION_SEL",
' selected="selected"');
1543 $wtpl->parseCurrentBlock();
1546 $wtpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1549 $ilCtrl->setParameter($this,
"bmn", $this->month);
1550 $ilCtrl->setParameterByClass(
"ilblogpostinggui",
"bmn",
"");
1551 return $wtpl->get();
1558 string $a_list_cmd =
"render",
1559 bool $a_show_inactive =
false,
1560 string $a_link_template =
"",
1565 $blpg = ($a_blpg > 0)
1569 $keywords = $this->
getKeywords($a_show_inactive, $blpg);
1571 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_keywords.html",
true,
true,
"components/ILIAS/Blog");
1573 $max = max($keywords);
1575 $wtpl->setCurrentBlock(
"keyword");
1576 foreach ($keywords as $keyword => $counter) {
1577 if (!$a_link_template) {
1578 $ilCtrl->setParameter($this,
"kwd", urlencode((
string) $keyword));
1579 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1580 $ilCtrl->setParameter($this,
"kwd",
"");
1585 $wtpl->setVariable(
"TXT_KEYWORD", $keyword);
1587 $wtpl->setVariable(
"URL_KEYWORD",
$url);
1588 $wtpl->parseCurrentBlock();
1591 return $wtpl->get();
1598 string $a_list_cmd =
"render",
1599 bool $a_show_inactive =
false 1604 foreach ($a_items as $month => $items) {
1605 foreach ($items as $item) {
1607 if ($item[
"author"]) {
1608 $authors[] = $item[
"author"];
1611 if (isset($item[
"editors"])) {
1612 foreach ($item[
"editors"] as $editor_id) {
1613 if ($editor_id != $item[
"author"]) {
1614 $authors[] = $editor_id;
1622 $authors = array_unique($authors);
1625 $authors = array_filter($authors,
function (
$id) {
1629 if (count($authors) > 1) {
1633 $ilCtrl->setParameter($this,
"ath", $user_id);
1634 $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1635 $ilCtrl->setParameter($this,
"ath",
"");
1638 if (substr($base_name, 0, 1) ==
"[") {
1652 $sort = $name_arr[
"lastname"] .
" " . $name_arr[
"firstname"];
1655 $idx = trim(strip_tags($sort)) .
"///" .
$user_id;
1656 $list[$idx] = array($name,
$url);
1661 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation_authors.html",
true,
true,
"components/ILIAS/Blog");
1663 $wtpl->setCurrentBlock(
"author");
1664 foreach ($list as $author) {
1665 $wtpl->setVariable(
"TXT_AUTHOR", $author[0]);
1666 $wtpl->setVariable(
"URL_AUTHOR", $author[1]);
1667 $wtpl->parseCurrentBlock();
1670 return $wtpl->get();
1680 bool $single_posting =
false 1682 $nav_renderer = $this->gui->navigation()->toolbarNavigationRenderer();
1683 $nav_renderer->renderToolbarNavigation(
1697 string $a_list_cmd =
"render",
1698 string $a_posting_cmd =
"preview",
1699 string $a_link_template = null,
1700 bool $a_show_inactive =
false,
1705 $blpg = ($a_blpg > 0)
1709 if ($this->blog_settings->getOrder()) {
1710 $order = array_flip($this->blog_settings->getOrder());
1719 $wtpl =
new ilTemplate(
"tpl.blog_list_navigation.html",
true,
true,
"components/ILIAS/Blog");
1724 if (count($a_items)) {
1725 $blocks[$order[
"navigation"]] = array(
1726 $this->
lng->txt(
"blog_navigation"),
1727 $this->
renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
1731 if ($this->blog_settings->getKeywords()) {
1733 $may_edit_keywords = ($blpg > 0 &&
1734 $this->blog_access->mayEditPosting($blpg) &&
1735 $a_list_cmd !==
"preview" &&
1736 $a_list_cmd !==
"gethtml" &&
1739 if ($keywords || $may_edit_keywords) {
1741 $keywords = $this->
lng->txt(
"blog_no_keywords");
1744 $blocks[$order[
"keywords"]] = array(
1745 $this->
lng->txt(
"blog_keywords"),
1748 ? array($cmd, $this->
lng->txt(
"blog_edit_keywords"))
1755 if (!$a_link_template) {
1757 if ($this->id_type === self::REPOSITORY_NODE_ID &&
1758 $this->blog_settings->getAuthors()) {
1761 $blocks[$order[
"authors"]] = array($this->
lng->txt(
"blog_authors"), $authors);
1766 if ($this->blog_settings->getRSS() &&
1768 $a_list_cmd ===
"preview") {
1771 if ($this->id_type !== self::WORKSPACE_NODE_ID) {
1774 $url = ILIAS_HTTP_PATH .
"/feed.php?blog_id=" . $blog_id .
1775 "&client_id=" . rawurlencode(
CLIENT_ID);
1781 if (count($blocks)) {
1788 foreach ($blocks as $block) {
1791 $content = $block[1];
1795 if (isset($block[2]) && is_array($block[2])) {
1796 $link =
$ui_factory->button()->shy($block[2][1], $block[2][0]);
1797 $secondary_panel = $secondary_panel->withFooter($link);
1800 $wtpl->setCurrentBlock(
"block_bl");
1801 $wtpl->setVariable(
"BLOCK",
$ui_renderer->render($secondary_panel));
1802 $wtpl->parseCurrentBlock();
1806 return $wtpl->get();
1813 bool $a_show_inactive,
1814 ?
int $a_posting_id = null
1816 $keywords = array();
1817 if ($a_posting_id) {
1819 if (isset($keywords[$keyword])) {
1826 foreach ($this->items as $month => $items) {
1827 foreach ($items as $item) {
1830 if (isset($keywords[$keyword])) {
1843 foreach ($keywords as $keyword => $counter) {
1844 $tmp[] = array(
"keyword" => $keyword,
"counter" => $counter);
1848 $keywords = array();
1849 foreach ($tmp as $item) {
1850 $keywords[(string) $item[
"keyword"]] = $item[
"counter"];
1859 bool $a_include_comments =
false,
1860 bool $print_version =
false 1863 $format = explode(
"_", $this->blog_request->getFormat());
1864 if (($format[1] ??
"") ===
"comments" || $a_include_comments) {
1865 $a_include_comments =
true;
1866 $type =
"html_comments";
1873 $subdir = $this->
object->getType() .
"_" . $this->
object->getId();
1874 if ($print_version) {
1879 $blog_export->setPrintVersion($print_version);
1880 $blog_export->includeComments($a_include_comments);
1881 $blog_export->exportHTML();
1882 return $blog_export;
1892 $this->disable_notes = $a_value;
1901 if ($a_cmd ===
"preview" || $a_cmd ===
"previewFullscreen" || $this->prvm) {
1909 $ilCtrl->setParameter($this,
"prvm",
"");
1918 ?
string $sub_type = null,
1919 ?
int $sub_id = null,
1920 bool $is_preview =
false 1924 if (!$this->obj_id) {
1927 $sub_type = $sub_id = null;
1928 if ($this->blpg > 0) {
1933 $lg = parent::initHeaderAction($sub_type, $sub_id);
1937 $lg->enableComments(
false);
1938 $lg->enableNotes(
false);
1941 if ($this->blpg > 0) {
1943 $lg->enableComments(
true);
1945 $lg->enableNotes(
true);
1947 $lg->enableTags(
false);
1950 $ilCtrl->setParameter($this,
"ntf", 1);
1951 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1952 $ilCtrl->setParameter($this,
"ntf",
"");
1954 $lg->addCustomCommand($link,
"blog_notification_toggle_off");
1960 $this->
lng->txt(
"blog_notification_activated")
1963 $ilCtrl->setParameter($this,
"ntf", 2);
1964 $link = $ilCtrl->getLinkTarget($this,
"setNotification");
1965 $ilCtrl->setParameter($this,
"ntf",
"");
1966 $lg->addCustomCommand($link,
"blog_notification_toggle_on");
1971 $this->
lng->txt(
"blog_notification_deactivated")
1976 if ($this->blog_access->mayContribute()) {
1977 $ilCtrl->setParameter($this,
"prvm",
"");
1979 $ilCtrl->setParameter($this,
"bmn",
"");
1980 $ilCtrl->setParameter($this,
"blpg",
"");
1981 $link = $ilCtrl->getLinkTarget($this,
"");
1982 $ilCtrl->setParameter($this,
"blpg", $sub_id);
1983 $ilCtrl->setParameter($this,
"bmn", $this->month);
1984 $lg->addCustomCommand($link,
"blog_edit");
1986 if ($sub_id && $this->blog_access->mayEditPosting($sub_id)) {
1987 $link = $ilCtrl->getLinkTargetByClass(
"ilblogpostinggui",
"edit");
1988 $lg->addCustomCommand($link,
"blog_edit_posting");
1991 $ilCtrl->setParameter($this,
"prvm",
"fsc");
1994 $ilCtrl->setParameter($this,
"ntf",
"");
2005 switch ($this->ntf) {
2015 $ilCtrl->redirect($this,
"preview");
2027 if (
$post->getBlogId() === $a_blog_id) {
2028 return $post->getTitle();
2038 foreach ($this->items as $month => $postings) {
2039 foreach ($postings as
$id => $item) {
2041 unset($this->items[$month][
$id]);
2042 } elseif ($this->blog_settings->getApproval() && !$item[
"approved"]) {
2043 unset($this->items[$month][
$id]);
2046 if (!count($this->items[$month])) {
2047 unset($this->items[$month]);
2051 if ($this->items && !isset($this->items[$this->month])) {
2052 $keys = array_keys($this->items);
2053 $this->month = array_shift($keys);
2062 foreach ($a_items as $month => $items) {
2063 foreach ($items as $item) {
2088 if (is_object($this->
object)) {
2095 if ($this->
isAdmin() && $this->apid > 0) {
2097 $post->setApproved(
true);
2098 $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2099 $post->update(
true,
false,
true,
"new");
2101 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2104 $this->
ctrl->redirect($this,
"render");
2124 $ilTabs->activateTab(
"contributors");
2126 $local_roles = $this->
object->getAllLocalRoles($this->node_id);
2133 'auto_complete_name' =>
$lng->
txt(
'user'),
2134 'submit_name' =>
$lng->
txt(
'add'),
2135 'add_search' =>
true,
2137 'user_type' => $local_roles
2142 $other_roles = $this->
object->getRolesWithContributeOrRedact($this->node_id);
2144 $this->tpl->setOnScreenMessage(
'info', sprintf(
$lng->
txt(
"blog_contribute_other_roles"), implode(
", ", $other_roles)));
2147 $tbl = $this->gui->contributor()->ilContributorTableGUI(
2150 $this->
object->getAllLocalRoles($this->node_id)
2163 $user_login = $this->blog_request->getUserLogin();
2164 $user_type = $this->blog_request->getUserType();
2166 if (trim($user_login) ===
'') {
2167 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'msg_no_search_string'));
2171 $users = explode(
',', $user_login);
2173 $user_ids = array();
2174 foreach ($users as
$user) {
2178 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
'user_not_known'));
2193 array $a_user_ids = array(),
2194 ?
string $a_user_type = null
2200 $a_user_type = (
int) $a_user_type;
2206 if (!count($a_user_ids) || !$a_user_type) {
2207 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"));
2213 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2214 if (!in_array($a_user_type, $local_roles)) {
2215 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2220 foreach ($a_user_ids as
$user_id) {
2221 $user_id = (
int) $user_id;
2222 $a_user_type = (
int) $a_user_type;
2223 if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2224 $rbacadmin->
assignUser($a_user_type, $user_id);
2228 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2229 $ilCtrl->redirect($this,
"contributors");
2237 $ids = $this->blog_request->getIds();
2239 if (count($ids) === 0) {
2240 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
2241 $this->
ctrl->redirect($this,
"contributors");
2245 $confirm->setHeaderText($this->
lng->txt(
'blog_confirm_delete_contributors'));
2246 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'removeContributor'));
2247 $confirm->setConfirm($this->
lng->txt(
'delete'),
'removeContributor');
2248 $confirm->setCancel($this->
lng->txt(
'cancel'),
'contributors');
2254 $this->profile_gui->getNamePresentation($user_id,
false,
"",
true)
2258 $this->tpl->setContent($confirm->getHTML());
2267 $ids = $this->blog_request->getIds();
2269 if (count($ids) === 0) {
2270 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"select_one"),
true);
2271 $ilCtrl->redirect($this,
"contributors");
2275 $local_roles = array_keys($this->
object->getAllLocalRoles($this->node_id));
2276 if (!$local_roles) {
2277 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"missing_perm"));
2283 foreach ($local_roles as $role_id) {
2288 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
2289 $this->
ctrl->redirect($this,
"contributors");
2297 $post->setApproved(
false);
2298 $post->setActive(
false);
2299 $post->update(
true,
false,
false);
2301 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2304 $this->
ctrl->redirect($this,
"render");
2323 $this->content_style_gui->
addCss(
2325 $this->
object->getRefId(),
2326 $this->
object->getId()
2344 $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
2348 $provider = new \ILIAS\Blog\BlogPrintViewProviderGUI(
2353 $this->access_handler,
2355 $this->blog_request->getObjIds()
2358 return new \ILIAS\Export\PrintProcessGUI(
2368 $view = $this->getPrintView();
2374 $print_view = $this->getPrintView();
2375 $print_view->sendPrintView();
2380 $this->
ctrl->redirectByClass(ilExportGUI::class);
ilNavigationHistory $nav_history
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
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.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
setLocator()
Insert locator.
renderNavigationByKeywords(string $a_list_cmd="render", bool $a_show_inactive=false, string $a_link_template="", int $a_blpg=0)
Build navigation by keywords block.
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...
ILIAS Blog Settings Settings $blog_settings
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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.
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) ...
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
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.
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
static _lookupName(int $a_user_id)
lookup user name
static _lookupId($a_user_str)
prepareOutput(bool $show_sub_objects=true)
static _numericMonthToString(int $a_month, bool $a_long=true, ilLanguage $lng=null)
numeric month to string
ILIAS Blog InternalGUIService $gui
static getRelevanceClass(int $cnt, int $max)
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
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
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)
setContent(string $a_html)
Sets content for standard template.
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
confirmRemoveContributor()
Used in ilContributorTableGUI.
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
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...
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
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)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
getKeywords(bool $a_show_inactive, ?int $a_posting_id=null)
Get keywords for single posting or complete blog.
renderFullscreenHeader(ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
Last visited history for repository items.
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)
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.
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
addContributor(array $a_user_ids=array(), ?string $a_user_type=null)
Centralized method to add contributors.
ILIAS Repository Profile ProfileGUI $profile_gui
__construct(Container $dic, ilPlugin $plugin)
setDescription(string $a_descr)
Sets description below title in standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
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)
setRightContent(string $a_html)
Sets content of right column.
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
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
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?