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

Class ilForumCronNotificationDataProvider. More...

+ Inheritance diagram for ilForumCronNotificationDataProvider:
+ Collaboration diagram for ilForumCronNotificationDataProvider:

Public Member Functions

 __construct ($row)
 
 addRecipient ($user_id)
 
 getCronRecipients ()
 
 getRefId ()
 
 getObjId ()
 
 getForumId ()
 
 getForumTitle ()
 
 getThreadId ()
 
 getThreadTitle ()
 
 getPostId ()
 
 getPostTitle ()
 
 getPostMessage ()
 
 getPostDate ()
 
 getPostUpdate ()
 
 getPostCensored ()
 
 getPostCensoredDate ()
 
 getCensorshipComment ()
 
 getAttachments ()
 
 setNotificationType ($notification_type)
 
 getPosDisplayUserId ()
 
 getPosUserAlias ()
 
 getPostUpdateUserId ()
 
 setPostUpdateUserId ($post_update_user_id)
 
 setPosAuthorId ($pos_author_id)
 
 getPosAuthorId ()
 
 isAnonymized ()
 
 getDeletedBy ()
 
 setDeletedBy ($deleted_by)
 
 getImportName ()
 
 getPostUserName (\ilLanguage $user_lang)
 
Parameters
\ilLanguage$user_lang
Returns
string
More...
 
 getPostUpdateUserName (\ilLanguage $user_lang)
 
Parameters
\ilLanguage$user_lang
Returns
string
More...
 
 getPublicUserInformation (ilForumAuthorInformation $authorinfo)
 

Data Fields

 $notification_type = null
 
 $objPost = null
 
 $post_update_user_id = 0
 
 $pos_author_id = 0
 
 $deleted_by = ''
 

Protected Member Functions

 read ()
 

Protected Attributes

 $ref_id = 0
 
 $obj_id = 0
 
 $post_user_name = null
 
 $update_user_name = null
 
 $forum_id = 0
 
 $forum_title = ''
 
 $thread_id = 0
 
 $thread_title = ''
 
 $post_id = 0
 
 $post_title = ''
 
 $post_message = ''
 
 $post_date = null
 
 $post_update = null
 
 $post_censored = false
 
 $post_censored_date = null
 
 $post_censored_comment = ''
 
 $pos_usr_alias = ''
 
 $pos_display_user_id = 0
 
 $is_anonymized = false
 
 $import_name = ''
 
 $attachments = array()
 
 $cron_recipients = array()
 

Static Protected Attributes

static $authorInformationCache = array()
 

Private Member Functions

 readAttachments ()
 
 getAuthorInformation (\ilLanguage $lng, $authorUsrId, $displayUserId, $usrAlias, $importName)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumCronNotificationDataProvider::__construct (   $row)
Parameters
$row

Definition at line 151 of file class.ilForumCronNotificationDataProvider.php.

References $DIC, $row, and read().

152  {
153  $this->obj_id = $row['obj_id'];
154  $this->ref_id = $row['ref_id'];
155 
156  $this->thread_id = $row['thread_id'];
157  $this->thread_title = $row['thr_subject'];
158 
159  $this->forum_id = $row['pos_top_fk'];
160  $this->forum_title = $row['top_name'];
161 
162  $this->post_id = $row['pos_pk'];
163  $this->post_title = $row['pos_subject'];
164  $this->post_message = $row['pos_message'];
165  $this->post_date = $row['pos_date'];
166  $this->post_update = $row['pos_update'];
167  $this->post_update_user_id = $row['update_user'];
168 
169  $this->post_censored = $row['pos_cens'];
170  $this->post_censored_date = $row['pos_cens_date'];
171  $this->post_censored_comment = $row['pos_cens_com'];
172 
173  $this->pos_usr_alias = $row['pos_usr_alias'];
174  $this->pos_display_user_id = $row['pos_display_user_id'];
175  $this->pos_author_id = $row['pos_author_id'];
176 
177  $this->import_name = strlen($row['import_name']) ? $row['import_name'] : '';
178 
179  if (isset($row['deleted_by'])) {
180  //cron context
181  $this->deleted_by = $row['deleted_by'];
182  } else {
183  // fallback
184  global $DIC;
185  $this->deleted_by = $DIC->user()->getLogin();
186  }
187 
188  $this->read();
189  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ addRecipient()

ilForumCronNotificationDataProvider::addRecipient (   $user_id)
Parameters
int$user_id

Definition at line 219 of file class.ilForumCronNotificationDataProvider.php.

220  {
221  $this->cron_recipients[] = (int) $user_id;
222  }

◆ getAttachments()

ilForumCronNotificationDataProvider::getAttachments ( )
Returns
array file names

Implements ilForumNotificationMailData.

Definition at line 347 of file class.ilForumCronNotificationDataProvider.php.

References $attachments.

◆ getAuthorInformation()

ilForumCronNotificationDataProvider::getAuthorInformation ( \ilLanguage  $lng,
  $authorUsrId,
  $displayUserId,
  $usrAlias,
  $importName 
)
private
Parameters
ilLanguage$lng
$authorUsrId
$displayUserId
$usrAlias
$importName
Returns

Definition at line 442 of file class.ilForumCronNotificationDataProvider.php.

References array, ilLanguage\getLangKey(), and string.

443  {
444  $cacheKey = md5(implode('|', array(
445  $lng->getLangKey(),
446  (int) $authorUsrId,
447  (int) $displayUserId,
448  (string) $usrAlias,
449  (string) $importName
450  )));
451 
452  if (!array_key_exists($cacheKey, self::$authorInformationCache)) {
453  $authorInformation = new ilForumAuthorInformation(
454  $authorUsrId,
455  $displayUserId,
456  $usrAlias,
457  $importName,
458  array(),
459  $lng
460  );
461 
462  self::$authorInformationCache[$cacheKey] = $authorInformation;
463  }
464 
465  return self::$authorInformationCache[$cacheKey];
466  }
Add rich text string
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getCensorshipComment()

ilForumCronNotificationDataProvider::getCensorshipComment ( )

◆ getCronRecipients()

ilForumCronNotificationDataProvider::getCronRecipients ( )

◆ getDeletedBy()

ilForumCronNotificationDataProvider::getDeletedBy ( )

◆ getForumId()

ilForumCronNotificationDataProvider::getForumId ( )
Returns
int frm_data.top_pk

Implements ilForumNotificationMailData.

Definition at line 251 of file class.ilForumCronNotificationDataProvider.php.

References $forum_id.

◆ getForumTitle()

ilForumCronNotificationDataProvider::getForumTitle ( )
Returns
string frm_data.top_name

Implements ilForumNotificationMailData.

Definition at line 259 of file class.ilForumCronNotificationDataProvider.php.

References $forum_title.

◆ getImportName()

ilForumCronNotificationDataProvider::getImportName ( )
Returns
string

Definition at line 429 of file class.ilForumCronNotificationDataProvider.php.

References $import_name.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getObjId()

ilForumCronNotificationDataProvider::getObjId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $obj_id.

Referenced by readAttachments().

+ Here is the caller graph for this function:

◆ getPosAuthorId()

ilForumCronNotificationDataProvider::getPosAuthorId ( )
Returns
string frm_posts.pos_author_id

Implements ilForumNotificationMailData.

Definition at line 397 of file class.ilForumCronNotificationDataProvider.php.

References $pos_author_id.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilForumCronNotificationDataProvider::getPosDisplayUserId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 363 of file class.ilForumCronNotificationDataProvider.php.

References $pos_display_user_id.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPostCensored()

ilForumCronNotificationDataProvider::getPostCensored ( )
Returns
string frm_posts.pos_cens

Implements ilForumNotificationMailData.

Definition at line 323 of file class.ilForumCronNotificationDataProvider.php.

References $post_censored.

◆ getPostCensoredDate()

ilForumCronNotificationDataProvider::getPostCensoredDate ( )
Returns
string frm_posts.pos_cens_date

Implements ilForumNotificationMailData.

Definition at line 331 of file class.ilForumCronNotificationDataProvider.php.

References $post_censored_date.

◆ getPostDate()

ilForumCronNotificationDataProvider::getPostDate ( )
Returns
string frm_posts.pos_date

Implements ilForumNotificationMailData.

Definition at line 307 of file class.ilForumCronNotificationDataProvider.php.

References $post_date.

◆ getPostId()

ilForumCronNotificationDataProvider::getPostId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 283 of file class.ilForumCronNotificationDataProvider.php.

References $post_id.

Referenced by readAttachments().

+ Here is the caller graph for this function:

◆ getPostMessage()

ilForumCronNotificationDataProvider::getPostMessage ( )
Returns
string frm_posts.pos_message

Implements ilForumNotificationMailData.

Definition at line 299 of file class.ilForumCronNotificationDataProvider.php.

References $post_message.

◆ getPostTitle()

ilForumCronNotificationDataProvider::getPostTitle ( )
Returns
string frm_posts.pos_subject

Implements ilForumNotificationMailData.

Definition at line 291 of file class.ilForumCronNotificationDataProvider.php.

References $post_title.

◆ getPostUpdate()

ilForumCronNotificationDataProvider::getPostUpdate ( )
Returns
string frm_posts.pos_update

Implements ilForumNotificationMailData.

Definition at line 315 of file class.ilForumCronNotificationDataProvider.php.

References $post_update.

◆ getPostUpdateUserId()

ilForumCronNotificationDataProvider::getPostUpdateUserId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 380 of file class.ilForumCronNotificationDataProvider.php.

References $post_update_user_id.

Referenced by getPostUpdateUserName().

+ Here is the caller graph for this function:

◆ getPostUpdateUserName()

ilForumCronNotificationDataProvider::getPostUpdateUserName ( \ilLanguage  $user_lang)

Parameters
\ilLanguage$user_lang
Returns
string

Implements ilForumNotificationMailData.

Definition at line 489 of file class.ilForumCronNotificationDataProvider.php.

References $update_user_name, getImportName(), getPosAuthorId(), getPosDisplayUserId(), getPostUpdateUserId(), getPosUserAlias(), getPublicUserInformation(), and string.

490  {
491  if ($this->update_user_name === null) {
492  $this->update_user_name = $this->getPublicUserInformation(self::getAuthorInformation(
493  $user_lang,
494  $this->getPosAuthorId(),
495  $this->getPostUpdateUserId(),
496  $this->getPosUserAlias(),
497  $this->getImportName()
498  ));
499 
500  // Possible Fix for #25432
501  if (
502  $this->getPosUserAlias() && $this->getPosDisplayUserId() == 0 &&
503  $this->getPosAuthorId() == $this->getPostUpdateUserId()
504  ) {
505  $this->update_user_name = (string) $this->getPosUserAlias();
506  }
507  }
508 
509  return (string) $this->update_user_name;
510  }
Add rich text string
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
+ Here is the call graph for this function:

◆ getPostUserName()

ilForumCronNotificationDataProvider::getPostUserName ( \ilLanguage  $user_lang)

Parameters
\ilLanguage$user_lang
Returns
string

Implements ilForumNotificationMailData.

Definition at line 471 of file class.ilForumCronNotificationDataProvider.php.

References $post_user_name, getImportName(), getPosAuthorId(), getPosDisplayUserId(), getPosUserAlias(), and getPublicUserInformation().

472  {
473  if (null === $this->post_user_name) {
474  $this->post_user_name = $this->getPublicUserInformation(self::getAuthorInformation(
475  $user_lang,
476  $this->getPosAuthorId(),
477  $this->getPosDisplayUserId(),
478  $this->getPosUserAlias(),
479  $this->getImportName()
480  ));
481  }
482 
483  return (string) $this->post_user_name;
484  }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
+ Here is the call graph for this function:

◆ getPosUserAlias()

ilForumCronNotificationDataProvider::getPosUserAlias ( )
Returns
string frm_posts.pos_usr_alias

Implements ilForumNotificationMailData.

Definition at line 372 of file class.ilForumCronNotificationDataProvider.php.

References $pos_usr_alias.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPublicUserInformation()

ilForumCronNotificationDataProvider::getPublicUserInformation ( ilForumAuthorInformation  $authorinfo)
Parameters
ilForumAuthorInformation$authorinfo
Returns
string

Definition at line 516 of file class.ilForumCronNotificationDataProvider.php.

References ilForumAuthorInformation\getAuthorName(), ilForumAuthorInformation\getAuthorShortName(), ilForumAuthorInformation\hasSuffix(), and isAnonymized().

Referenced by getPostUpdateUserName(), and getPostUserName().

517  {
518  if ($authorinfo->hasSuffix()) {
519  $public_name = $authorinfo->getAuthorName();
520  } else {
521  $public_name = $authorinfo->getAuthorShortName();
522 
523  if ($authorinfo->getAuthorName() && !$this->isAnonymized()) {
524  $public_name = $authorinfo->getAuthorName();
525  }
526  }
527 
528  return $public_name;
529  }
getAuthorName($without_short_name=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRefId()

ilForumCronNotificationDataProvider::getRefId ( )

◆ getThreadId()

ilForumCronNotificationDataProvider::getThreadId ( )

◆ getThreadTitle()

ilForumCronNotificationDataProvider::getThreadTitle ( )
Returns
string frm_threads.thr_subject

Implements ilForumNotificationMailData.

Definition at line 275 of file class.ilForumCronNotificationDataProvider.php.

References $thread_title.

◆ isAnonymized()

ilForumCronNotificationDataProvider::isAnonymized ( )
Returns
bool

Definition at line 405 of file class.ilForumCronNotificationDataProvider.php.

References $is_anonymized.

Referenced by getPublicUserInformation().

+ Here is the caller graph for this function:

◆ read()

ilForumCronNotificationDataProvider::read ( )
protected

Definition at line 194 of file class.ilForumCronNotificationDataProvider.php.

References readAttachments().

Referenced by __construct().

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

◆ readAttachments()

ilForumCronNotificationDataProvider::readAttachments ( )
private

Definition at line 202 of file class.ilForumCronNotificationDataProvider.php.

References getObjId(), getPostId(), and ilForumProperties\isSendAttachmentsByMailEnabled().

Referenced by read().

203  {
205  // get attachments
206  include_once "./Modules/Forum/classes/class.ilFileDataForum.php";
207  $fileDataForum = new ilFileDataForum($this->getObjId(), $this->getPostId());
208  $filesOfPost = $fileDataForum->getFilesOfPost();
209 
210  foreach ($filesOfPost as $attachment) {
211  $this->attachments[] = $attachment['name'];
212  }
213  }
214  }
This class handles all operations on files for the forum object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDeletedBy()

ilForumCronNotificationDataProvider::setDeletedBy (   $deleted_by)
Parameters
int$deleted_by

Definition at line 421 of file class.ilForumCronNotificationDataProvider.php.

References $deleted_by.

◆ setNotificationType()

ilForumCronNotificationDataProvider::setNotificationType (   $notification_type)
Parameters
null$notification_type

Definition at line 355 of file class.ilForumCronNotificationDataProvider.php.

References $notification_type.

356  {
357  $this->notification_type = $notification_type;
358  }

◆ setPosAuthorId()

ilForumCronNotificationDataProvider::setPosAuthorId (   $pos_author_id)

Definition at line 393 of file class.ilForumCronNotificationDataProvider.php.

References $pos_author_id.

◆ setPostUpdateUserId()

ilForumCronNotificationDataProvider::setPostUpdateUserId (   $post_update_user_id)
Parameters
int$post_update_user_id

Definition at line 388 of file class.ilForumCronNotificationDataProvider.php.

References $post_update_user_id.

389  {
390  $this->post_update_user_id = $post_update_user_id;
391  }

Field Documentation

◆ $attachments

array ilForumCronNotificationDataProvider::$attachments = array()
protected

Definition at line 116 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getAttachments().

◆ $authorInformationCache

ilForumCronNotificationDataProvider::$authorInformationCache = array()
staticprotected

◆ $cron_recipients

ilForumCronNotificationDataProvider::$cron_recipients = array()
protected

Definition at line 121 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getCronRecipients().

◆ $deleted_by

ilForumCronNotificationDataProvider::$deleted_by = ''

Definition at line 141 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getDeletedBy(), and setDeletedBy().

◆ $forum_id

ilForumCronNotificationDataProvider::$forum_id = 0
protected

Definition at line 43 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getForumId().

◆ $forum_title

string ilForumCronNotificationDataProvider::$forum_title = ''
protected

Definition at line 48 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getForumTitle().

◆ $import_name

ilForumCronNotificationDataProvider::$import_name = ''
protected

Definition at line 111 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getImportName().

◆ $is_anonymized

ilForumCronNotificationDataProvider::$is_anonymized = false
protected

Definition at line 106 of file class.ilForumCronNotificationDataProvider.php.

Referenced by isAnonymized().

◆ $notification_type

ilForumCronNotificationDataProvider::$notification_type = null

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

Referenced by setNotificationType().

◆ $obj_id

int ilForumCronNotificationDataProvider::$obj_id = 0
protected

Definition at line 28 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getObjId().

◆ $objPost

ilForumCronNotificationDataProvider::$objPost = null

◆ $pos_author_id

ilForumCronNotificationDataProvider::$pos_author_id = 0

◆ $pos_display_user_id

ilForumCronNotificationDataProvider::$pos_display_user_id = 0
protected

Definition at line 101 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPosDisplayUserId().

◆ $pos_usr_alias

ilForumCronNotificationDataProvider::$pos_usr_alias = ''
protected

Definition at line 97 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPosUserAlias().

◆ $post_censored

ilForumCronNotificationDataProvider::$post_censored = false
protected

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

Referenced by getPostCensored().

◆ $post_censored_comment

ilForumCronNotificationDataProvider::$post_censored_comment = ''
protected

Definition at line 92 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getCensorshipComment().

◆ $post_censored_date

ilForumCronNotificationDataProvider::$post_censored_date = null
protected

Definition at line 88 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostCensoredDate().

◆ $post_date

ilForumCronNotificationDataProvider::$post_date = null
protected

Definition at line 75 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostDate().

◆ $post_id

ilForumCronNotificationDataProvider::$post_id = 0
protected

Definition at line 63 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostId().

◆ $post_message

ilForumCronNotificationDataProvider::$post_message = ''
protected

Definition at line 71 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostMessage().

◆ $post_title

ilForumCronNotificationDataProvider::$post_title = ''
protected

Definition at line 67 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostTitle().

◆ $post_update

ilForumCronNotificationDataProvider::$post_update = null
protected

Definition at line 79 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostUpdate().

◆ $post_update_user_id

ilForumCronNotificationDataProvider::$post_update_user_id = 0

◆ $post_user_name

string null ilForumCronNotificationDataProvider::$post_user_name = null
protected

Definition at line 33 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostUserName().

◆ $ref_id

int ilForumCronNotificationDataProvider::$ref_id = 0
protected

Definition at line 23 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getRefId().

◆ $thread_id

ilForumCronNotificationDataProvider::$thread_id = 0
protected

Definition at line 53 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getThreadId().

◆ $thread_title

string ilForumCronNotificationDataProvider::$thread_title = ''
protected

Definition at line 58 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getThreadTitle().

◆ $update_user_name

string null ilForumCronNotificationDataProvider::$update_user_name = null
protected

Definition at line 38 of file class.ilForumCronNotificationDataProvider.php.

Referenced by getPostUpdateUserName().


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