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"]);
79 $cont_loc->addContextItems($a_ref_id,
true);
80 $cont_loc->setTextOnly(
true);
81 $loc = $cont_loc->getHTML();
84 $loc =
" [".$loc.
"] ";
91 $news_item->setContextObjId($obj_id);
92 $news_item->setContextObjType($obj_type);
93 $items = $news_item->getNewsForRefId($a_ref_id,
true,
false, $rss_period,
true);
96 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
104 if ($a_purpose !=
false && $obj_type ==
"mcst")
120 ($item[
"context_obj_type"], $item[
"title"], $item[
"content_is_lang_var"],
121 $item[
"agg_ref_id"], $item[
"aggregation"]);
125 $cont_loc->addContextItems($item[
"ref_id"],
true, $a_ref_id);
126 $cont_loc->setTextOnly(
true);
127 $loc = $cont_loc->getHTML();
128 if (trim($loc) !=
"")
133 if ($news_set->get(
"rss_title_format") ==
"news_obj")
146 $feed_item->setDescription($this->
prepareStr(nl2br(
150 if (in_array($item[
"context_obj_type"], array(
"dbk",
"lm")) && $item[
"context_sub_obj_type"] ==
"pg"
151 && $item[
"context_sub_obj_id"] > 0)
153 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
154 "&target=pg_".$item[
"context_sub_obj_id"].
"_".$item[
"ref_id"]);
156 else if ($item[
"context_obj_type"] ==
"wiki" && $item[
"context_sub_obj_type"] ==
"wpg"
157 && $item[
"context_sub_obj_id"] > 0)
159 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
161 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
162 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"].
"_".$wptitle);
164 else if (in_array($item[
"context_obj_type"], array(
"frm")) && $item[
"context_sub_obj_type"] ==
"pos"
165 && $item[
"context_sub_obj_id"] > 0)
168 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
172 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
173 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"].
"_".$thread_id.
"_".$item[
"context_sub_obj_id"]);
177 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
178 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
183 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
184 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
189 $feed_item->setAbout($feed_item->getLink().
"&il_about_feed=".$item[
"id"]);
190 $feed_item->setDate($item[
"creation_date"]);
197 if ($obj_type ==
"mcst")
199 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
209 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
216 $feed_item->setEnclosureUrl($url);
217 $feed_item->setEnclosureType((isset($mob[
"format"]))?$mob[
"format"]:
"audio/mpeg");
218 $feed_item->setEnclosureLength(
$size);