ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumUtil Class Reference

Class ilForumUtil. More...

+ Collaboration diagram for ilForumUtil:

Static Public Member Functions

static getPublicUserAlias (string $user_alias, bool $is_anonymized)
 
static moveMediaObjects (string $post_message, string $source_type, int $source_id, string $target_type, int $target_id, int $direction=0)
 
static saveMediaObjects (string $post_message, string $target_type, int $target_id, int $direction=0)
 

Detailed Description

Class ilForumUtil.

Author
Nadia Matuschek nmatu.nosp@m.sche.nosp@m.k@dat.nosp@m.abay.nosp@m..de

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

Member Function Documentation

◆ getPublicUserAlias()

static ilForumUtil::getPublicUserAlias ( string  $user_alias,
bool  $is_anonymized 
)
static

Definition at line 27 of file class.ilForumUtil.php.

References $DIC, and $lng.

Referenced by ilObjForumGUI\createEmptyThread(), ilObjForumGUI\createThread(), ilForumAutoSaveAsyncDraftAction\getInputValuesFromForm(), ilObjForumGUI\saveAsDraftObject(), ilObjForumGUI\saveThreadAsDraftObject(), ilObjForumGUI\updateDraftObject(), and ilObjForumGUI\updateThreadDraftObject().

27  : string
28  {
29  global $DIC;
30 
31  $ilUser = $DIC->user();
32  $lng = $DIC->language();
33 
34  if ($is_anonymized) {
35  if ($user_alias === '') {
36  $user_alias = $lng->txt('forums_anonymous');
37  }
38 
39  return $user_alias;
40  }
41 
42  return $ilUser->getLogin();
43  }
global $DIC
Definition: shib_login.php:22
global $lng
Definition: privfeed.php:31
+ Here is the caller graph for this function:

◆ moveMediaObjects()

static ilForumUtil::moveMediaObjects ( string  $post_message,
string  $source_type,
int  $source_id,
string  $target_type,
int  $target_id,
int  $direction = 0 
)
static

Definition at line 45 of file class.ilForumUtil.php.

References ilRTE\_getMediaObjects(), ilObjMediaObject\_getMobsOfObject(), ilObjMediaObject\_removeUsage(), and ilObjMediaObject\_saveUsage().

Referenced by ilObjForumGUI\cancelDraftObject(), ilForumPostDraft\createDraftBackup(), ilForumDraftsHistory\rollbackAutosave(), ilObjForumGUI\saveAsDraftObject(), ilObjForumGUI\savePostObject(), ilObjForumGUI\saveThreadAsDraftObject(), and ilObjForumGUI\updateThreadDraftObject().

52  : void {
53  $mediaObjects = ilRTE::_getMediaObjects($post_message, $direction);
54  $myMediaObjects = ilObjMediaObject::_getMobsOfObject($source_type, $source_id);
55  foreach ($mediaObjects as $mob) {
56  foreach ($myMediaObjects as $myMob) {
57  if ($mob === $myMob) {
58  ilObjMediaObject::_removeUsage($mob, $source_type, $source_id);
59  break;
60  }
61  }
62  ilObjMediaObject::_saveUsage($mob, $target_type, $target_id);
63  }
64  }
static _getMediaObjects(string $a_text, int $a_direction=0)
Returns all media objects found in the passed string.
static _saveUsage(int $a_mob_id, string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
Save usage of mob within another container (e.g.
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
static _removeUsage(int $a_mob_id, string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
Remove usage of mob in another container.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveMediaObjects()

static ilForumUtil::saveMediaObjects ( string  $post_message,
string  $target_type,
int  $target_id,
int  $direction = 0 
)
static

Definition at line 66 of file class.ilForumUtil.php.

References ilRTE\_getMediaObjects(), and ilObjMediaObject\_saveUsage().

Referenced by ilObjForumGUI\publishDraftObject(), and ilObjForumGUI\updateDraftObject().

71  : void {
72  $mediaObjects = ilRTE::_getMediaObjects($post_message, $direction);
73 
74  foreach ($mediaObjects as $mob) {
75  ilObjMediaObject::_saveUsage($mob, $target_type, $target_id);
76  }
77  }
static _getMediaObjects(string $a_text, int $a_direction=0)
Returns all media objects found in the passed string.
static _saveUsage(int $a_mob_id, string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
Save usage of mob within another container (e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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