ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
trait.ilObjFileNews.php File Reference

Go to the source code of this file.

Functions

 notifyCreation (int $obj_id, string $additional_message=null)
 
 notifyUpdate (int $obj_id, string $additional_message=null)
 
 addNewsNotification (int $obj_id, string $a_lang_var, string $description=null)
 

Variables

trait ilObjFileNews
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
 

Function Documentation

◆ addNewsNotification()

addNewsNotification ( int  $obj_id,
string  $a_lang_var,
string  $description = null 
)
protected

Definition at line 41 of file trait.ilObjFileNews.php.

References $DIC, NEWS_NOTICE, and NEWS_USERS.

Referenced by notifyCreation(), and notifyUpdate().

41  : void
42  {
43  global $DIC;
44 
45  // ilHistory::_createEntry($this->getId(), "create", $this->getFileName() . ",1" . ",1");
46 
47  // Add Notification to news
48  $news_item = new ilNewsItem();
49  $news_item->setContext($obj_id, 'file');
50  $news_item->setPriority(NEWS_NOTICE);
51  $news_item->setTitle($a_lang_var);
52  $news_item->setContentIsLangVar(true);
53  if ($description && $description !== '') {
54  $news_item->setContent("<p>" . $description . "</p>");
55  }
56  $news_item->setUserId($DIC->user()->getId());
57  $news_item->setVisibility(NEWS_USERS);
58  $news_item->create();
59  }
global $DIC
Definition: feed.php:28
const NEWS_NOTICE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A news item can be created by different sources.
const NEWS_USERS
+ Here is the caller graph for this function:

◆ notifyCreation()

notifyCreation ( int  $obj_id,
string  $additional_message = null 
)

Definition at line 27 of file trait.ilObjFileNews.php.

References addNewsNotification().

Referenced by ilObjFile\doCreate().

27  : void
28  {
29  $this->addNewsNotification($obj_id, 'file_created', $additional_message);
30  $this->just_notified = true;
31  }
addNewsNotification(int $obj_id, string $a_lang_var, string $description=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyUpdate()

notifyUpdate ( int  $obj_id,
string  $additional_message = null 
)

Definition at line 33 of file trait.ilObjFileNews.php.

References addNewsNotification().

Referenced by ilObjFile\doUpdate().

33  : void
34  {
35  if (!$this->just_notified) {
36  $this->addNewsNotification($obj_id, 'file_updated', $additional_message);
37  $this->just_notified = true;
38  }
39  }
addNewsNotification(int $obj_id, string $a_lang_var, string $description=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ilObjFileNews

trait ilObjFileNews
Initial value:
{
protected bool $just_notified = false

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Trait ilObjFileNews

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 24 of file trait.ilObjFileNews.php.