ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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. More...
 
 secureString ($a_str)
 
 getMagpieItem ()
 Get Magpie Item. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setLink ($a_link)
 Set Link. More...
 
 getLink ()
 Get Link. More...
 
 setSummary ($a_summary)
 Set Summary. More...
 
 getSummary ()
 Get Summary. More...
 
 setDate ($a_date)
 Set Date. More...
 
 getDate ()
 Get Date. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setAuthor ($a_author)
 Set Author. More...
 
 getAuthor ()
 Get Author. More...
 

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

◆ __construct()

ilExternalFeedItem::__construct ( )

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

15  {
16  }

Member Function Documentation

◆ getAuthor()

ilExternalFeedItem::getAuthor ( )

Get Author.

Returns
string Author

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

228  {
229  return $this->author;
230  }

◆ getDate()

ilExternalFeedItem::getDate ( )

Get Date.

Returns
string Date

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

188  {
189  return $this->date;
190  }

◆ getId()

ilExternalFeedItem::getId ( )

Get Id.

Returns
string Id

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

208  {
209  return $this->id;
210  }

◆ getLink()

ilExternalFeedItem::getLink ( )

Get Link.

Returns
string Link

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

148  {
149  return $this->link;
150  }

◆ getMagpieItem()

ilExternalFeedItem::getMagpieItem ( )

Get Magpie Item.

Returns
object Magpie Item

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

108  {
109  return $this->magpie_item;
110  }

◆ getSummary()

ilExternalFeedItem::getSummary ( )

Get Summary.

Returns
string Summary

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

Referenced by setMagpieItem().

168  {
169  return $this->summary;
170  }
+ Here is the caller graph for this function:

◆ getTitle()

ilExternalFeedItem::getTitle ( )

Get Title.

Returns
string Title

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

Referenced by setMagpieItem().

128  {
129  return $this->title;
130  }
+ Here is the caller graph for this function:

◆ secureString()

ilExternalFeedItem::secureString (   $a_str)

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

References ilUtil\secureString().

Referenced by setMagpieItem().

88  {
89  $a_str = ilUtil::secureString($a_str, true, "<b><i><em><strong><br><ol><li><ul><a><img>");
90  $old_str = "";
91 
92  // set target to blank for all links
93  while($old_str != $a_str)
94  {
95  $old_str = $a_str;
96  $a_str = preg_replace("/<a href=\"([^\"]*)\">/i",
97  "/<a href=\"\\1\" target=\"_blank\">/", $a_str);
98  }
99  return $a_str;
100  }
static secureString($a_str, $a_strip_html=true, $a_allow="")
Remove unsecure tags.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAuthor()

ilExternalFeedItem::setAuthor (   $a_author)

Set Author.

Parameters
string$a_authorAuthor

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

Referenced by setMagpieItem().

218  {
219  $this->author = $a_author;
220  }
+ Here is the caller graph for this function:

◆ setDate()

ilExternalFeedItem::setDate (   $a_date)

Set Date.

Parameters
string$a_dateDate

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

Referenced by setMagpieItem().

178  {
179  $this->date = $a_date;
180  }
+ Here is the caller graph for this function:

◆ setId()

ilExternalFeedItem::setId (   $a_id)

Set Id.

Parameters
string$a_idId

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

Referenced by setMagpieItem().

198  {
199  $this->id = $a_id;
200  }
+ Here is the caller graph for this function:

◆ setLink()

ilExternalFeedItem::setLink (   $a_link)

Set Link.

Parameters
string$a_linkLink

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

Referenced by setMagpieItem().

138  {
139  $this->link = $a_link;
140  }
+ Here is the caller graph for this function:

◆ setMagpieItem()

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().

22  {
23  $this->magpie_item = $a_item;
24 
25  //var_dump($a_item);
26 
27  // title
28  $this->setTitle(
29  $this->secureString($a_item["title"]));
30 
31  // link
32  if (isset($a_item["link_"]))
33  {
34  $this->setLink(
35  ilUtil::secureLink($this->secureString($a_item["link_"])));
36  }
37  else
38  {
39  if (isset($a_item["link"]))
40  {
41  $this->setLink(
42  ilUtil::secureLink($this->secureString($a_item["link"])));
43  }
44  }
45 
46  // summary
47  if (isset($a_item["atom_content"]))
48  {
49  $this->setSummary(
50  $this->secureString($a_item["atom_content"]));
51  }
52  else if (isset($a_item["summary"]))
53  {
54  $this->setSummary(
55  $this->secureString($a_item["summary"]));
56  }
57  else if (isset($a_item["description"]))
58  {
59  $this->setSummary(
60  $this->secureString($a_item["description"]));
61  }
62 
63  // date
64  if (isset($a_item["pubdate"]))
65  {
66  $this->setDate(
67  $this->secureString($a_item["pubdate"]));
68  }
69  else if (isset($a_item["updated"]))
70  {
71  $this->setDate(
72  $this->secureString($a_item["updated"]));
73  }
74 
75  // Author
76  if (isset($a_item["dc"]["creator"]))
77  {
78  $this->setAuthor(
79  $this->secureString($a_item["dc"]["creator"]));
80  }
81 
82  // id
83  $this->setId(md5($this->getTitle().$this->getSummary()));
84 
85  }
setAuthor($a_author)
Set Author.
setTitle($a_title)
Set Title.
static secureLink($a_str)
setSummary($a_summary)
Set Summary.
+ Here is the call graph for this function:

◆ setSummary()

ilExternalFeedItem::setSummary (   $a_summary)

Set Summary.

Parameters
string$a_summarySummary

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

Referenced by setMagpieItem().

158  {
159  $this->summary = $a_summary;
160  }
+ Here is the caller graph for this function:

◆ setTitle()

ilExternalFeedItem::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

Referenced by setMagpieItem().

118  {
119  $this->title = $a_title;
120  }
+ Here is the caller graph for this function:

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