5include_once(
"Services/Block/classes/class.ilBlockGUI.php");
52 $this->ctrl =
$DIC->ctrl();
53 $this->lng =
$DIC->language();
54 $this->
user = $DIC->user();
55 $this->
help = $DIC[
"ilHelp"];
56 $this->access =
$DIC->access();
58 $this->tabs =
$DIC->tabs();
59 $this->obj_definition =
$DIC[
"objDefinition"];
64 $ilHelp =
$DIC[
"ilHelp"];
68 $lng->loadLanguageModule(
"news");
69 $ilHelp->addHelpSection(
"news_block");
71 include_once(
"./Services/News/classes/class.ilNewsItem.php");
76 $this->dynamic =
false;
77 include_once(
"./Services/News/classes/class.ilNewsCache.php");
79 $cres = unserialize($this->acache->getEntry(
$ilUser->getId() .
":" .
$_GET[
"ref_id"]));
80 $this->cache_hit =
false;
82 if ($this->acache->getLastAccessStatus() ==
"hit" && is_array($cres)) {
84 $this->cache_hit =
true;
86 if ($this->
getDynamic() && !$this->cache_hit) {
87 $this->dynamic =
true;
90 if (!empty(self::$st_data)) {
94 self::$st_data =
$data;
99 $this->
setRowTemplate(
"tpl.block_row_news_for_context.html",
"Services/News");
101 $this->allow_moving =
false;
115 include_once(
"./Services/News/classes/class.ilNewsCache.php");
125 $news_item->setContextObjId(
$ilCtrl->getContextObjId());
126 $news_item->setContextObjType(
$ilCtrl->getContextObjType());
130 $prevent_aggregation =
true;
131 if (
$ilCtrl->getContextObjType() !=
"frm") {
132 $forum_grouping =
true;
134 $forum_grouping =
false;
138 $news_data = $news_item->getNewsForRefId(
143 $prevent_aggregation,
147 $this->acache->storeEntry(
149 serialize($news_data)
182 if (
$ilCtrl->getCmdClass() ==
"ilnewsitemgui") {
210 $next_class =
$ilCtrl->getNextClass();
211 $cmd =
$ilCtrl->getCmd(
"getHTML");
213 switch ($next_class) {
214 case "ilnewsitemgui":
215 include_once(
"./Services/News/classes/class.ilNewsItemGUI.php");
218 $html =
$ilCtrl->forwardCommand($news_item_gui);
222 return $this->$cmd();
233 $this->enable_edit = $a_enable_edit;
243 return $this->enable_edit;
251 if ($this->dynamic) {
253 } elseif (count($this->
getData()) > 0) {
254 parent::fillDataSection();
272 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
292 if ($enable_internal_rss) {
293 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
296 ILIAS_HTTP_PATH .
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) .
"&" .
297 "ref_id=" .
$_GET[
"ref_id"],
298 $lng->txt(
"news_feed_url")
306 $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui",
"editNews"),
310 $ilCtrl->setParameter($this,
"add_mode",
"block");
312 $ilCtrl->getLinkTargetByClass(
"ilnewsitemgui",
"createNewsItem"),
315 $ilCtrl->setParameter($this,
"add_mode",
"");
319 $ref_id =
$_GET[
"ref_id"];
323 $obj_class = strtolower(
$obj_def->getClassName($obj_type));
324 $parent_gui =
"ilobj" . $obj_class .
"gui";
326 $ilCtrl->setParameterByClass(
"ilcontainernewssettingsgui",
"ref_id", $ref_id);
330 $ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui", $parent_gui,
"ilcontainernewssettingsgui"),
"show"),
331 $lng->txt(
"settings")
335 $ilCtrl->getLinkTarget($this,
"editSettings"),
336 $lng->txt(
"settings")
357 && (!$news_set->get(
"enable_rss_for_internal") ||
359 $this->getBlockType(),
368 if (
$ilUser->getPref(
"il_feed_js") ==
"n") {
372 return parent::getHTML() . $en;
382 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
391 $got_notices = $got_messages =
false;
392 foreach ($this->data as $row) {
393 if ($row[
"priority"] == 0) {
396 if ($row[
"priority"] == 1) {
397 $got_messages =
true;
400 $this->show_view_selection =
false;
402 if ($got_notices && $got_messages) {
403 $this->show_view_selection =
true;
404 } elseif ($got_notices) {
432 $this->tpl->setCurrentBlock(
"long");
433 $this->tpl->setVariable(
"VAL_CREATION_DATE", $info[
"creation_date"]);
434 $this->tpl->parseCurrentBlock();
436 if ($info[
"ref_id"] > 0) {
437 $this->tpl->setCurrentBlock(
"news_context");
438 $this->tpl->setVariable(
"TYPE", $info[
"type_txt"]);
439 $this->tpl->setVariable(
"IMG_TYPE", $info[
"type_icon"]);
440 $this->tpl->setVariable(
"TITLE", $info[
"obj_title"]);
441 if ($info[
"user_read"] > 0) {
442 $this->tpl->setVariable(
"TITLE_CLASS",
'class="light"');
445 $this->tpl->parseCurrentBlock();
449 $this->tpl->setVariable(
"VAL_TITLE", $info[
"news_title"]);
451 if ($info[
"user_read"] > 0) {
452 $this->tpl->setVariable(
"A_CLASS",
'class="light"');
455 $this->tpl->setVariable(
"HREF_SHOW", $info[
"url"]);
466 $info[
"ref_id"] = $news[
"ref_id"];
467 $info[
"creation_date"] =
471 if ($news[
"ref_id"] > 0) {
472 if ($news[
"agg_ref_id"] > 0) {
475 $context_ref = $news[
"agg_ref_id"];
477 $obj_id = $news[
"context_obj_id"];
478 $type = $news[
"context_obj_type"];
479 $context_ref = $news[
"ref_id"];
482 $lang_type = in_array(
$type, array(
"sahs",
"lm",
"htlm"))
488 :
$lng->txt($lang_type);
491 $info[
"type_txt"] = $type_txt;
492 $info[
"type_icon"] = ilObject::_getIcon($obj_id,
"tiny",
$type);
494 $info[
"user_read"] = $news[
"user_read"];
496 $ilCtrl->setParameter($this,
"news_context", $context_ref);
498 $ilCtrl->setParameter($this,
"news_context",
"");
502 $info[
"news_title"] =
504 $news[
"context_obj_type"],
506 $news[
"content_is_lang_var"],
512 $ilCtrl->setParameter($this,
"news_id", $news[
"id"]);
514 $ilCtrl->getLinkTarget($this,
"showNews");
515 $ilCtrl->clearParameters($this);
529 return '<div class="small">' . ((int) count($this->
getData())) .
" " .
$lng->txt(
"news_news_items") .
"</div>";
543 if (empty(self::$st_data)) {
548 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
550 include_once(
"./Services/News/classes/class.ilNewsItem.php");
553 $tpl =
new ilTemplate(
"tpl.show_news.html",
true,
true,
"Services/News");
556 $previous = $next =
"";
558 $c = current($this->data);
561 while (
$c[
"id"] > 0 &&
562 $c[
"id"] !=
$_GET[
"news_id"]) {
564 $c = next($this->data);
568 if (!is_array(
$c) && is_object($news) && $news->getId() > 0
570 throw new ilException(
"News ID does not match object context.");
575 $news_list = array();
576 if (is_array(
$c[
"aggregation"])) {
577 $news_list[] = array(
"ref_id" =>
$c[
"agg_ref_id"],
578 "agg_ref_id" =>
$c[
"agg_ref_id"],
579 "aggregation" =>
$c[
"aggregation"],
581 "content_type" =>
"text",
585 "content_long" =>
"",
586 "update_date" => $news->getUpdateDate(),
587 "creation_date" =>
"",
588 "content_is_lang_var" =>
false,
589 "loc_context" =>
$_GET[
"news_context"],
590 "context_obj_type" => $news->getContextObjType(),
593 foreach (
$c[
"aggregation"] as $c_item) {
595 $c_item[
"loc_context"] = $c_item[
"ref_id"];
596 $c_item[
"loc_stop"] =
$_GET[
"news_context"];
597 $news_list[] = $c_item;
600 $news_list[] = array(
601 "id" => $news->getId(),
602 "ref_id" =>
$_GET[
"news_context"],
603 "user_id" => $news->getUserId(),
604 "content_type" => $news->getContentType(),
605 "mob_id" => $news->getMobId(),
606 "visibility" => $news->getVisibility(),
607 "priority" => $news->getPriority(),
608 "content" => $news->getContent(),
609 "content_long" => $news->getContentLong(),
610 "update_date" => $news->getUpdateDate(),
611 "creation_date" => $news->getCreationDate(),
612 "context_sub_obj_type" => $news->getContextSubObjType(),
613 "context_obj_type" => $news->getContextObjType(),
614 "context_sub_obj_id" => $news->getContextSubObjId(),
615 "content_is_lang_var" => $news->getContentIsLangVar(),
616 "content_text_is_lang_var" => $news->getContentTextIsLangVar(),
617 "loc_context" =>
$_GET[
"news_context"],
618 "title" => $news->getTitle());
623 $cache_deleted =
false;
624 foreach ($news_list as $item) {
625 $row_css = ($row_css !=
"tblrow1")
629 if ($item[
"ref_id"] > 0 && !$ilAccess->checkAccess(
"read",
"", $item[
"ref_id"])) {
630 $tpl->setCurrentBlock(
"content");
631 $tpl->setVariable(
"VAL_CONTENT",
$lng->txt(
"news_sorry_not_accessible_anymore"));
632 $tpl->parseCurrentBlock();
633 $tpl->setCurrentBlock(
"item");
634 $tpl->setVariable(
"ITEM_ROW_CSS", $row_css);
635 $tpl->parseCurrentBlock();
636 if (!$cache_deleted) {
637 $this->acache->deleteEntry(
$ilUser->getId() .
":" .
$_GET[
"ref_id"]);
638 $cache_deleted =
true;
648 $displayname =
$user->getLogin();
652 $displayname =
"<" . strtolower(
$lng->txt(
"deleted")) .
">";
655 $tpl->setCurrentBlock(
"user_info");
656 $tpl->setVariable(
"VAL_AUTHOR", $displayname);
657 $tpl->setVariable(
"TXT_AUTHOR",
$lng->txt(
"author"));
658 $tpl->parseCurrentBlock();
662 $ui_renderer = $this->
ui->renderer();
663 $ui_factory = $this->
ui->factory();
664 $this->
ui->factory();
668 if (in_array($mime, array(
"image/jpeg",
"image/svg+xml",
"image/gif",
"image/png"))) {
669 $title = basename($media_path);
670 $html = $ui_renderer->render($ui_factory->image()->responsive($media_path,
$title));
671 } elseif (in_array($mime, array(
"audio/mpeg",
"audio/ogg",
"video/mp4",
"video/x-flv",
"video/webm"))) {
673 $mp->setFile($media_path);
674 $mp->setDisplayHeight(200);
675 $html = $mp->getMediaPlayerHtml();
682 $tpl->setCurrentBlock(
"player");
687 $tpl->parseCurrentBlock();
691 if ($enable_internal_rss && $item[
"visibility"] !=
"") {
693 $tpl->setCurrentBlock(
"access");
694 $tpl->setVariable(
"TXT_ACCESS",
$lng->txt(
"news_news_item_visibility"));
696 ($item[
"priority"] == 0 &&
699 "public_notifications",
703 $tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_public"));
705 $tpl->setVariable(
"VAL_ACCESS",
$lng->txt(
"news_visibility_users"));
707 $tpl->parseCurrentBlock();
711 include_once(
"./Services/News/classes/class.ilNewsRendererFactory.php");
713 if (trim($item[
"content"]) !=
"") {
715 $renderer->setNewsItem($it, $item[
"ref_id"]);
716 $tpl->setCurrentBlock(
"content");
717 $tpl->setVariable(
"VAL_CONTENT", $renderer->getDetailContent());
718 $tpl->parseCurrentBlock();
720 if ($item[
"update_date"] != $item[
"creation_date"]) {
721 $tpl->setCurrentBlock(
"ni_update");
722 $tpl->setVariable(
"TXT_LAST_UPDATE",
$lng->txt(
"last_update"));
727 $tpl->parseCurrentBlock();
731 if ($item[
"creation_date"] !=
"") {
732 $tpl->setCurrentBlock(
"ni_update");
737 $tpl->setVariable(
"TXT_CREATED",
$lng->txt(
"created"));
738 $tpl->parseCurrentBlock();
743 if (
$_GET[
"news_context"] > 0) {
750 if ($obj_type ==
"file") {
751 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $item[
"ref_id"]);
752 $url =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"sendfile");
753 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
755 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
757 $button->setUrl(
$url);
758 $button->setCaption(
"download");
760 $tpl->setCurrentBlock(
"download");
761 $tpl->setVariable(
"BUTTON_DOWNLOAD", $button->render());
762 $tpl->parseCurrentBlock();
767 if ($obj_type ==
"frm" && $item[
"context_sub_obj_type"] ==
"pos"
768 && $item[
"context_sub_obj_id"] > 0) {
769 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
770 $pos = $item[
"context_sub_obj_id"];
773 $add =
"_" . $thread .
"_" . $pos;
778 if ($obj_type ==
"wiki" && $item[
"context_sub_obj_type"] ==
"wpg"
779 && $item[
"context_sub_obj_id"] > 0) {
780 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
782 if ($wptitle !=
"") {
787 $url_target =
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) .
"&target=" .
788 $obj_type .
"_" . $item[
"ref_id"] . $add;
791 if (in_array($obj_type, array(
"lm")) && $item[
"context_sub_obj_type"] ==
"pg"
792 && $item[
"context_sub_obj_id"] > 0) {
793 $url_target =
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) .
"&target=" .
794 "pg_" . $item[
"context_sub_obj_id"] .
"_" . $item[
"ref_id"];
798 if ($obj_type ==
"blog" && $item[
"context_sub_obj_type"] ==
"blp"
799 && $item[
"context_sub_obj_id"] > 0) {
800 $url_target =
"./goto.php?client_id=" . rawurlencode(CLIENT_ID) .
"&target=" .
801 "blog_" . $item[
"ref_id"] .
"_" . $item[
"context_sub_obj_id"];
804 $context_opened =
false;
805 if ($item[
"loc_context"] !=
null && $item[
"loc_context"] != $item[
"loc_stop"]) {
806 $tpl->setCurrentBlock(
"context");
807 $context_opened =
true;
809 $cont_loc->addContextItems($item[
"loc_context"],
true, $item[
"loc_stop"]);
810 $tpl->setVariable(
"CONTEXT_LOCATOR", $cont_loc->getHTML());
814 if ($item[
"no_context_title"] !==
true) {
815 if (!$context_opened) {
816 $tpl->setCurrentBlock(
"context");
818 $tpl->setVariable(
"HREF_CONTEXT_TITLE", $url_target);
819 $tpl->setVariable(
"CONTEXT_TITLE", $obj_title);
820 $tpl->setVariable(
"IMG_CONTEXT_TITLE", ilObject::_getIcon($obj_id,
"big", $obj_type));
822 if ($context_opened) {
823 $tpl->parseCurrentBlock();
826 $tpl->setVariable(
"HREF_TITLE", $url_target);
833 $item[
"context_obj_type"],
835 $item[
"content_is_lang_var"],
842 $tpl->setCurrentBlock(
"item");
843 $tpl->setVariable(
"ITEM_ROW_CSS", $row_css);
844 $tpl->parseCurrentBlock();
848 $content_block->setContent(
$tpl->get());
850 $content_block->setTitle($this->
getProperty(
"title"));
852 $content_block->setTitle(
$lng->txt(
"news_internal_news"));
856 if ($previous !=
"") {
857 if ($previous[
"ref_id"] > 0) {
858 $ilCtrl->setParameter($this,
"news_context", $previous[
"ref_id"]);
860 $ilCtrl->setParameter($this,
"news_id", $previous[
"id"]);
862 $content_block->addBlockCommand(
$ilCtrl->getLinkTarget($this,
"showNews"),
$lng->txt(
"previous"));
863 $ilCtrl->setParameter($this,
"news_context",
"");
867 if (
$c = next($this->data)) {
868 if (
$c[
"ref_id"] > 0) {
869 $ilCtrl->setParameter($this,
"news_context",
$c[
"ref_id"]);
871 $ilCtrl->setParameter($this,
"news_id",
$c[
"id"]);
873 $content_block->addBlockCommand(
$ilCtrl->getLinkTarget($this,
"showNews"),
$lng->txt(
"next"));
875 $ilCtrl->setParameter($this,
"news_context",
"");
876 $ilCtrl->setParameter($this,
"news_id",
"");
877 $content_block->setCurrentItemNumber($curr_cnt);
878 $content_block->setEnableNumInfo(
true);
879 $content_block->setData($this->
getData());
881 return $content_block->getHTML();
893 $med = $mob->getMediaItem(
"Standard");
894 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
895 $media_path = $med->getLocation();
913 if (is_int(strpos($a_str,
">")) && is_int(strpos($a_str,
"<"))) {
929 include_once(
"./Services/News/classes/class.ilNewsSubscription.php");
931 $ilCtrl->returnToParent($this);
942 include_once(
"./Services/News/classes/class.ilNewsSubscription.php");
944 $ilCtrl->returnToParent($this);
953 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
971 $ilCtrl->returnToParent($this);
980 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
984 "hide_notifications",
998 $ilCtrl->returnToParent($this);
1008 return $this->settings_form->getHTML();
1022 $ilTabs->clearTargets();
1025 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1029 "public_notifications",
1047 "hide_news_per_date",
1058 if ($hide_news_date !=
"") {
1059 $hide_news_date = explode(
" ", $hide_news_date);
1062 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1064 $this->settings_form->setTitle(
$lng->txt(
"news_settings"));
1067 if ($this->
getProperty(
"hide_news_block_option")) {
1069 $lng->txt(
"news_hide_news_block"),
1072 $ch->setInfo(
$lng->txt(
"news_hide_news_block_info"));
1073 $ch->setChecked($hide_block);
1074 $this->settings_form->addItem($ch);
1077 $lng->txt(
"news_hide_news_per_date"),
1078 "hide_news_per_date"
1080 $hnpd->setInfo(
$lng->txt(
"news_hide_news_per_date_info"));
1081 $hnpd->setChecked($hide_news_per_date);
1084 $lng->txt(
"news_hide_news_date"),
1087 $dt_prop->setRequired(
true);
1088 if ($hide_news_date !=
"") {
1091 #$dt_prop->setDate($hide_news_date[0]);
1092 #$dt_prop->setTime($hide_news_date[1]);
1093 $dt_prop->setShowTime(
true);
1095 $hnpd->addSubItem($dt_prop);
1097 $this->settings_form->addItem($hnpd);
1101 if ($this->
getProperty(
"default_visibility_option") &&
1102 $enable_internal_rss) {
1105 "default_visibility",
1109 if ($default_visibility ==
"") {
1110 $default_visibility =
1117 $radio_group->addOption($radio_option);
1118 $radio_option =
new ilRadioOption(
$lng->txt(
"news_visibility_public"),
"public");
1119 $radio_group->addOption($radio_option);
1120 $radio_group->setInfo(
$lng->txt(
"news_news_item_visibility_info"));
1121 $radio_group->setRequired(
false);
1122 $radio_group->setValue($default_visibility);
1123 $this->settings_form->addItem($radio_group);
1127 if ($this->
getProperty(
"public_notifications_option") &&
1128 $enable_internal_rss) {
1130 $lng->txt(
"news_notifications_public"),
1131 "notifications_public"
1133 $ch->setInfo(
$lng->txt(
"news_notifications_public_info"));
1134 $ch->setChecked($public);
1135 $this->settings_form->addItem($ch);
1139 if ($enable_internal_rss) {
1141 $lng->txt(
"news_public_feed"),
1142 "notifications_public_feed"
1144 $ch->setInfo(
$lng->txt(
"news_public_feed_info"));
1145 $ch->setChecked($public_feed);
1146 $this->settings_form->addItem($ch);
1157 $this->settings_form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
1158 $this->settings_form->addCommandButton(
"cancelSettings",
$lng->txt(
"cancel"));
1159 $this->settings_form->setFormAction(
$ilCtrl->getFormaction($this));
1174 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1185 if ($default_visibility ==
"") {
1186 $default_visibility =
1191 $radio_group->addOption($radio_option);
1192 $radio_option =
new ilRadioOption(
$lng->txt(
"news_visibility_public"),
"public");
1193 $radio_group->addOption($radio_option);
1194 $radio_group->setInfo(
$lng->txt(
"news_news_item_visibility_info"));
1195 $radio_group->setRequired(
false);
1196 $radio_group->setValue($default_visibility);
1197 $a_input->addSubItem($radio_group);
1200 if ($enable_internal_rss) {
1202 $lng->txt(
"news_public_feed"),
1203 "notifications_public_feed"
1205 $radio_rss->setInfo(
$lng->txt(
"news_public_feed_info"));
1206 $radio_rss->setChecked($public_feed);
1207 $a_input->addSubItem($radio_rss);
1216 foreach ($a_values as $key => $value) {
1228 $ilCtrl->returnToParent($this);
1240 if ($this->settings_form->checkInput()) {
1242 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1244 if ($enable_internal_rss) {
1247 "public_notifications",
1248 $_POST[
"notifications_public"],
1255 $_POST[
"notifications_public_feed"],
1261 "default_visibility",
1262 $_POST[
"default_visibility"],
1268 if ($this->
getProperty(
"hide_news_block_option")) {
1272 $_POST[
"hide_news_block"],
1278 "hide_news_per_date",
1279 $_POST[
"hide_news_per_date"],
1285 $hd = $this->settings_form->getItemByPostVar(
"hide_news_date");
1286 $hide_date = $hd->getDate();
1287 if (
$_POST[
"hide_news_per_date"] && $hide_date !=
null) {
1306 include_once(
"./Services/News/classes/class.ilNewsCache.php");
1308 $cache->deleteEntry(
$ilUser->getId() .
":" .
$_GET[
"ref_id"]);
1310 $ilCtrl->returnToParent($this);
1312 $this->settings_form->setValuesByPost();
1313 return $this->settings_form->getHtml();
1326 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1330 $tpl =
new ilTemplate(
"tpl.show_feed_url.html",
true,
true,
"Services/News");
1333 sprintf(
$lng->txt(
"news_feed_url_for"),
$title)
1335 $tpl->setVariable(
"TXT_INFO",
$lng->txt(
"news_get_feed_info"));
1336 $tpl->setVariable(
"TXT_FEED_URL",
$lng->txt(
"news_feed_url"));
1340 "&obj_id=" . $this->block_id .
1345 ILIAS_HTTP_PATH .
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) .
"&<br />user_id=" .
$ilUser->getId() .
1346 "&obj_id=" . $this->block_id .
1351 $content_block->setContent(
$tpl->get());
1352 $content_block->setTitle(
$lng->txt(
"news_internal_news"));
1354 return $content_block->getHTML();
1364 if ($this->new_rendering) {
1368 if (
$ilCtrl->getCmd() ==
"hideNotifications" ||
1369 $ilCtrl->getCmd() ==
"showNotifications") {
1373 if (
$ilCtrl->getCmdClass() !=
"ilcolumngui" &&
$ilCtrl->getCmd() !=
"enableJS") {
1376 $sess_feed_js =
$_SESSION[
"il_feed_js"];
1379 if ($sess_feed_js !=
"n" &&
1380 (
$ilUser->getPref(
"il_feed_js") !=
"n" || $sess_feed_js ==
"y")) {
1403 $rel_tpl =
new ilTemplate(
"tpl.dynamic_reload.html",
true,
true,
"Services/News");
1404 $rel_tpl->setVariable(
"TXT_LOADING",
$lng->txt(
"news_loading_news"));
1406 $rel_tpl->setVariable(
1408 $ilCtrl->getLinkTargetByClass(
"ilcolumngui",
"updateBlock",
"",
true)
1412 $rel_tpl->setVariable(
"TXT_NEWS_CLICK_HERE",
$lng->txt(
"news_no_js_click_here"));
1413 $rel_tpl->setVariable(
1415 $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)),
"disableJS")
1418 return $rel_tpl->get();
1432 $rel_tpl =
new ilTemplate(
"tpl.js_enabler.html",
true,
true,
"Services/News");
1434 $rel_tpl->setVariable(
1436 $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)),
"enableJS",
true,
"",
false)
1439 return $rel_tpl->get();
1449 $ilUser->writePref(
"il_feed_js",
"n");
1450 $ilCtrl->returnToParent($this);
1458 $ilUser->writePref(
"il_feed_js",
"y");
1479 $this->lng->txt(
"news_date") => $info[
"creation_date"]
1487 $item =
$factory->item()->standard(
$factory->link()->standard($info[
"news_title"], $info[
"url"]))
1488 ->withProperties($props);
1489 if ($info[
"ref_id"] > 0) {
1490 $item = $item->withDescription($info[
"type_txt"] .
": " . $info[
"obj_title"]);
1502 return $this->lng->txt(
"news_no_news_items");
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
getBlockId()
Get Block Id.
setData($a_data)
Set Data.
getRepositoryMode()
Get RepositoryMode.
setPresentation(int $type)
Set presentation.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
BlockGUI class for (centered) Content on Personal Desktop.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Base class for ILIAS Exception handling.
BlockGUI class for block NewsForContext.
cancelSettings()
Cancel settings.
saveSettings()
Save settings.
static getScreenMode()
Get Screen Mode for current command.
getMediaPath(int $mob_id)
subscribeNews()
Subscribe current user from news.
editSettings()
Show settings screen.
__construct()
Constructor.
unsubscribeNews()
Unsubscribe current user from news.
static writeSettings($a_values)
getHTML()
Get bloch HTML code.
getListItemForData(array $data)
Get list item for data array.null|\ILIAS\UI\Component\Item\Item
setEnableEdit($a_enable_edit=0)
Set EnableEdit.
initSettingsForm()
Init setting form.
showFeedUrl()
Show feed URL.
handleView()
Handles show/hide notification view and removes notifications if hidden.
fillRow($data)
get flat list for personal desktop
makeClickable($a_str)
Make clickable.
fillDataSection()
Fill data section.
executeCommand()
execute command
getNewsData()
Get news for context.
const OBJECTS_WITH_NEWS_SUBTAB
object type names with settings->news settings subtab
getEnableEdit()
Get EnableEdit.
getOverview()
Get overview.
getNoItemFoundContent()
No item entry.
static addToSettingsForm(ilFormPropertyGUI $a_input)
Add inputs to the container news settings form to configure also the contextBlock options.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
User Interface for NewsItem entities.
static _getDefaultVisibilityForRefId($a_ref_id)
Get default visibility for reference id.
static _setRead($a_user_id, $a_news_id)
Set item read.
static prepareNewsDataFromCache($a_cres)
Prepare news data from cache.
static determineNewsTitle( $a_context_obj_type, $a_title, $a_content_is_lang_var, $a_agg_ref_id=0, $a_aggregation="")
Determine title for news item entry.
static _lookupContextObjId($a_news_id)
Context Object ID.
static getRenderer($a_context_obj_type)
Get renderer.
static _subscribe($a_ref_id, $a_user_id)
Subscribe a user to an object (ref id).
static _unsubscribe($a_ref_id, $a_user_id)
Unsubscribe a user from an object (ref id).
static _getThreadForPosting($a_pos_id)
Get thread id for posting.
static _lookupFeedHash($a_user_id, $a_create=false)
Lookup news feed hash for user.
static lookupTxtById($plugin_id, $lang_var)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
static shortenWords($a_str, $a_len=30, $a_dots=true)
Ensure that the maximum word lenght within a text is not longer than $a_len.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.