ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilUserFeedWriter Class Reference

Feed writer for personal user feeds. More...

+ Inheritance diagram for ilUserFeedWriter:
+ Collaboration diagram for ilUserFeedWriter:

Public Member Functions

 ilUserFeedWriter ($a_user_id, $a_hash, $privFeed=false)
- Public Member Functions inherited from ilFeedWriter
 ilFeedWriter ()
 setEncoding ($a_enc)
 Set feed encoding.
 getEncoding ()
 setChannelAbout ($a_ab)
 Unique URI that defines the channel.
 getChannelAbout ()
 setChannelTitle ($a_title)
 Channel Title.
 getChannelTitle ()
 setChannelLink ($a_link)
 Channel Link URL to which an HTML rendering of the channel title will link.
 getChannelLink ()
 setChannelDescription ($a_desc)
 Channel Description.
 getChannelDescription ()
 addItem ($a_item)
 Add Item Item is an object of type ilFeedItem.
 getItems ()
 prepareStr ($a_str)
 getFeed ()
 get feed xml
 showFeed ()

Additional Inherited Members

- Data Fields inherited from ilFeedWriter
 $encoding = "UTF-8"
 $ch_about = ""
 $ch_title = ""
 $ch_link = ""
 $ch_description = ""
 $items = array()

Detailed Description

Feed writer for personal user feeds.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 38 of file class.ilUserFeedWriter.php.

Member Function Documentation

ilUserFeedWriter::ilUserFeedWriter (   $a_user_id,
  $a_hash,
  $privFeed = false 
)

Definition at line 41 of file class.ilUserFeedWriter.php.

References $ilSetting, ilFeedWriter\$items, $lng, $title, ilNewsItem\_getNewsItemsOfUser(), ilObjUser\_lookupFeedHash(), ilObject\_lookupObjId(), ilObjMediaCastAccess\_lookupOnline(), ilNewsItem\_lookupRSSPeriod(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilFeedWriter\addItem(), ilNewsItem\determineNewsTitle(), ilFeedWriter\ilFeedWriter(), ilFeedWriter\prepareStr(), ilFeedWriter\setChannelAbout(), ilFeedWriter\setChannelLink(), ilFeedWriter\setChannelTitle(), and ilNewsItem\setPrivateFeedId().

{
global $ilSetting, $lng;
//$lng->loadLanguageModule("news");
if ($a_user_id == "" || $a_hash == "")
{
return;
}
$news_set = new ilSetting("news");
if (!$news_set->get("enable_rss_for_internal"))
{
return;
}
$hash = ilObjUser::_lookupFeedHash($a_user_id);
include_once("./Services/News/classes/class.ilNewsItem.php");
if ($a_hash == $hash)
{
if ($privFeed)
{
}
$items = ilNewsItem::_getNewsItemsOfUser($a_user_id, true, true, $rss_period);
if ($ilSetting->get('short_inst_name') != "")
{
$this->setChannelTitle($ilSetting->get('short_inst_name'));
}
else
{
$this->setChannelTitle("ILIAS");
}
$this->setChannelAbout(ILIAS_HTTP_PATH);
$this->setChannelLink(ILIAS_HTTP_PATH);
//$this->setChannelDescription("ILIAS Channel Description");
$i = 0;
foreach($items as $item)
{
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$obj_type = ilObject::_lookupType($obj_id);
$obj_title = ilObject::_lookupTitle($obj_id);
// not nice, to do: general solution
if ($obj_type == "mcst")
{
include_once("./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
{
continue;
}
}
$i++;
$feed_item = new ilFeedItem();
($item["context_obj_type"], $item["title"], $item["content_is_lang_var"],
$item["agg_ref_id"], $item["aggregation"]);
// path
$cont_loc = new ilLocatorGUI();
$cont_loc->addContextItems($item["ref_id"], true);
$cont_loc->setTextOnly(true);
$loc = "[".$cont_loc->getHTML()."]";
// title
$feed_item->setTitle($this->prepareStr($loc)." ".$this->prepareStr($obj_title).": ".$this->prepareStr(str_replace("<br />", " ", $title)));
// description
$content = $this->prepareStr(nl2br($item["content"]));
$feed_item->setDescription($content);
$feed_item->setLink(ILIAS_HTTP_PATH."/goto.php?client_id=".CLIENT_ID.
"&amp;target=".$item["context_obj_type"]."_".$item["ref_id"]);
$feed_item->setAbout($feed_item->getLink()."&amp;il_about_feed=".$item["id"]);
$this->addItem($feed_item);
}
}
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: