ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilForumUtil Class Reference

Class ilForumUtil. More...

+ Collaboration diagram for ilForumUtil:

Static Public Member Functions

static getPublicUserAlias ($user_alias, $is_anonymized=false)
 
static collectPostInformationByPostId ($post_id)
 
static moveMediaObjects ($post_message, $source_type, $source_id, $target_type, $target_id, $direction=0)
 
static saveMediaObjects ($post_message, $target_type, $target_id, $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 8 of file class.ilForumUtil.php.

Member Function Documentation

◆ collectPostInformationByPostId()

static ilForumUtil::collectPostInformationByPostId (   $post_id)
static

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

References $DIC, $ilDB, $info, $res, $row, and array.

Referenced by ilForumPostingDraftsBlockGUI\fillDataSection().

32  {
33  global $DIC;
34  $ilDB = $DIC->database();
35 
36  $res = $ilDB->queryF(
37  '
38  SELECT frm.top_name, thr.thr_subject, pos.pos_subject FROM frm_data frm
39  INNER JOIN frm_threads thr ON frm.top_pk = thr.thr_top_fk
40  INNER JOIN frm_posts pos ON thr.thr_pk = pos.pos_thr_fk
41  WHERE pos_pk = %s',
42  array('integer'),
43  array($post_id)
44  );
45 
46  $info = array();
47  while ($row = $ilDB->fetchAssoc($res)) {
48  $info['forum_title'] = $row['top_name'];
49  $info['thread_title'] = $row['thr_subject'];
50  $info['post_title'] = $row['pos_subject'];
51  }
52  return $info;
53  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $ilDB
$info
Definition: index.php:5
+ Here is the caller graph for this function:

◆ getPublicUserAlias()

static ilForumUtil::getPublicUserAlias (   $user_alias,
  $is_anonymized = false 
)
static
Parameters
$user_alias
bool$is_anonymized
Returns
string

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

References $DIC, $ilUser, and $lng.

Referenced by ilObjForumGUI\addThreadObject(), ilObjForumGUI\autosaveDraftAsyncObject(), ilObjForumGUI\autosaveThreadDraftAsyncObject(), ilObjForumGUI\editDraftObject(), ilObjForumGUI\publishThreadDraftObject(), ilObjForumGUI\saveThreadAsDraftObject(), and ilObjForumGUI\updateThreadDraftObject().

16  {
17  global $DIC;
18  $ilUser = $DIC->user();
19  $lng = $DIC->language();
20 
21  if ($is_anonymized) {
22  if (!strlen($user_alias)) {
23  $user_alias = $lng->txt('forums_anonymous');
24  }
25 
26  return $user_alias;
27  }
28  return $ilUser->getLogin();
29  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ moveMediaObjects()

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

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

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

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

63  {
64  include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
65  $mediaObjects = ilRTE::_getMediaObjects($post_message, $direction);
66  $myMediaObjects = ilObjMediaObject::_getMobsOfObject($source_type, $source_id);
67  foreach ($mediaObjects as $mob) {
68  foreach ($myMediaObjects as $myMob) {
69  if ($mob == $myMob) {
70  // change usage
71  ilObjMediaObject::_removeUsage($mob, $source_type, $source_id);
72  break;
73  }
74  }
76  }
77  }
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
$target_type
Definition: goto.php:48
$target_id
Definition: goto.php:49
static _removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Remove usage of mob in another container.
static _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $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:

◆ saveMediaObjects()

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

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

References $target_id, $target_type, ilRTE\_getMediaObjects(), and ilObjMediaObject\_saveUsage().

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

85  {
86  include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
87  $mediaObjects = ilRTE::_getMediaObjects($post_message, $direction);
88 
89  foreach ($mediaObjects as $mob) {
91  }
92  }
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
$target_type
Definition: goto.php:48
$target_id
Definition: goto.php:49
static _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $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: