5 include_once(
"./Services/News/classes/class.ilNewsItem.php");
6 include_once(
"./Services/Feeds/classes/class.ilFeedItem.php");
7 include_once(
"./Services/Feeds/classes/class.ilFeedWriter.php");
32 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
34 if (!$news_set->get(
"enable_rss_for_internal"))
47 if ($ilSetting->get(
'short_inst_name') !=
"")
55 $this->
prepareStr($loc.$obj_title.($a_purpose ?
" - ".$a_purpose :
"")));
60 if ($obj_type ==
"mcst")
62 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
66 $lng->loadLanguageModule(
"mcst");
69 $feed_item->setTitle($lng->txt(
"mcst_media_cast_not_online"));
70 $feed_item->setDescription($lng->txt(
"mcst_media_cast_not_online_text"));
71 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
72 "&target=".$item[
"context_obj_type"]);
78 include_once(
"./Services/Locator/classes/class.ilLocatorGUI.php");
80 $cont_loc->addContextItems($a_ref_id,
true);
81 $cont_loc->setTextOnly(
true);
82 $loc = $cont_loc->getTextVersion();
85 $loc =
" [".$loc.
"] ";
92 $news_item->setContextObjId($obj_id);
93 $news_item->setContextObjType($obj_type);
94 $items = $news_item->getNewsForRefId($a_ref_id,
true,
false, $rss_period,
true);
97 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
105 if ($a_purpose !=
false && $obj_type ==
"mcst")
121 ($item[
"context_obj_type"], $item[
"title"], $item[
"content_is_lang_var"],
122 $item[
"agg_ref_id"], $item[
"aggregation"]);
126 $cont_loc->addContextItems($item[
"ref_id"],
true, $a_ref_id);
127 $cont_loc->setTextOnly(
true);
128 $loc = $cont_loc->getHTML();
129 if (trim($loc) !=
"")
134 if ($news_set->get(
"rss_title_format") ==
"news_obj")
147 $feed_item->setDescription($this->
prepareStr(nl2br(
151 if (in_array($item[
"context_obj_type"], array(
"dbk",
"lm")) && $item[
"context_sub_obj_type"] ==
"pg"
152 && $item[
"context_sub_obj_id"] > 0)
154 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
155 "&target=pg_".$item[
"context_sub_obj_id"].
"_".$item[
"ref_id"]);
157 else if ($item[
"context_obj_type"] ==
"wiki" && $item[
"context_sub_obj_type"] ==
"wpg"
158 && $item[
"context_sub_obj_id"] > 0)
160 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
162 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
163 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"].
"_".$wptitle);
165 else if (in_array($item[
"context_obj_type"], array(
"frm")) && $item[
"context_sub_obj_type"] ==
"pos"
166 && $item[
"context_sub_obj_id"] > 0)
169 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
170 $thread_id = ilObjForumAccess::_getThreadForPosting($item[
"context_sub_obj_id"]);
173 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
174 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"].
"_".$thread_id.
"_".$item[
"context_sub_obj_id"]);
178 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
179 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
184 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
185 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
190 $feed_item->setAbout($feed_item->getLink().
"&il_about_feed=".$item[
"id"]);
191 $feed_item->setDate($item[
"creation_date"]);
198 if ($obj_type ==
"mcst")
200 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
210 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
217 $feed_item->setEnclosureUrl($url);
218 $feed_item->setEnclosureType((isset($mob[
"format"]))?$mob[
"format"]:
"audio/mpeg");
219 $feed_item->setEnclosureLength(
$size);