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($item[
"content"])));
149 if (in_array($item[
"context_obj_type"], array(
"dbk",
"lm")) && $item[
"context_sub_obj_type"] ==
"pg"
150 && $item[
"context_sub_obj_id"] > 0)
152 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
153 "&target=pg_".$item[
"context_sub_obj_id"].
"_".$item[
"ref_id"]);
155 else if (in_array($item[
"context_obj_type"], array(
"frm")) && $item[
"context_sub_obj_type"] ==
"pos"
156 && $item[
"context_sub_obj_id"] > 0)
159 include_once(
"./Modules/Forum/classes/class.ilObjForumAccess.php");
160 $thread_id = ilObjForumAccess::_getThreadForPosting($item[
"context_sub_obj_id"]);
163 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
164 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"].
"_".$thread_id.
"_".$item[
"context_sub_obj_id"]);
168 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
169 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
174 $feed_item->setLink(ILIAS_HTTP_PATH.
"/goto.php?client_id=".CLIENT_ID.
175 "&target=".$item[
"context_obj_type"].
"_".$item[
"ref_id"]);
180 $feed_item->setAbout($feed_item->getLink().
"&il_about_feed=".$item[
"id"]);
181 $feed_item->setDate($item[
"creation_date"]);
188 if ($obj_type ==
"mcst")
190 include_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
200 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
205 $size = filesize(
$file);
207 $feed_item->setEnclosureUrl($url);
208 $feed_item->setEnclosureType((isset($mob[
"format"]))?$mob[
"format"]:
"audio/mpeg");
209 $feed_item->setEnclosureLength($size);