ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

Member Function Documentation

◆ addTimelineActions()

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

Implements ilNewsRendererGUI.

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

142  {
143 
144  }

◆ 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  {
105  $this->lng->loadLanguageModule($this->news_item->getContextObjType());
106  return $this->lng->txt($this->news_item->getContent());
107  }
108 
109  $content = $this->makeClickable($this->news_item->getContent());
110  if (!$this->news_item->getContentHtml())
111  {
112  $content = "<p>".nl2br($content)."</p>";
113  }
114  $content.= $this->news_item->getContentLong();
115 
116  return $content;
117  }
+ 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 151 of file class.ilNewsDefaultRendererGUI.php.

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

152  {
153  include_once("./Services/Link/classes/class.ilLink.php");
154  return ilLink::_getLink($this->getNewsRefId());
155  }
+ 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 125 of file class.ilNewsDefaultRendererGUI.php.

References ilUtil\makeClickable().

Referenced by getDetailContent().

126  {
127  // this fixes bug 8744.
128  // If the string already contains a tags our makeClickable does not work
129  if (is_int(strpos($a_str, "</a>")) && is_int(strpos($a_str, "<a")))
130  {
131  return $a_str;
132  }
133 
134  return ilUtil::makeClickable($a_str);
135  }
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: