ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilNewsDefaultRendererGUI Class Reference

Default renderer. More...

+ Inheritance diagram for ilNewsDefaultRendererGUI:
+ Collaboration diagram for ilNewsDefaultRendererGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setNewsItem (ilNewsItem $a_news_item, $a_news_ref_id)
 Set news item.
Parameters
ilNewsItem$a_news_item
int$a_news_ref_id
More...
 
 getNewsItem ()
 Get news item. More...
 
 getNewsRefId ()
 Get news ref id. More...
 
 setLanguage ($a_lang_key)
 Language key.
Parameters
$iilNewsItem news item
More...
 
 getTimelineContent ()
 Render content for timeline.
Returns
string html
More...
 
 getDetailContent ()
 Render content for detail view.
Returns
string html
More...
 
 makeClickable ($a_str)
 Make clickable. More...
 
 addTimelineActions (ilAdvancedSelectionListGUI $list)
 
 getObjectLink ()
 Get object link. More...
 

Protected Attributes

 $lng_key
 
 $ctrl
 
 $lng
 
 $news_item
 
 $news_ref_id
 

Detailed Description

Default renderer.

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

Definition at line 13 of file class.ilNewsDefaultRendererGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilNewsDefaultRendererGUI::__construct ( )

Constructor.

Parameters

Implements ilNewsRendererGUI.

Definition at line 43 of file class.ilNewsDefaultRendererGUI.php.

References $DIC.

44  {
45  global $DIC;
46 
47  $this->ctrl = $DIC->ctrl();
48  $this->lng = $DIC->language();
49  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addTimelineActions()

ilNewsDefaultRendererGUI::addTimelineActions ( ilAdvancedSelectionListGUI  $list)
Parameters
ilAdvancedSelectionListGUI$list

Implements ilNewsRendererGUI.

Definition at line 138 of file class.ilNewsDefaultRendererGUI.php.

139  {
140  }

◆ getDetailContent()

ilNewsDefaultRendererGUI::getDetailContent ( )

Render content for detail view.

Returns
string html

Implements ilNewsRendererGUI.

Definition at line 101 of file class.ilNewsDefaultRendererGUI.php.

References makeClickable().

Referenced by getTimelineContent().

102  {
103  if ($this->news_item->getContentTextIsLangVar()) {
104  $this->lng->loadLanguageModule($this->news_item->getContextObjType());
105  return $this->lng->txt($this->news_item->getContent());
106  }
107 
108  $content = $this->makeClickable($this->news_item->getContent());
109  if (!$this->news_item->getContentHtml()) {
110  $content = "<p>" . nl2br($content) . "</p>";
111  }
112  $content.= $this->news_item->getContentLong();
113 
114  return $content;
115  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewsItem()

ilNewsDefaultRendererGUI::getNewsItem ( )

◆ getNewsRefId()

ilNewsDefaultRendererGUI::getNewsRefId ( )

◆ getObjectLink()

ilNewsDefaultRendererGUI::getObjectLink ( )

Get object link.

Returns
string link href url

Implements ilNewsRendererGUI.

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

References ilLink\_getLink(), and getNewsRefId().

148  {
149  include_once("./Services/Link/classes/class.ilLink.php");
150  return ilLink::_getLink($this->getNewsRefId());
151  }
+ Here is the call graph for this function:

◆ getTimelineContent()

ilNewsDefaultRendererGUI::getTimelineContent ( )

Render content for timeline.

Returns
string html

Implements ilNewsRendererGUI.

Definition at line 93 of file class.ilNewsDefaultRendererGUI.php.

References getDetailContent().

94  {
95  return $this->getDetailContent();
96  }
getDetailContent()
Render content for detail view.string html
+ Here is the call graph for this function:

◆ makeClickable()

ilNewsDefaultRendererGUI::makeClickable (   $a_str)

Make clickable.

Parameters

Definition at line 123 of file class.ilNewsDefaultRendererGUI.php.

References ilUtil\makeClickable().

Referenced by getDetailContent().

124  {
125  // this fixes bug 8744.
126  // If the string already contains a tags our makeClickable does not work
127  if (is_int(strpos($a_str, "</a>")) && is_int(strpos($a_str, "<a"))) {
128  return $a_str;
129  }
130 
131  return ilUtil::makeClickable($a_str);
132  }
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLanguage()

ilNewsDefaultRendererGUI::setLanguage (   $a_lang_key)

Language key.

Parameters
$iilNewsItem news item

Implements ilNewsRendererGUI.

Definition at line 84 of file class.ilNewsDefaultRendererGUI.php.

85  {
86  $this->lng_key = $a_lang_key;
87  }

◆ setNewsItem()

ilNewsDefaultRendererGUI::setNewsItem ( ilNewsItem  $a_news_item,
  $a_news_ref_id 
)

Set news item.

Parameters
ilNewsItem$a_news_item
int$a_news_ref_id

Implements ilNewsRendererGUI.

Definition at line 54 of file class.ilNewsDefaultRendererGUI.php.

55  {
56  $this->news_item = $a_news_item;
57  $this->news_ref_id = $a_news_ref_id;
58  }

Field Documentation

◆ $ctrl

ilNewsDefaultRendererGUI::$ctrl
protected

Definition at line 20 of file class.ilNewsDefaultRendererGUI.php.

◆ $lng

ilNewsDefaultRendererGUI::$lng
protected

Definition at line 25 of file class.ilNewsDefaultRendererGUI.php.

◆ $lng_key

ilNewsDefaultRendererGUI::$lng_key
protected

Definition at line 15 of file class.ilNewsDefaultRendererGUI.php.

◆ $news_item

ilNewsDefaultRendererGUI::$news_item
protected

Definition at line 30 of file class.ilNewsDefaultRendererGUI.php.

Referenced by getNewsItem().

◆ $news_ref_id

ilNewsDefaultRendererGUI::$news_ref_id
protected

Definition at line 35 of file class.ilNewsDefaultRendererGUI.php.

Referenced by getNewsRefId().


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