5 include_once(
"Services/Feeds/classes/class.ilFeedItem.php");
43 $this->encoding = $a_enc;
56 $this->ch_about = $a_ab;
69 $this->ch_title = $a_title;
83 $this->ch_link = $a_link;
96 $this->ch_desc = $a_desc;
101 return $this->ch_desc;
110 $this->items[] = $a_item;
120 $a_str = str_replace(
"&",
"&", $a_str);
121 $a_str = str_replace(
"<",
"<", $a_str);
122 $a_str = str_replace(
">",
">", $a_str);
131 include_once(
"./Services/UICore/classes/class.ilTemplate.php");
132 $this->tpl =
new ilTemplate(
"tpl.rss_2_0.xml",
true,
true,
"Services/Feeds");
134 $this->tpl->setVariable(
"XML",
"xml");
135 $this->tpl->setVariable(
"CONTENT_ENCODING", $this->
getEncoding());
141 foreach($this->items as $item)
143 $this->tpl->setCurrentBlock(
"rdf_seq");
144 $this->tpl->setVariable(
"RESOURCE", $item->getAbout());
145 $this->tpl->parseCurrentBlock();
148 if ($item->getDate() !=
"")
150 $this->tpl->setCurrentBlock(
"date");
151 $d = $item->getDate();
152 $yyyy = substr(
$d, 0, 4);
153 $mm = substr(
$d, 5, 2);
154 $dd = substr(
$d, 8, 2);
155 $h = substr(
$d, 11, 2);
156 $m = substr(
$d, 14, 2);
157 $s = substr(
$d, 17, 2);
158 $this->tpl->setVariable(
"ITEM_DATE",
159 date(
"r", mktime($h, $m, $s, $mm, $dd, $yyyy)));
160 $this->tpl->parseCurrentBlock();
164 if ($item->getEnclosureUrl() !=
"")
166 $this->tpl->setCurrentBlock(
"enclosure");
167 $this->tpl->setVariable(
"ENC_URL", $item->getEnclosureUrl());
168 $this->tpl->setVariable(
"ENC_LENGTH", $item->getEnclosureLength());
169 $this->tpl->setVariable(
"ENC_TYPE", $item->getEnclosureType());
170 $this->tpl->parseCurrentBlock();
173 $this->tpl->setCurrentBlock(
"item");
174 $this->tpl->setVariable(
"ITEM_ABOUT", $item->getAbout());
175 $this->tpl->setVariable(
"ITEM_TITLE", $item->getTitle());
176 $this->tpl->setVariable(
"ITEM_DESCRIPTION", $item->getDescription());
177 $this->tpl->setVariable(
"ITEM_LINK", $item->getLink());
178 $this->tpl->parseCurrentBlock();
182 $this->tpl->parseCurrentBlock();
183 return $this->tpl->get();
188 header(
"Content-Type: text/xml; charset=UTF-8;");
200 $path = $tree->getPathFull($a_ref_id);
204 $r_path = array_reverse(
$path);
208 foreach ($r_path as $key =>
$row)
212 if (in_array(
$row[
"type"], array(
"root",
"cat",
"grp",
"crs")) )
214 $first =
$row[
"child"];
217 $omit[
$row[
"child"]] = $do_omit;
223 if ($first ==
$row[
"child"])
228 if ($add_it && !$omit[
$row[
"child"]] &&
229 ((
$row[
"child"] != $a_ref_id)))
231 if (
$row[
"title"] ==
"ILIAS" &&
$row[
"type"] ==
"root")
233 $row[
"title"] = $lng->txt(
"repository");
242 return "[".implode(
" > ",
$items).
"]";