ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilNewsForContextBlockGUI Class Reference

BlockGUI class for block NewsForContext. More...

+ Inheritance diagram for ilNewsForContextBlockGUI:
+ Collaboration diagram for ilNewsForContextBlockGUI:

Public Member Functions

 ilNewsForContextBlockGUI ()
 Constructor. More...
 
 getNewsData ()
 Get news for context. More...
 
executeCommand ()
 execute command More...
 
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 handleView ()
 Handles show/hide notification view and removes notifications if hidden. More...
 
 fillRow ($news)
 get flat bookmark list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 showNews ()
 show news More...
 
 makeClickable ($a_str)
 Make clickable. More...
 
 unsubscribeNews ()
 Unsubscribe current user from news. More...
 
 subscribeNews ()
 Subscribe current user from news. More...
 
 fillFooter ()
 block footer More...
 
 showViewFooter ()
 Show additional footer for show/hide notifications. More...
 
 showNotifications ()
 
 hideNotifications ()
 
 editSettings ()
 Show settings screen. More...
 
 initSettingsForm ()
 Init setting form. More...
 
 cancelSettings ()
 Cancel settings. More...
 
 saveSettings ()
 Save settings. More...
 
 showFeedUrl ()
 Show feed URL. More...
 
 addCloseCommand ($a_content_block)
 
 getDynamic ()
 
 getDynamicReload ()
 
 getJSEnabler ()
 
 disableJS ()
 
 enableJS ()
 
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is this a repository object. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "news"
 
static $st_data
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

BlockGUI class for block NewsForContext.

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

ilNewsForContextBlockGUI: ilColumnGUI ilNewsForContextBlockGUI: ilNewsItemGUI

Definition at line 18 of file class.ilNewsForContextBlockGUI.php.

Member Function Documentation

◆ addCloseCommand()

ilNewsForContextBlockGUI::addCloseCommand (   $a_content_block)

Definition at line 1195 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, and $lng.

Referenced by showNews().

1196  {
1197  global $lng, $ilCtrl;
1198 
1199  $a_content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
1200  $lng->txt("close"), true);
1201  }
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ cancelSettings()

ilNewsForContextBlockGUI::cancelSettings ( )

Cancel settings.

Definition at line 1099 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl.

1100  {
1101  global $ilCtrl;
1102 
1103  $ilCtrl->returnToParent($this);
1104  }
global $ilCtrl
Definition: ilias.php:18

◆ disableJS()

ilNewsForContextBlockGUI::disableJS ( )

Definition at line 1272 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, $ilCtrl, and $ilUser.

1273  {
1274  global $ilCtrl, $ilUser;
1275 
1276  $_SESSION["il_feed_js"] = "n";
1277  $ilUser->writePref("il_feed_js", "n");
1278 $ilCtrl->returnToParent($this);
1279  //$ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
1280  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

◆ editSettings()

ilNewsForContextBlockGUI::editSettings ( )

Show settings screen.

Definition at line 969 of file class.ilNewsForContextBlockGUI.php.

References initSettingsForm().

Referenced by ilPDNewsBlockGUI\changeFeedSettings().

970  {
971  $this->initSettingsForm();
972  return $this->settings_form->getHTML();
973  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enableJS()

ilNewsForContextBlockGUI::enableJS ( )

Definition at line 1282 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, $ilUser, exit, and getHTML().

1283  {
1284  global $ilUser;
1285 //echo "enableJS";
1286  $_SESSION["il_feed_js"] = "y";
1287  $ilUser->writePref("il_feed_js", "y");
1288  echo $this->getHTML();
1289  exit;
1290  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
exit
Definition: login.php:54
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ executeCommand()

& ilNewsForContextBlockGUI::executeCommand ( )

execute command

Definition at line 180 of file class.ilNewsForContextBlockGUI.php.

References $cmd, $ilCtrl, and getEnableEdit().

181  {
182  global $ilCtrl;
183 
184  $next_class = $ilCtrl->getNextClass();
185  $cmd = $ilCtrl->getCmd("getHTML");
186 
187  switch ($next_class)
188  {
189  case "ilnewsitemgui":
190  include_once("./Services/News/classes/class.ilNewsItemGUI.php");
191  $news_item_gui = new ilNewsItemGUI();
192  $news_item_gui->setEnableEdit($this->getEnableEdit());
193  $html = $ilCtrl->forwardCommand($news_item_gui);
194  return $html;
195 
196  default:
197  return $this->$cmd();
198  }
199  }
$cmd
Definition: sahs_server.php:35
User Interface for NewsItem entities.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ fillDataSection()

ilNewsForContextBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 224 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\getCurrentDetailLevel(), ilBlockGUI\getData(), getDynamicReload(), getOverview(), and ilBlockGUI\setDataSection().

225  {
226  if ($this->dynamic)
227  {
228  $this->setDataSection($this->getDynamicReload());
229  }
230  else if ($this->getCurrentDetailLevel() > 1 && count($this->getData()) > 0)
231  {
232  parent::fillDataSection();
233  }
234  else
235  {
236  $this->setDataSection($this->getOverview());
237  }
238  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
getData()
Get Data.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillFooter()

ilNewsForContextBlockGUI::fillFooter ( )

block footer

Definition at line 868 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $ilUser, $lng, and showViewFooter().

869  {
870  global $ilCtrl, $lng, $ilUser;
871 
872  parent::fillFooter();
873 
874  if ($this->show_view_selection)
875  {
876  $this->showViewFooter();
877  }
878  }
global $ilCtrl
Definition: ilias.php:18
showViewFooter()
Show additional footer for show/hide notifications.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ fillRow()

ilNewsForContextBlockGUI::fillRow (   $news)

get flat bookmark list for personal desktop

Definition at line 392 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNewsItem\determineNewsTitle(), ilDatePresentation\formatDate(), ilBlockGUI\getCurrentDetailLevel(), IL_CAL_DATETIME, and ilUtil\shortenWords().

393  {
394  global $ilUser, $ilCtrl, $lng;
395 
396  if ($this->getCurrentDetailLevel() > 2)
397  {
398  $this->tpl->setCurrentBlock("long");
399  //$this->tpl->setVariable("VAL_CONTENT", $news["content"]);
400  $this->tpl->setVariable("VAL_CREATION_DATE",
401  ilDatePresentation::formatDate(new ilDateTime($news["creation_date"],IL_CAL_DATETIME)));
402  $this->tpl->parseCurrentBlock();
403  }
404 
405  // notification
406  if ($news["priority"] == 0)
407  {
408 /*
409  $this->tpl->setCurrentBlock("notification");
410  $this->tpl->setVariable("CHAR_NOT", $lng->txt("news_first_letter_of_word_notification"));
411  $this->tpl->parseCurrentBlock();
412 */
413  }
414 
415 
416  // title image type
417  if ($news["ref_id"] > 0)
418  {
419  if ($news["agg_ref_id"] > 0)
420  {
421  $obj_id = ilObject::_lookupObjId($news["agg_ref_id"]);
422  $type = ilObject::_lookupType($obj_id);
423  $context_ref = $news["agg_ref_id"];
424  }
425  else
426  {
427  $obj_id = $news["context_obj_id"];
428  $type = $news["context_obj_type"];
429  $context_ref = $news["ref_id"];
430  }
431 
432  $lang_type = in_array($type, array("sahs", "lm", "dbk", "htlm"))
433  ? "lres"
434  : "obj_".$type;
435 
436  $this->tpl->setCurrentBlock("news_context");
437  $this->tpl->setVariable("TYPE", $lng->txt($lang_type));
438  $this->tpl->setVariable("IMG_TYPE",
439  ilObject::_getIcon($obj_id, "tiny", $type));
440  $this->tpl->setVariable("TITLE",
442  if ($news["user_read"] > 0)
443  {
444  $this->tpl->setVariable("TITLE_CLASS", 'class="light"');
445  }
446 
447  $this->tpl->parseCurrentBlock();
448  $ilCtrl->setParameter($this, "news_context", $context_ref);
449  }
450  else
451  {
452  $ilCtrl->setParameter($this, "news_context", "");
453  }
454 
455  // title
456  $this->tpl->setVariable("VAL_TITLE",
458  ($news["context_obj_type"], $news["title"], $news["content_is_lang_var"],
459  $news["agg_ref_id"], $news["aggregation"])));
460 
461 
462  if ($news["user_read"] > 0)
463  {
464  $this->tpl->setVariable("A_CLASS", 'class="light"');
465  }
466 
467  $ilCtrl->setParameter($this, "news_id", $news["id"]);
468  $this->tpl->setVariable("HREF_SHOW",
469  $ilCtrl->getLinkTarget($this, "showNews"));
470  $ilCtrl->clearParameters($this);
471  }
static determineNewsTitle($a_context_obj_type, $a_title, $a_content_is_lang_var, $a_agg_ref_id=0, $a_aggregation="")
Determine title for news item entry.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static shortenWords($a_str, $a_len=30, $a_dots=true)
Ensure that the maximum word lenght within a text is not longer than $a_len.
const IL_CAL_DATETIME
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getBlockType()

static ilNewsForContextBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 132 of file class.ilNewsForContextBlockGUI.php.

Referenced by getDynamicReload(), getHTML(), getJSEnabler(), handleView(), hideNotifications(), initSettingsForm(), saveSettings(), and showNotifications().

133  {
134  return self::$block_type;
135  }
+ Here is the caller graph for this function:

◆ getDynamic()

ilNewsForContextBlockGUI::getDynamic ( )

Definition at line 1203 of file class.ilNewsForContextBlockGUI.php.

References $_SESSION, $ilCtrl, and $ilUser.

Referenced by ilNewsForContextBlockGUI(), and ilPDNewsBlockGUI\ilPDNewsBlockGUI().

1204  {
1205  global $ilCtrl, $ilUser;
1206 
1207  if ($ilCtrl->getCmd() == "hideNotifications" ||
1208  $ilCtrl->getCmd() == "showNotifications")
1209  {
1210  return false;
1211  }
1212 
1213  if ($ilCtrl->getCmdClass() != "ilcolumngui" && $ilCtrl->getCmd() != "enableJS")
1214  {
1215  $sess_feed_js = "";
1216  if (isset($_SESSION["il_feed_js"]))
1217  {
1218  $sess_feed_js = $_SESSION["il_feed_js"];
1219  }
1220 
1221  if ($sess_feed_js != "n" &&
1222  ($ilUser->getPref("il_feed_js") != "n" || $sess_feed_js == "y"))
1223  {
1224  // do not get feed dynamically, if cache hit is given.
1225 // if (!$this->feed->checkCacheHit())
1226 // {
1227  return true;
1228 // }
1229  }
1230  }
1231 
1232  return false;
1233  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getDynamicReload()

ilNewsForContextBlockGUI::getDynamicReload ( )

Definition at line 1235 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, ilBlockGUI\getBlockId(), and getBlockType().

Referenced by ilPDNewsBlockGUI\fillDataSection(), and fillDataSection().

1236  {
1237  global $ilCtrl, $lng;
1238 
1239  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
1240  "block_".$this->getBlockType()."_".$this->getBlockId());
1241 
1242  $rel_tpl = new ilTemplate("tpl.dynamic_reload.html", true, true, "Services/News");
1243  $rel_tpl->setVariable("TXT_LOADING", $lng->txt("news_loading_news"));
1244  $rel_tpl->setVariable("BLOCK_ID", "block_".$this->getBlockType()."_".$this->getBlockId());
1245  $rel_tpl->setVariable("TARGET",
1246  $ilCtrl->getLinkTargetByClass("ilcolumngui", "updateBlock", "", true));
1247 
1248  // no JS
1249  $rel_tpl->setVariable("TXT_NEWS_CLICK_HERE", $lng->txt("news_no_js_click_here"));
1250  $rel_tpl->setVariable("TARGET_NO_JS",
1251  $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), "disableJS"));
1252 
1253  return $rel_tpl->get();
1254  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilNewsForContextBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

Definition at line 216 of file class.ilNewsForContextBlockGUI.php.

Referenced by executeCommand(), and getHTML().

217  {
218  return $this->enable_edit;
219  }
+ Here is the caller graph for this function:

◆ getHTML()

ilNewsForContextBlockGUI::getHTML ( )

Get bloch HTML code.

Definition at line 243 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, ilBlockSetting\_lookup(), ilBlockGUI\addBlockCommand(), getBlockType(), ilBlockGUI\getData(), getEnableEdit(), ilUtil\getImagePath(), ilBlockGUI\getProperty(), ilBlockGUI\getRepositoryMode(), ilBlockGUI\setFooterInfo(), and ilBlockGUI\setTitle().

Referenced by enableJS(), hideNotifications(), and showNotifications().

244  {
245  global $ilCtrl, $lng, $ilUser;
246 
247  $news_set = new ilSetting("news");
248  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
249 
250  $hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
251  0, $this->block_id);
252  if ($hide_block)
253  {
254  $this->setFooterInfo($lng->txt("news_hidden_news_block"));
255  }
256 
257  if ($this->getProperty("title") != "")
258  {
259  $this->setTitle($this->getProperty("title"));
260  }
261 
262  $public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
263  0, $this->block_id);
264  if ($public_feed)
265  {
266  if ($enable_internal_rss)
267  {
268  $this->addBlockCommand(
269  ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&".
270  "ref_id=".$_GET["ref_id"],
271  $lng->txt("news_feed_url"), "_blank",
272  ilUtil::getImagePath("rss.png"));
273  }
274  }
275 
276 /* Subscription Concept is abandonded for now (Alex)
277  // subscribe/unsibscribe link
278  include_once("./Services/News/classes/class.ilNewsSubscription.php");
279  if (ilNewsSubscription::_hasSubscribed($_GET["ref_id"], $ilUser->getId()))
280  {
281  $this->addBlockCommand(
282  $ilCtrl->getLinkTarget($this, "unsubscribeNews"),
283  $lng->txt("news_unsubscribe"));
284  }
285  else
286  {
287  $this->addBlockCommand(
288  $ilCtrl->getLinkTarget($this, "subscribeNews"),
289  $lng->txt("news_subscribe"));
290  }
291 */
292 
293  // add edit commands
294  if ($this->getEnableEdit())
295  {
296  $this->addBlockCommand(
297  $ilCtrl->getLinkTargetByClass("ilnewsitemgui", "editNews"),
298  $lng->txt("edit"));
299 
300  $ilCtrl->setParameter($this, "add_mode", "block");
301  $this->addBlockCommand(
302  $ilCtrl->getLinkTargetByClass("ilnewsitemgui", "createNewsItem"),
303  $lng->txt("add"));
304  $ilCtrl->setParameter($this, "add_mode", "");
305  }
306 
307  if ($this->getProperty("settings") == true)
308  {
309  $this->addBlockCommand(
310  $ilCtrl->getLinkTarget($this, "editSettings"),
311  $lng->txt("settings"));
312  }
313 
314  // do not display hidden repository news blocks for users
315  // who do not have write permission
316  if (!$this->getEnableEdit() && $this->getRepositoryMode() &&
317  ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
318  0, $this->block_id))
319  {
320  return "";
321  }
322 
323  // do not display empty news blocks for users
324  // who do not have write permission
325  if (count($this->getData()) == 0 && !$this->getEnableEdit() &&
326  $this->getRepositoryMode() && !$this->dynamic
327  && (!$news_set->get("enable_rss_for_internal") ||
328  !ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
329  0, $this->block_id)))
330  {
331  return "";
332  }
333 
334  $en = "";
335  if ($ilUser->getPref("il_feed_js") == "n")
336  {
337 // $en = getJSEnabler();
338  }
339 
340  return parent::getHTML().$en;
341  }
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
Add Block Command.
ILIAS Setting Class.
$_GET["client_id"]
setFooterInfo($a_footerinfo, $a_hide_and_icon=false)
Set Footer Info.
getRepositoryMode()
Get RepositoryMode.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
getData()
Get Data.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
getProperty($a_property)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJSEnabler()

ilNewsForContextBlockGUI::getJSEnabler ( )

Definition at line 1256 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $lng, ilBlockGUI\getBlockId(), and getBlockType().

Referenced by ilPDNewsBlockGUI\getHTML().

1257  {
1258  global $ilCtrl, $lng;
1259 
1260  $ilCtrl->setParameterByClass("ilcolumngui", "block_id",
1261  "block_".$this->getBlockType()."_".$this->getBlockId());
1262 //echo "hh";
1263  $rel_tpl = new ilTemplate("tpl.js_enabler.html", true, true, "Services/News");
1264  $rel_tpl->setVariable("BLOCK_ID", "block_".$this->getBlockType()."_".$this->getBlockId());
1265  $rel_tpl->setVariable("TARGET",
1266  $ilCtrl->getLinkTargetByClass(strtolower(get_class($this)), "enableJS", true, "", false));
1267 
1268  return $rel_tpl->get();
1269  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getBlockId()
Get Block Id.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewsData()

ilNewsForContextBlockGUI::getNewsData ( )

Get news for context.

Definition at line 86 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, and $ilUser.

Referenced by hideNotifications(), ilNewsForContextBlockGUI(), showNews(), and showNotifications().

87  {
88  global $ilCtrl, $ilUser;
89 
90  include_once("./Services/News/classes/class.ilNewsCache.php");
91  $this->acache = new ilNewsCache();
92 /* $cres = $this->acache->getEntry($ilUser->getId().":".$_GET["ref_id"]);
93  if ($this->acache->getLastAccessStatus() == "hit" && false)
94  {
95  $news_data = unserialize($cres);
96  }
97  else
98  {*/
99  $news_item = new ilNewsItem();
100  $news_item->setContextObjId($ilCtrl->getContextObjId());
101  $news_item->setContextObjType($ilCtrl->getContextObjType());
102 
103  // workaround, better: reduce constructor and introduce
104  //$prevent_aggregation = $this->getProperty("prevent_aggregation");
105  $prevent_aggregation = true;
106  if ($ilCtrl->getContextObjType() != "frm")
107  {
108  $forum_grouping = true;
109  }
110  else
111  {
112  $forum_grouping = false;
113  }
114 
115 
116  $news_data = $news_item->getNewsForRefId($_GET["ref_id"], false, false, 0,
117  $prevent_aggregation, $forum_grouping);
118 
119  $this->acache->storeEntry($ilUser->getId().":".$_GET["ref_id"],
120  serialize($news_data));
121 
122 // }
123 //var_dump($news_data);
124  return $news_data;
125  }
$_GET["client_id"]
News cache.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getOverview()

ilNewsForContextBlockGUI::getOverview ( )

Get overview.

Definition at line 476 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $ilUser, $lng, and ilBlockGUI\getData().

Referenced by ilPDNewsBlockGUI\fillDataSection(), and fillDataSection().

477  {
478  global $ilUser, $lng, $ilCtrl;
479 
480  return '<div class="small">'.((int) count($this->getData()))." ".$lng->txt("news_news_items")."</div>";
481  }
global $ilCtrl
Definition: ilias.php:18
getData()
Get Data.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilNewsForContextBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 150 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, IL_SCREEN_CENTER, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

151  {
152  global $ilCtrl;
153 
154  if ($ilCtrl->getCmdClass() == "ilnewsitemgui")
155  {
156  return IL_SCREEN_FULL;
157  }
158 
159  switch($ilCtrl->getCmd())
160  {
161  case "showNews":
162  case "showFeedUrl":
163  return IL_SCREEN_CENTER;
164  break;
165 
166  case "editSettings":
167  case "saveSettings":
168  return IL_SCREEN_FULL;
169  break;
170 
171  default:
172  return IL_SCREEN_SIDE;
173  break;
174  }
175  }
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_FULL
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE

◆ handleView()

ilNewsForContextBlockGUI::handleView ( )

Handles show/hide notification view and removes notifications if hidden.

Definition at line 346 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, $ilUser, $row, ilBlockSetting\_lookup(), and getBlockType().

Referenced by hideNotifications(), ilNewsForContextBlockGUI(), ilPDNewsBlockGUI\ilPDNewsBlockGUI(), and showNotifications().

347  {
348  global $ilUser;
349 
350  include_once("Services/Block/classes/class.ilBlockSetting.php");
351  $this->view = ilBlockSetting::_lookup($this->getBlockType(), "view",
352  $ilUser->getId(), $this->block_id);
353 
354  // check whether notices and messages exist
355  $got_notices = $got_messages = false;
356  foreach($this->data as $row)
357  {
358  if ($row["priority"] == 0) $got_notices = true;
359  if ($row["priority"] == 1) $got_messages = true;
360  }
361  $this->show_view_selection = false;
362 
363  if ($got_notices && $got_messages)
364  {
365  $this->show_view_selection = true;
366  }
367  else if ($got_notices)
368  {
369  $this->view = "";
370  }
371 
372  // remove notifications if hidden
373 /*
374  if (($this->view == "hide_notifications") && $this->show_view_selection)
375  {
376  $rset = array();
377  foreach($this->data as $k => $row)
378  {
379  if ($row["priority"] == 1)
380  {
381  $rset[$k] = $row;
382  }
383  }
384  $this->data = $rset;
385  }
386 */
387  }
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hideNotifications()

ilNewsForContextBlockGUI::hideNotifications ( )

Definition at line 942 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, ilBlockGUI\$data, $ilCtrl, $ilUser, ilBlockSetting\_write(), exit, getBlockType(), getHTML(), getNewsData(), handleView(), and ilBlockGUI\setData().

943  {
944  global $ilCtrl, $ilUser;
945 
946  include_once("Services/Block/classes/class.ilBlockSetting.php");
947  $view = ilBlockSetting::_write($this->getBlockType(), "view", "hide_notifications",
948  $ilUser->getId(), $this->block_id);
949 
950  // reload data
951  $data = $this->getNewsData();
952  $this->setData($data);
953  $this->handleView();
954 
955  if ($ilCtrl->isAsynch())
956  {
957  echo $this->getHTML();
958  exit;
959  }
960  else
961  {
962  $ilCtrl->returnToParent($this);
963  }
964  }
exit
Definition: login.php:54
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
handleView()
Handles show/hide notification view and removes notifications if hidden.
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ ilNewsForContextBlockGUI()

ilNewsForContextBlockGUI::ilNewsForContextBlockGUI ( )

Constructor.

Definition at line 26 of file class.ilNewsForContextBlockGUI.php.

References $_GET, ilBlockGUI\$data, $ilCtrl, $ilUser, $lng, ilBlockGUI\getCurrentDetailLevel(), getDynamic(), ilUtil\getImagePath(), getNewsData(), handleView(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setBlockId(), ilBlockGUI\setData(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), ilBlockGUI\setRowTemplate(), and ilBlockGUI\setTitle().

27  {
28  global $ilCtrl, $lng, $ilUser, $ilHelp;
29 
30  parent::ilBlockGUI();
31 
32  $this->setImage(ilUtil::getImagePath("icon_news_s.png"));
33 
34  $lng->loadLanguageModule("news");
35  $ilHelp->addHelpSection("news_block");
36 
37  include_once("./Services/News/classes/class.ilNewsItem.php");
38  $this->setBlockId($ilCtrl->getContextObjId());
39  $this->setLimit(5);
40  $this->setAvailableDetailLevels(3);
41  $this->setEnableNumInfo(true);
42 
43  $this->dynamic = false;
44  include_once("./Services/News/classes/class.ilNewsCache.php");
45  $this->acache = new ilNewsCache();
46  $cres = $this->acache->getEntry($ilUser->getId().":".$_GET["ref_id"]);
47  $this->cache_hit = false;
48 
49  if ($this->acache->getLastAccessStatus() == "hit")
50  {
51  self::$st_data = unserialize($cres);
52  $this->cache_hit = true;
53  }
54  if ($this->getDynamic() && !$this->cache_hit)
55  {
56  $this->dynamic = true;
57  $data = array();
58  }
59  else if ($this->getCurrentDetailLevel() > 0)
60  {
61  if (!empty(self::$st_data))
62  {
63  $data = self::$st_data;
64  }
65  else
66  {
67  $data = $this->getNewsData();
68  self::$st_data = $data;
69  }
70  }
71  else
72  {
73  $data = array();
74  }
75 
76  $this->setTitle($lng->txt("news_internal_news"));
77  $this->setRowTemplate("tpl.block_row_news_for_context.html", "Services/News");
78  $this->setData($data);
79  $this->allow_moving = false;
80  $this->handleView();
81  }
handleView()
Handles show/hide notification view and removes notifications if hidden.
$_GET["client_id"]
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
News cache.
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setData($a_data)
Set Data.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ initSettingsForm()

ilNewsForContextBlockGUI::initSettingsForm ( )

Init setting form.

Definition at line 978 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilSetting, $ilUser, $lng, ilNewsItem\_getDefaultVisibilityForRefId(), ilBlockSetting\_lookup(), getBlockType(), ilUtil\getImagePath(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, ilDateTimeInputGUI\setDate(), ilRadioOption\setInfo(), and ilFormPropertyGUI\setInfo().

Referenced by editSettings(), and saveSettings().

979  {
980  global $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
981 
982  $ilTabs->clearTargets();
983 
984  $news_set = new ilSetting("news");
985  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
986 
987  $public = ilBlockSetting::_lookup($this->getBlockType(), "public_notifications",
988  0, $this->block_id);
989  $public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed",
990  0, $this->block_id);
991  $hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block",
992  0, $this->block_id);
993  $hide_news_per_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_per_date",
994  0, $this->block_id);
995  $hide_news_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_date",
996  0, $this->block_id);
997 
998  if ($hide_news_date != "")
999  {
1000  $hide_news_date = explode(" ", $hide_news_date);
1001  }
1002 
1003  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1004  $this->settings_form = new ilPropertyFormGUI();
1005  $this->settings_form->setTitle($lng->txt("news_settings"));
1006  $this->settings_form->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
1007 
1008  // hide news block for learners
1009  if ($this->getProperty("hide_news_block_option"))
1010  {
1011  $ch = new ilCheckboxInputGUI($lng->txt("news_hide_news_block"),
1012  "hide_news_block");
1013  $ch->setInfo($lng->txt("news_hide_news_block_info"));
1014  $ch->setChecked($hide_block);
1015  $this->settings_form->addItem($ch);
1016 
1017  $hnpd = new ilCheckboxInputGUI($lng->txt("news_hide_news_per_date"),
1018  "hide_news_per_date");
1019  $hnpd->setInfo($lng->txt("news_hide_news_per_date_info"));
1020  $hnpd->setChecked($hide_news_per_date);
1021 
1022  $dt_prop = new ilDateTimeInputGUI($lng->txt("news_hide_news_date"),
1023  "hide_news_date");
1024  if ($hide_news_date != "")
1025  {
1026  $dt_prop->setDate(new ilDateTime($hide_news_date[0].' '.$hide_news_date[1],IL_CAL_DATETIME));
1027  }
1028  #$dt_prop->setDate($hide_news_date[0]);
1029  #$dt_prop->setTime($hide_news_date[1]);
1030  $dt_prop->setShowTime(true);
1031  //$dt_prop->setInfo($lng->txt("news_hide_news_date_info"));
1032  $hnpd->addSubItem($dt_prop);
1033 
1034  $this->settings_form->addItem($hnpd);
1035 
1036  }
1037 
1038  // default visibility
1039  if ($this->getProperty("default_visibility_option") &&
1040  $enable_internal_rss)
1041  {
1042  $default_visibility = ilBlockSetting::_lookup($this->getBlockType(), "default_visibility",
1043  0, $this->block_id);
1044  if ($default_visibility == "")
1045  {
1046  $default_visibility =
1048  }
1049 
1050  // Default Visibility
1051  $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "default_visibility");
1052  $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
1053  $radio_group->addOption($radio_option);
1054  $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
1055  $radio_group->addOption($radio_option);
1056  $radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
1057  $radio_group->setRequired(false);
1058  $radio_group->setValue($default_visibility);
1059  $this->settings_form->addItem($radio_group);
1060  }
1061 
1062  // public notifications
1063  if ($this->getProperty("public_notifications_option") &&
1064  $enable_internal_rss)
1065  {
1066  $ch = new ilCheckboxInputGUI($lng->txt("news_notifications_public"),
1067  "notifications_public");
1068  $ch->setInfo($lng->txt("news_notifications_public_info"));
1069  $ch->setChecked($public);
1070  $this->settings_form->addItem($ch);
1071  }
1072 
1073  // extra rss feed
1074  if ($enable_internal_rss)
1075  {
1076  $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"),
1077  "notifications_public_feed");
1078  $ch->setInfo($lng->txt("news_public_feed_info"));
1079  $ch->setChecked($public_feed);
1080  $this->settings_form->addItem($ch);
1081  }
1082 
1083 
1084  //$this->settings_form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed",
1085  // "1", $public_feed, $lng->txt("news_public_feed_info"));
1086  //if ($this->getProperty("public_notifications_option"))
1087  //{
1088  // $this->settings_form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public",
1089  // "1", $public, $lng->txt("news_notifications_public_info"));
1090  //}
1091  $this->settings_form->addCommandButton("saveSettings", $lng->txt("save"));
1092  $this->settings_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
1093  $this->settings_form->setFormAction($ilCtrl->getFormaction($this));
1094  }
This class represents an option in a radio group.
ILIAS Setting Class.
const IL_CAL_DATETIME
This class represents a property form user interface.
$_GET["client_id"]
This class represents a checkbox property in a property form.
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
setInfo($a_info)
Set Info.
This class represents a date/time property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
Date and time handling
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
static _getDefaultVisibilityForRefId($a_ref_id)
Get default visibility for reference id.
getProperty($a_property)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilNewsForContextBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

Definition at line 142 of file class.ilNewsForContextBlockGUI.php.

143  {
144  return false;
145  }

◆ makeClickable()

ilNewsForContextBlockGUI::makeClickable (   $a_str)

Make clickable.

Parameters

Definition at line 828 of file class.ilNewsForContextBlockGUI.php.

References ilUtil\makeClickable().

Referenced by showNews().

829  {
830  // this fixes bug 8744. We assume that strings that contain < and >
831  // already contain html, we do not handle these
832  if (is_int(strpos($a_str, ">")) && is_int(strpos($a_str, "<")))
833  {
834  return $a_str;
835  }
836 
837  return ilUtil::makeClickable($a_str);
838  }
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:

◆ saveSettings()

ilNewsForContextBlockGUI::saveSettings ( )

Save settings.

Definition at line 1109 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $_POST, ilBlockGUI\$block_id, $ilCtrl, $ilUser, ilBlockSetting\_write(), getBlockType(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, and initSettingsForm().

1110  {
1111  global $ilCtrl, $ilUser;
1112 
1113  $this->initSettingsForm();
1114 
1115  if ($this->settings_form->checkInput())
1116  {
1117  $news_set = new ilSetting("news");
1118  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1119 
1120  if ($enable_internal_rss)
1121  {
1122  ilBlockSetting::_write($this->getBlockType(), "public_notifications", $_POST["notifications_public"],
1123  0, $this->block_id);
1124  ilBlockSetting::_write($this->getBlockType(), "public_feed", $_POST["notifications_public_feed"],
1125  0, $this->block_id);
1126  ilBlockSetting::_write($this->getBlockType(), "default_visibility", $_POST["default_visibility"],
1127  0, $this->block_id);
1128  }
1129 
1130  if ($this->getProperty("hide_news_block_option"))
1131  {
1132  ilBlockSetting::_write($this->getBlockType(), "hide_news_block", $_POST["hide_news_block"],
1133  0, $this->block_id);
1134  ilBlockSetting::_write($this->getBlockType(), "hide_news_per_date", $_POST["hide_news_per_date"],
1135  0, $this->block_id);
1136 
1137  // hide date
1138  $hd = $this->settings_form->getInput("hide_news_date");
1139  $hide_date = new ilDateTime($hd["date"]." ".
1140  $hd["time"],IL_CAL_DATETIME,$ilUser->getTimeZone());
1141  ilBlockSetting::_write($this->getBlockType(), "hide_news_date",
1142  $hide_date->get(IL_CAL_DATETIME),
1143  0, $this->block_id);
1144  }
1145 
1146  include_once("./Services/News/classes/class.ilNewsCache.php");
1147  $cache = new ilNewsCache();
1148  $cache->deleteEntry($ilUser->getId().":".$_GET["ref_id"]);
1149 
1150  $ilCtrl->returnToParent($this);
1151  }
1152  else
1153  {
1154  $this->settings_form->setValuesByPost();
1155  return $this->settings_form->getHtml();
1156  }
1157  }
ILIAS Setting Class.
$_POST['username']
Definition: cron.php:12
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
const IL_CAL_DATETIME
$_GET["client_id"]
News cache.
global $ilCtrl
Definition: ilias.php:18
Date and time handling
global $ilUser
Definition: imgupload.php:15
getProperty($a_property)
+ Here is the call graph for this function:

◆ setEnableEdit()

ilNewsForContextBlockGUI::setEnableEdit (   $a_enable_edit = 0)

Set EnableEdit.

Parameters
boolean$a_enable_editEdit mode on/off

Definition at line 206 of file class.ilNewsForContextBlockGUI.php.

207  {
208  $this->enable_edit = $a_enable_edit;
209  }

◆ showFeedUrl()

ilNewsForContextBlockGUI::showFeedUrl ( )

Show feed URL.

Definition at line 1162 of file class.ilNewsForContextBlockGUI.php.

References $ilCtrl, $ilUser, $lng, $tpl, ilObject\_lookupTitle(), and ilUtil\getImagePath().

1163  {
1164  global $lng, $ilCtrl, $ilUser;
1165 
1166  include_once("./Services/News/classes/class.ilNewsItem.php");
1167 
1168  $title = ilObject::_lookupTitle($this->block_id);
1169 
1170  $tpl = new ilTemplate("tpl.show_feed_url.html", true, true, "Services/News");
1171  $tpl->setVariable("TXT_TITLE",
1172  sprintf($lng->txt("news_feed_url_for"), $title));
1173  $tpl->setVariable("TXT_INFO", $lng->txt("news_get_feed_info"));
1174  $tpl->setVariable("TXT_FEED_URL", $lng->txt("news_feed_url"));
1175  $tpl->setVariable("VAL_FEED_URL",
1176  ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&user_id=".$ilUser->getId().
1177  "&obj_id=".$this->block_id.
1178  "&hash=".ilObjUser::_lookupFeedHash($ilUser->getId(), true));
1179  $tpl->setVariable("VAL_FEED_URL_TXT",
1180  ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&<br />user_id=".$ilUser->getId().
1181  "&obj_id=".$this->block_id.
1182  "&hash=".ilObjUser::_lookupFeedHash($ilUser->getId(), true));
1183 
1184  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
1185  $content_block = new ilPDContentBlockGUI();
1186  $content_block->setContent($tpl->get());
1187  $content_block->setTitle($lng->txt("news_internal_news"));
1188  $content_block->setImage(ilUtil::getImagePath("icon_news.png"));
1189  $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
1190  $lng->txt("close"), true);
1191 
1192  return $content_block->getHTML();
1193  }
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

◆ showNews()

ilNewsForContextBlockGUI::showNews ( )

show news

Definition at line 486 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilUser, $lng, $tpl, ilObject\_exists(), ilObject\_getIcon(), ilObjMediaObject\_getURL(), ilBlockSetting\_lookup(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilNewsItem\_setRead(), addCloseCommand(), ilNewsItem\determineNewsContent(), ilNewsItem\determineNewsTitle(), ilDatePresentation\formatDate(), ilBlockGUI\getData(), ilUtil\getImagePath(), getNewsData(), ilBlockGUI\getProperty(), IL_CAL_DATETIME, ilWikiPage\lookupTitle(), makeClickable(), NEWS_AUDIO, NEWS_PUBLIC, and ilBlockGUI\setData().

487  {
488  global $lng, $ilCtrl, $ilUser;
489 
490 // workaround for dynamic mode (if cache is disabled, showNews has no data)
491 if (empty(self::$st_data))
492 {
493  $this->setData($this->getNewsData());
494 }
495 
496  $news_set = new ilSetting("news");
497  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
498 
499  include_once("./Services/News/classes/class.ilNewsItem.php");
500  $news = new ilNewsItem($_GET["news_id"]);
501 
502  $tpl = new ilTemplate("tpl.show_news.html", true, true, "Services/News");
503 
504  // get current item in data set
505  $previous = $next = "";
506  reset($this->data);
507  $c = current($this->data);
508  $curr_cnt = 1;
509 
510  while($c["id"] > 0 &&
511  $c["id"] != $_GET["news_id"])
512  {
513  $previous = $c;
514  $c = next($this->data);
515  $curr_cnt++;
516  }
517 
518  // collect news items to show
519  $news_list = array();
520  if (is_array($c["aggregation"])) // we have an aggregation
521  {
522  //$agg_obj_id = ilObject::_lookupObjId($c["agg_ref_id"]);
523  //$agg_obj_type = ilObject::_lookupType($agg_obj_id);
524  //$agg_obj_title = ilObject::_lookupObjId($agg_obj_id);
525  $news_list[] = array("ref_id" => $c["agg_ref_id"],
526  "agg_ref_id" => $c["agg_ref_id"],
527  "aggregation" => $c["aggregation"],
528  "user_id" => "",
529  "content_type" => "text",
530  "mob_id" => 0,
531  "visibility" => "",
532  "content" => "",
533  "content_long" => "",
534  "update_date" => $news->getUpdateDate(),
535  "creation_date" => "",
536  "content_is_lang_var" => false,
537  "loc_context" => $_GET["news_context"],
538  "context_obj_type" => $news->getContextObjType(),
539  "title" => "");
540 
541  foreach($c["aggregation"] as $c_item)
542  {
543  ilNewsItem::_setRead($ilUser->getId(), $c_item["id"]);
544  $c_item["loc_context"] = $c_item["ref_id"];
545  $c_item["loc_stop"] = $_GET["news_context"];
546  $news_list[] = $c_item;
547  }
548  }
549  else // no aggregation, simple news item
550  {
551  $news_list[] = array("ref_id" => $_GET["news_context"],
552  "user_id" => $news->getUserId(),
553  "content_type" => $news->getContentType(),
554  "mob_id" => $news->getMobId(),
555  "visibility" => $news->getVisibility(),
556  "priority" => $news->getPriority(),
557  "content" => $news->getContent(),
558  "content_long" => $news->getContentLong(),
559  "update_date" => $news->getUpdateDate(),
560  "creation_date" => $news->getCreationDate(),
561  "context_sub_obj_type" => $news->getContextSubObjType(),
562  "context_obj_type" => $news->getContextObjType(),
563  "context_sub_obj_id" => $news->getContextSubObjId(),
564  "content_is_lang_var" => $news->getContentIsLangVar(),
565  "content_text_is_lang_var" => $news->getContentTextIsLangVar(),
566  "loc_context" => $_GET["news_context"],
567  "title" => $news->getTitle());
568  ilNewsItem::_setRead($ilUser->getId(), $_GET["news_id"]);
569  }
570 
571  foreach ($news_list as $item)
572  {
573  // user
574  if ($item["user_id"] > 0 && ilObject::_exists($item["user_id"]))
575  {
576  // get login
577  if (ilObjUser::_exists($item["user_id"]))
578  {
579  $user = new ilObjUser($item["user_id"]);
580  $displayname = $user->getLogin();
581  } else
582  {
583  // this should actually not happen, since news entries
584  // should be deleted when the user is going to be removed
585  $displayname = "&lt;". strtolower($lng->txt("deleted")) ."&gt;";
586  }
587 
588  $tpl->setCurrentBlock("user_info");
589  $tpl->setVariable("VAL_AUTHOR", $displayname);
590  $tpl->setVariable("TXT_AUTHOR", $lng->txt("author"));
591  $tpl->parseCurrentBlock();
592  }
593 
594  // media player
595  if ($item["content_type"] == NEWS_AUDIO &&
596  $item["mob_id"] > 0 && ilObject::_exists($item["mob_id"]))
597  {
598  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
599  include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
600  $mob = new ilObjMediaObject($item["mob_id"]);
601  $med = $mob->getMediaItem("Standard");
602  $mpl = new ilMediaPlayerGUI();
603  if (strcasecmp("Reference", $med->getLocationType()) == 0)
604  $mpl->setFile($med->getLocation());
605  else
606  $mpl->setFile(ilObjMediaObject::_getURL($mob->getId())."/".$med->getLocation());
607  $mpl->setDisplayHeight($med->getHeight());
608  $tpl->setCurrentBlock("player");
609  $tpl->setVariable("PLAYER",
610  $mpl->getMp3PlayerHtml());
611  $tpl->parseCurrentBlock();
612  }
613 
614  // access
615  if ($enable_internal_rss && $item["visibility"] != "")
616  {
617  $obj_id = ilObject::_lookupObjId($item["ref_id"]);
618  $tpl->setCurrentBlock("access");
619  $tpl->setVariable("TXT_ACCESS", $lng->txt("news_news_item_visibility"));
620  if ($item["visibility"] == NEWS_PUBLIC ||
621  ($item["priority"] == 0 &&
622  ilBlockSetting::_lookup("news", "public_notifications",
623  0, $obj_id)))
624  {
625  $tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_public"));
626  }
627  else
628  {
629  $tpl->setVariable("VAL_ACCESS", $lng->txt("news_visibility_users"));
630  }
631  $tpl->parseCurrentBlock();
632  }
633 
634  // content
635  if (trim($item["content"]) != "") // content
636  {
637  $tpl->setCurrentBlock("content");
638  $tpl->setVariable("VAL_CONTENT",
639  nl2br($this->makeClickable(
640  ilNewsItem::determineNewsContent($item["context_obj_type"], $item["content"], $item["content_text_is_lang_var"])
641  )));
642 //$tpl->setVariable("VAL_CONTENT", nl2br($item["content"]));
643  $tpl->parseCurrentBlock();
644  }
645  if (trim($item["content_long"]) != "") // long content
646  {
647  $tpl->setCurrentBlock("long");
648  $tpl->setVariable("VAL_LONG_CONTENT", $this->makeClickable($item["content_long"]));
649  $tpl->parseCurrentBlock();
650  }
651  if ($item["update_date"] != $item["creation_date"]) // update date
652  {
653  $tpl->setCurrentBlock("ni_update");
654  $tpl->setVariable("TXT_LAST_UPDATE", $lng->txt("last_update"));
655  $tpl->setVariable("VAL_LAST_UPDATE",
656  ilDatePresentation::formatDate(new ilDateTime($item["update_date"],IL_CAL_DATETIME)));
657  $tpl->parseCurrentBlock();
658  }
659 
660  // creation date
661  if ($item["creation_date"] != "")
662  {
663  $tpl->setCurrentBlock("ni_update");
664  $tpl->setVariable("VAL_CREATION_DATE",
665  ilDatePresentation::formatDate(new ilDateTime($item["creation_date"],IL_CAL_DATETIME)));
666  $tpl->setVariable("TXT_CREATED", $lng->txt("created"));
667  $tpl->parseCurrentBlock();
668  }
669 
670 
671  // context / title
672  if ($_GET["news_context"] > 0)
673  {
674  //$obj_id = ilObject::_lookupObjId($_GET["news_context"]);
675  $obj_id = ilObject::_lookupObjId($item["ref_id"]);
676  $obj_type = ilObject::_lookupType($obj_id);
677  $obj_title = ilObject::_lookupTitle($obj_id);
678 
679  // file hack, not nice
680  if ($obj_type == "file")
681  {
682  $tpl->setCurrentBlock("download");
683  $tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
684  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $item["ref_id"]);
685  $tpl->setVariable("HREF_DOWNLOAD",
686  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "sendfile"));
687  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
688  $tpl->parseCurrentBlock();
689  }
690 
691  // forum hack, not nice
692  $add = "";
693  if ($obj_type == "frm" && $item["context_sub_obj_type"] == "pos"
694  && $item["context_sub_obj_id"] > 0)
695  {
696  include_once("./Modules/Forum/classes/class.ilObjForumAccess.php");
697  $pos = $item["context_sub_obj_id"];
698  $thread = ilObjForumAccess::_getThreadForPosting($pos);
699  if ($thread > 0)
700  {
701  $add = "_".$thread."_".$pos;
702  }
703  }
704 
705  // wiki hack, not nice
706  if ($obj_type == "wiki" && $item["context_sub_obj_type"] == "wpg"
707  && $item["context_sub_obj_id"] > 0)
708  {
709  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
710  $wptitle = ilWikiPage::lookupTitle($item["context_sub_obj_id"]);
711  if ($wptitle != "")
712  {
713  $add = "_".ilWikiUtil::makeUrlTitle($wptitle);
714  }
715  }
716 
717  $url_target = "./goto.php?client_id=".rawurlencode(CLIENT_ID)."&target=".
718  $obj_type."_".$item["ref_id"].$add;
719 
720  // lm page hack, not nice
721  if (in_array($obj_type, array("dbk", "lm")) && $item["context_sub_obj_type"] == "pg"
722  && $item["context_sub_obj_id"] > 0)
723  {
724  $url_target = "./goto.php?client_id=".rawurlencode(CLIENT_ID)."&target=".
725  "pg_".$item["context_sub_obj_id"]."_".$item["ref_id"];
726  }
727 
728 
729  $context_opened = false;
730  if ($item["loc_context"] != null && $item["loc_context"] != $item["loc_stop"])
731  {
732 
733  $tpl->setCurrentBlock("context");
734  $context_opened = true;
735  $cont_loc = new ilLocatorGUI();
736  $cont_loc->addContextItems($item["loc_context"], true, $item["loc_stop"]);
737  $tpl->setVariable("CONTEXT_LOCATOR", $cont_loc->getHTML());
738  }
739 
740 //var_dump($item);
741  if ($item["no_context_title"] !== true)
742  {
743  if (!$context_opened)
744  {
745  $tpl->setCurrentBlock("context");
746  }
747  $tpl->setVariable("HREF_CONTEXT_TITLE", $url_target);
748  $tpl->setVariable("CONTEXT_TITLE", $obj_title);
749  $tpl->setVariable("IMG_CONTEXT_TITLE", ilObject::_getIcon($obj_id, "big", $obj_type));
750  }
751  if ($context_opened)
752  {
753  $tpl->parseCurrentBlock();
754  }
755 
756  $tpl->setVariable("HREF_TITLE", $url_target);
757  }
758 
759  // title
760  $tpl->setVariable("VAL_TITLE",
761  ilNewsItem::determineNewsTitle($item["context_obj_type"],
762  $item["title"], $item["content_is_lang_var"], $item["agg_ref_id"],
763  $item["aggregation"]));
764 
765  $row_css = ($row_css != "tblrow1")
766  ? "tblrow1"
767  : "tblrow2";
768 
769  $tpl->setCurrentBlock("item");
770  $tpl->setVariable("ITEM_ROW_CSS", $row_css);
771  $tpl->parseCurrentBlock();
772  }
773 
774  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
775  $content_block = new ilPDContentBlockGUI();
776  $content_block->setContent($tpl->get());
777  if ($this->getProperty("title") != "")
778  {
779  $content_block->setTitle($this->getProperty("title"));
780  }
781  else
782  {
783  $content_block->setTitle($lng->txt("news_internal_news"));
784  }
785  //$content_block->setColSpan(2);
786  $content_block->setImage(ilUtil::getImagePath("icon_news.png"));
787  $this->addCloseCommand($content_block);
788 
789  // previous
790  if ($previous != "")
791  {
792  if ($previous["ref_id"] > 0)
793  {
794  $ilCtrl->setParameter($this, "news_context", $previous["ref_id"]);
795  }
796  $ilCtrl->setParameter($this, "news_id", $previous["id"]);
797  $content_block->addFooterLink($lng->txt("previous"),
798  $ilCtrl->getLinkTarget($this, "showNews"), "", "", true);
799  $ilCtrl->setParameter($this, "news_context", "");
800  }
801 
802  // next
803  if ($c = next($this->data))
804  {
805  if ($c["ref_id"] > 0)
806  {
807  $ilCtrl->setParameter($this, "news_context", $c["ref_id"]);
808  }
809  $ilCtrl->setParameter($this, "news_id", $c["id"]);
810  $content_block->addFooterLink($lng->txt("next"),
811  $ilCtrl->getLinkTarget($this, "showNews"), "", "", true);
812  }
813  $ilCtrl->setParameter($this, "news_context", "");
814  $ilCtrl->setParameter($this, "news_id", "");
815  $content_block->setCurrentItemNumber($curr_cnt);
816  $content_block->setEnableNumInfo(true);
817  $content_block->setData($this->getData());
818 
819  return $content_block->getHTML();
820  }
static determineNewsTitle($a_context_obj_type, $a_title, $a_content_is_lang_var, $a_agg_ref_id=0, $a_aggregation="")
Determine title for news item entry.
ILIAS Setting Class.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
const IL_CAL_DATETIME
_setRead($a_user_id, $a_news_id)
Set item read.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
locator handling class
global $ilCtrl
Definition: ilias.php:18
const NEWS_PUBLIC
_getURL($a_mob_id)
get directory for files of media object (static)
static determineNewsContent($a_context_obj_type, $a_content, $a_is_lang_var)
Determine new content.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setData($a_data)
Set Data.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
getData()
Get Data.
User interface for media player.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
BlockGUI class for (centered) Content on Personal Desktop.
const NEWS_AUDIO
getProperty($a_property)
+ Here is the call graph for this function:

◆ showNotifications()

ilNewsForContextBlockGUI::showNotifications ( )

Definition at line 918 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, ilBlockGUI\$data, $ilCtrl, $ilUser, ilBlockSetting\_write(), exit, getBlockType(), getHTML(), getNewsData(), handleView(), and ilBlockGUI\setData().

919  {
920  global $ilCtrl, $ilUser;
921 
922  include_once("Services/Block/classes/class.ilBlockSetting.php");
923  $view = ilBlockSetting::_write($this->getBlockType(), "view", "",
924  $ilUser->getId(), $this->block_id);
925 
926  // reload data
927  $data = $this->getNewsData();
928  $this->setData($data);
929  $this->handleView();
930 
931  if ($ilCtrl->isAsynch())
932  {
933  echo $this->getHTML();
934  exit;
935  }
936  else
937  {
938  $ilCtrl->returnToParent($this);
939  }
940  }
exit
Definition: login.php:54
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
handleView()
Handles show/hide notification view and removes notifications if hidden.
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ showViewFooter()

ilNewsForContextBlockGUI::showViewFooter ( )

Show additional footer for show/hide notifications.

Definition at line 883 of file class.ilNewsForContextBlockGUI.php.

References ilBlockGUI\$block_id, $ilCtrl, $ilUser, $lng, ilBlockGUI\addFooterLink(), ilBlockGUI\clearFooterLinks(), and ilBlockGUI\fillFooterLinks().

Referenced by fillFooter().

884  {
885  global $ilUser, $lng, $ilCtrl;
886 
887  return; // notifications always shown
888 
889  $this->clearFooterLinks();
890  $this->addFooterLink("[".$lng->txt("news_first_letter_of_word_notification")."] ".
891  $lng->txt("news_notifications").": ", "", "", "", false, true);
892  if ($this->view == "hide_notifications")
893  {
894  $this->addFooterLink($lng->txt("show"),
895  $ilCtrl->getLinkTarget($this,
896  "showNotifications"),
897  $ilCtrl->getLinkTarget($this,
898  "showNotifications", "", true),
899  "block_".$this->getBlockType()."_".$this->block_id
900  );
901  $this->addFooterLink($lng->txt("hide"));
902  }
903  else
904  {
905  $this->addFooterLink($lng->txt("show"));
906  $this->addFooterLink($lng->txt("hide"),
907  $ilCtrl->getLinkTarget($this,
908  "hideNotifications"),
909  $ilCtrl->getLinkTarget($this,
910  "hideNotifications", "", true),
911  "block_".$this->getBlockType()."_".$this->block_id
912  );
913  }
914 
915  $this->fillFooterLinks();
916  }
clearFooterLinks()
Clear footer links.
addFooterLink($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
Add a footer text/link.
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subscribeNews()

ilNewsForContextBlockGUI::subscribeNews ( )

Subscribe current user from news.

Definition at line 856 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilUser, and ilNewsSubscription\_subscribe().

857  {
858  global $ilUser, $ilCtrl;
859 
860  include_once("./Services/News/classes/class.ilNewsSubscription.php");
861  ilNewsSubscription::_subscribe($_GET["ref_id"], $ilUser->getId());
862  $ilCtrl->returnToParent($this);
863  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _subscribe($a_ref_id, $a_user_id)
Subscribe a user to an object (ref id).
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ unsubscribeNews()

ilNewsForContextBlockGUI::unsubscribeNews ( )

Unsubscribe current user from news.

Definition at line 844 of file class.ilNewsForContextBlockGUI.php.

References $_GET, $ilCtrl, $ilUser, and ilNewsSubscription\_unsubscribe().

845  {
846  global $ilUser, $ilCtrl;
847 
848  include_once("./Services/News/classes/class.ilNewsSubscription.php");
849  ilNewsSubscription::_unsubscribe($_GET["ref_id"], $ilUser->getId());
850  $ilCtrl->returnToParent($this);
851  }
$_GET["client_id"]
static _unsubscribe($a_ref_id, $a_user_id)
Unsubscribe a user from an object (ref id).
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilNewsForContextBlockGUI::$block_type = "news"
static

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

◆ $st_data

ilNewsForContextBlockGUI::$st_data
static

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


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