ILIAS  release_7 Revision v7.30-3-g800a261c036
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
 Trait ilObjFileNews. More...
 

Function Documentation

◆ addNewsNotification()

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

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

28 : void
29 {
30 global $DIC;
31
32 // ilHistory::_createEntry($this->getId(), "create", $this->getFileName() . ",1" . ",1");
33
34 // Add Notification to news
35 $news_item = new ilNewsItem();
36 $news_item->setContext($obj_id, 'file');
37 $news_item->setPriority(NEWS_NOTICE);
38 $news_item->setTitle($a_lang_var);
39 $news_item->setContentIsLangVar(true);
40 if ($description && $description !== '') {
41 $news_item->setContent("<p>" . $description . "</p>");
42 }
43 $news_item->setUserId($DIC->user()->getId());
44 $news_item->setVisibility(NEWS_USERS);
45 $news_item->create();
46 }
const NEWS_USERS
const NEWS_NOTICE
global $DIC
Definition: goto.php:24

References $DIC, NEWS_NOTICE, and NEWS_USERS.

Referenced by notifyCreation(), and notifyUpdate().

+ Here is the caller graph for this function:

◆ notifyCreation()

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

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

14 : void
15 {
16 $this->addNewsNotification($obj_id, 'file_created', $additional_message);
17 $this->just_notified = true;
18 }
addNewsNotification(int $obj_id, string $a_lang_var, string $description=null)

References addNewsNotification().

Referenced by ilObjFile\doCreate().

+ 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 20 of file trait.ilObjFileNews.php.

20 : void
21 {
22 if (!$this->just_notified) {
23 $this->addNewsNotification($obj_id, 'file_updated', $additional_message);
24 $this->just_notified = true;
25 }
26 }

References addNewsNotification().

Referenced by ilObjFile\doUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ilObjFileNews

trait ilObjFileNews
Initial value:
{
protected $just_notified = false

Trait ilObjFileNews.

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

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