34 bool $privFeed =
false
39 $this->
lng = $DIC->language();
44 if ($a_user_id ==
"" || $a_hash ==
"") {
49 if (!$news_set->get(
"enable_rss_for_internal")) {
55 if ($a_hash == $hash) {
57 $items =
$DIC->news()->internal()->domain()->collection()->getNewsForUser(
59 new NewsCriteria(period: $rss_period, only_public: !$privFeed),
63 if (
$ilSetting->get(
'short_inst_name') !=
"") {
74 foreach (
$items as $item) {
78 if ($item->getContextObjType() ===
'mcst') {
86 $item->getContextObjType(),
88 $item->isContentIsLangVar(),
97 if ($news_set->get(
"rss_title_format") ==
"news_obj") {
98 $feed_item->setTitle($this->
prepareStr(str_replace(
"<br />",
" ", $title)) .
103 ": " . $this->
prepareStr(str_replace(
"<br />",
" ", $title)));
109 $item->getContextObjType(),
111 $item->isContentTextIsLangVar(),
114 $feed_item->setDescription($content);
117 if ($item->getContextObjType() ==
"lm" && $item->getContextSubObjType() ==
"pg"
118 && $item->getContextObjId() > 0) {
119 $feed_item->setLink(ILIAS_HTTP_PATH .
"/goto.php?client_id=" .
CLIENT_ID .
120 "&target=pg_" . $item->getContextSubObjId() .
"_" . $item->getContextRefId());
121 } elseif ($item->getContextObjType() ==
"wiki" && $item->getContextSubObjType() ==
"wpg"
122 && $item->getContextSubObjId() > 0) {
124 $feed_item->setLink(ILIAS_HTTP_PATH .
"/goto.php?client_id=" .
CLIENT_ID .
125 "&target=" . $item->getContextObjType() .
"_" . $item->getContextRefId() .
"_" . urlencode($wptitle));
126 } elseif ($item->getContextObjType() ==
"frm" && $item->getContextSubObjType() ==
"pos"
127 && $item->getContextSubObjId() > 0) {
130 if ($thread_id > 0) {
131 $feed_item->setLink(ILIAS_HTTP_PATH .
"/goto.php?client_id=" .
CLIENT_ID .
132 "&target=" . $item->getContextObjType() .
"_" . $item->getContextRefId() .
"_" . $thread_id .
"_" . $item->getContextSubObjId());
134 $feed_item->setLink(ILIAS_HTTP_PATH .
"/goto.php?client_id=" .
CLIENT_ID .
135 "&target=" . $item->getContextObjType() .
"_" . $item->getContextRefId());
138 $feed_item->setLink(ILIAS_HTTP_PATH .
"/goto.php?client_id=" .
CLIENT_ID .
139 "&target=" . $item->getContextObjType() .
"_" . $item->getContextRefId());
141 $feed_item->setAbout($feed_item->getLink() .
"&il_about_feed=" . $item->getId());
142 $feed_item->setDate($item->getCreationDate()->format(
"Y-m-d H:i:s"));
News Criteria DTO for querying news items supports caching, JSON serialization, and validation.
News Item DTO for transfer of news items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addItem(ilFeedItem $a_item)
getContextPath(int $a_ref_id)
prepareStr(string $a_str)
setChannelAbout(string $a_ab)
setChannelTitle(string $a_title)
setChannelLink(string $a_link)
static _lookupRSSPeriod()
static determineNewsTitle(string $a_context_obj_type, string $a_title, bool $a_content_is_lang_var, int $a_agg_ref_id=0, array $a_aggregation=[], ?ilLanguage $lng=null)
Determine title for news item entry.
static determineNewsContent(string $a_context_obj_type, string $a_content, bool $a_is_lang_var, ?ilLanguage $lng=null)
Determine new content.
static _getThreadForPosting(int $a_pos_id)
static _lookupFeedHash(int $a_user_id, bool $a_create=false)
static _lookupTitle(int $obj_id)
Feed writer for personal user feeds.
static lookupTitle(int $a_page_id, string $lang="-")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc