ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExternalFeedItem Class Reference

Wraps $item arrays from magpie. More...

+ Collaboration diagram for ilExternalFeedItem:

Public Member Functions

 __construct ()
 setMagpieItem ($a_item)
 Set Magpie Item and read it into internal variables.
 secureString ($a_str)
 getMagpieItem ()
 Get Magpie Item.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setLink ($a_link)
 Set Link.
 getLink ()
 Get Link.
 setSummary ($a_summary)
 Set Summary.
 getSummary ()
 Get Summary.
 setDate ($a_date)
 Set Date.
 getDate ()
 Get Date.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setAuthor ($a_author)
 Set Author.
 getAuthor ()
 Get Author.

Detailed Description

Wraps $item arrays from magpie.

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

Definition at line 12 of file class.ilExternalFeedItem.php.

Constructor & Destructor Documentation

ilExternalFeedItem::__construct ( )

Definition at line 14 of file class.ilExternalFeedItem.php.

{
}

Member Function Documentation

ilExternalFeedItem::getAuthor ( )

Get Author.

Returns
string Author

Definition at line 227 of file class.ilExternalFeedItem.php.

{
return $this->author;
}
ilExternalFeedItem::getDate ( )

Get Date.

Returns
string Date

Definition at line 187 of file class.ilExternalFeedItem.php.

{
return $this->date;
}
ilExternalFeedItem::getId ( )

Get Id.

Returns
string Id

Definition at line 207 of file class.ilExternalFeedItem.php.

{
return $this->id;
}
ilExternalFeedItem::getLink ( )

Get Link.

Returns
string Link

Definition at line 147 of file class.ilExternalFeedItem.php.

{
return $this->link;
}
ilExternalFeedItem::getMagpieItem ( )

Get Magpie Item.

Returns
object Magpie Item

Definition at line 107 of file class.ilExternalFeedItem.php.

{
return $this->magpie_item;
}
ilExternalFeedItem::getSummary ( )

Get Summary.

Returns
string Summary

Definition at line 167 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
return $this->summary;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::getTitle ( )

Get Title.

Returns
string Title

Definition at line 127 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::secureString (   $a_str)

Definition at line 87 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$a_str = ilUtil::secureString($a_str, true, "<b><i><em><strong><br><ol><li><ul><a><img>");
$old_str = "";
// set target to blank for all links
while($old_str != $a_str)
{
$old_str = $a_str;
$a_str = preg_replace("/<a href=\"([^\"]*)\">/i",
"/<a href=\"\\1\" target=\"_blank\">/", $a_str);
}
return $a_str;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setAuthor (   $a_author)

Set Author.

Parameters
string$a_authorAuthor

Definition at line 217 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->author = $a_author;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setDate (   $a_date)

Set Date.

Parameters
string$a_dateDate

Definition at line 177 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->date = $a_date;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setId (   $a_id)

Set Id.

Parameters
string$a_idId

Definition at line 197 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setLink (   $a_link)

Set Link.

Parameters
string$a_linkLink

Definition at line 137 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->link = $a_link;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setMagpieItem (   $a_item)

Set Magpie Item and read it into internal variables.

Definition at line 21 of file class.ilExternalFeedItem.php.

References getSummary(), getTitle(), ilUtil\secureLink(), secureString(), setAuthor(), setDate(), setId(), setLink(), setSummary(), and setTitle().

{
$this->magpie_item = $a_item;
//var_dump($a_item);
// title
$this->setTitle(
$this->secureString($a_item["title"]));
// link
if (isset($a_item["link_"]))
{
$this->setLink(
ilUtil::secureLink($this->secureString($a_item["link_"])));
}
else
{
if (isset($a_item["link"]))
{
$this->setLink(
ilUtil::secureLink($this->secureString($a_item["link"])));
}
}
// summary
if (isset($a_item["atom_content"]))
{
$this->setSummary(
$this->secureString($a_item["atom_content"]));
}
else if (isset($a_item["summary"]))
{
$this->setSummary(
$this->secureString($a_item["summary"]));
}
else if (isset($a_item["description"]))
{
$this->setSummary(
$this->secureString($a_item["description"]));
}
// date
if (isset($a_item["pubdate"]))
{
$this->setDate(
$this->secureString($a_item["pubdate"]));
}
else if (isset($a_item["updated"]))
{
$this->setDate(
$this->secureString($a_item["updated"]));
}
// Author
if (isset($a_item["dc"]["creator"]))
{
$this->setAuthor(
$this->secureString($a_item["dc"]["creator"]));
}
// id
$this->setId(md5($this->getTitle().$this->getSummary()));
}

+ Here is the call graph for this function:

ilExternalFeedItem::setSummary (   $a_summary)

Set Summary.

Parameters
string$a_summarySummary

Definition at line 157 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->summary = $a_summary;
}

+ Here is the caller graph for this function:

ilExternalFeedItem::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

Definition at line 117 of file class.ilExternalFeedItem.php.

Referenced by setMagpieItem().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:


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