24 include_once(
"Services/Feeds/classes/class.ilFeedItem.php");
62 $this->encoding = $a_enc;
75 $this->ch_about = $a_ab;
88 $this->ch_title = $a_title;
102 $this->ch_link = $a_link;
115 $this->ch_desc = $a_desc;
120 return $this->ch_desc;
129 $this->items[] = $a_item;
139 $a_str = str_replace(
"&",
"&", $a_str);
140 $a_str = str_replace(
"<",
"<", $a_str);
141 $a_str = str_replace(
">",
">", $a_str);
150 include_once(
"classes/class.ilTemplate.php");
151 $this->tpl =
new ilTemplate(
"tpl.rss_2_0.xml",
true,
true,
"Services/Feeds");
153 $this->tpl->setVariable(
"XML",
"xml");
154 $this->tpl->setVariable(
"CONTENT_ENCODING", $this->
getEncoding());
160 foreach($this->items as $item)
162 $this->tpl->setCurrentBlock(
"rdf_seq");
163 $this->tpl->setVariable(
"RESOURCE", $item->getAbout());
164 $this->tpl->parseCurrentBlock();
167 if ($item->getDate() !=
"")
169 $this->tpl->setCurrentBlock(
"date");
170 $d = $item->getDate();
171 $yyyy = substr(
$d, 0, 4);
172 $mm = substr(
$d, 5, 2);
173 $dd = substr(
$d, 8, 2);
174 $h = substr(
$d, 11, 2);
175 $m = substr(
$d, 14, 2);
176 $s = substr(
$d, 17, 2);
177 $this->tpl->setVariable(
"ITEM_DATE",
178 date(
"r", mktime($h, $m, $s, $mm, $dd, $yyyy)));
179 $this->tpl->parseCurrentBlock();
183 if ($item->getEnclosureUrl() !=
"")
185 $this->tpl->setCurrentBlock(
"enclosure");
186 $this->tpl->setVariable(
"ENC_URL", $item->getEnclosureUrl());
187 $this->tpl->setVariable(
"ENC_LENGTH", $item->getEnclosureLength());
188 $this->tpl->setVariable(
"ENC_TYPE", $item->getEnclosureType());
189 $this->tpl->parseCurrentBlock();
192 $this->tpl->setCurrentBlock(
"item");
193 $this->tpl->setVariable(
"ITEM_ABOUT", $item->getAbout());
194 $this->tpl->setVariable(
"ITEM_TITLE", $item->getTitle());
195 $this->tpl->setVariable(
"ITEM_DESCRIPTION", $item->getDescription());
196 $this->tpl->setVariable(
"ITEM_LINK", $item->getLink());
197 $this->tpl->parseCurrentBlock();
201 $this->tpl->parseCurrentBlock();
202 return $this->tpl->get();
207 header(
"Content-Type: text/xml; charset=UTF-8;");