ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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
 

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 146 of file class.ilForumCronNotificationDataProvider.php.

References $row, and read().

147  {
148  $this->obj_id = $row['obj_id'];
149  $this->ref_id = $row['ref_id'];
150 
151  $this->thread_id = $row['thread_id'];
152  $this->thread_title = $row['thr_subject'];
153 
154  $this->forum_id = $row['pos_top_fk'];
155  $this->forum_title = $row['top_name'];
156 
157  $this->post_id = $row['pos_pk'];
158  $this->post_title = $row['pos_subject'];
159  $this->post_message = $row['pos_message'];
160  $this->post_date = $row['pos_date'];
161  $this->post_update = $row['pos_update'];
162  $this->post_update_user_id = $row['update_user'];
163 
164  $this->post_censored = $row['pos_cens'];
165  $this->post_censored_date = $row['pos_cens_date'];
166  $this->post_censored_comment = $row['pos_cens_com'];
167 
168  $this->pos_usr_alias = $row['pos_usr_alias'];
169  $this->pos_display_user_id = $row['pos_display_user_id'];
170  $this->pos_author_id = $row['pos_author_id'];
171 
172  $this->import_name = strlen($row['import_name']) ? $row['import_name'] : '';
173 
174  $this->read();
175  }
+ Here is the call graph for this function:

Member Function Documentation

◆ addRecipient()

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

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

208  {
209  $this->cron_recipients[] = (int)$user_id;
210  }

◆ getAttachments()

ilForumCronNotificationDataProvider::getAttachments ( )
Returns
array file names

Implements ilForumNotificationMailData.

Definition at line 335 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 414 of file class.ilForumCronNotificationDataProvider.php.

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

415  {
416  $cacheKey = md5(implode('|', array(
417  $lng->getLangKey(),
418  (int)$authorUsrId,
419  (int)$displayUserId,
420  (string)$usrAlias,
421  (string)$importName
422  )));
423 
424  if (!array_key_exists($cacheKey, self::$authorInformationCache)) {
425  $authorInformation = new ilForumAuthorInformation(
426  $authorUsrId,
427  $displayUserId,
428  $usrAlias,
429  $importName,
430  array(),
431  $lng
432  );
433 
434  self::$authorInformationCache[$cacheKey] = $authorInformation;
435  }
436 
437  return self::$authorInformationCache[$cacheKey];
438  }
Add rich text string
The name of the decorator.
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 ( )

◆ getForumId()

ilForumCronNotificationDataProvider::getForumId ( )
Returns
int frm_data.top_pk

Implements ilForumNotificationMailData.

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

References $forum_id.

◆ getForumTitle()

ilForumCronNotificationDataProvider::getForumTitle ( )
Returns
string frm_data.top_name

Implements ilForumNotificationMailData.

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

References $forum_title.

◆ getImportName()

ilForumCronNotificationDataProvider::getImportName ( )
Returns
string

Definition at line 401 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 231 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 385 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 351 of file class.ilForumCronNotificationDataProvider.php.

References $pos_display_user_id.

Referenced by getPostUserName().

+ Here is the caller graph for this function:

◆ getPostCensored()

ilForumCronNotificationDataProvider::getPostCensored ( )
Returns
string frm_posts.pos_cens

Implements ilForumNotificationMailData.

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

References $post_censored.

◆ getPostCensoredDate()

ilForumCronNotificationDataProvider::getPostCensoredDate ( )
Returns
string frm_posts.pos_cens_date

Implements ilForumNotificationMailData.

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

References $post_censored_date.

◆ getPostDate()

ilForumCronNotificationDataProvider::getPostDate ( )
Returns
string frm_posts.pos_date

Implements ilForumNotificationMailData.

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

References $post_date.

◆ getPostId()

ilForumCronNotificationDataProvider::getPostId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 271 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 287 of file class.ilForumCronNotificationDataProvider.php.

References $post_message.

◆ getPostTitle()

ilForumCronNotificationDataProvider::getPostTitle ( )
Returns
string frm_posts.pos_subject

Implements ilForumNotificationMailData.

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

References $post_title.

◆ getPostUpdate()

ilForumCronNotificationDataProvider::getPostUpdate ( )
Returns
string frm_posts.pos_update

Implements ilForumNotificationMailData.

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

References $post_update.

◆ getPostUpdateUserId()

ilForumCronNotificationDataProvider::getPostUpdateUserId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 368 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 461 of file class.ilForumCronNotificationDataProvider.php.

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

462  {
463  if ($this->update_user_name === null) {
464  $this->update_user_name = $this->getPublicUserInformation(self::getAuthorInformation(
465  $user_lang,
466  $this->getPosAuthorId(),
467  $this->getPostUpdateUserId(),
468  $this->getPosUserAlias(),
469  $this->getImportName()
470  ));
471  }
472 
473  return (string)$this->update_user_name;
474  }
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 443 of file class.ilForumCronNotificationDataProvider.php.

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

444  {
445  if (null === $this->post_user_name) {
446  $this->post_user_name = $this->getPublicUserInformation(self::getAuthorInformation(
447  $user_lang,
448  $this->getPosAuthorId(),
449  $this->getPosDisplayUserId(),
450  $this->getPosUserAlias(),
451  $this->getImportName()
452  ));
453  }
454 
455  return (string)$this->post_user_name;
456  }
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 360 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 480 of file class.ilForumCronNotificationDataProvider.php.

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

Referenced by getPostUpdateUserName(), and getPostUserName().

481  {
482  if($authorinfo->hasSuffix())
483  {
484  $public_name = $authorinfo->getAuthorName();
485  }
486  else
487  {
488  $public_name = $authorinfo->getAuthorShortName();
489 
490  if($authorinfo->getAuthorName() && !$this->isAnonymized())
491  {
492  $public_name = $authorinfo->getAuthorName();
493  }
494  }
495 
496  return $public_name;
497  }
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 263 of file class.ilForumCronNotificationDataProvider.php.

References $thread_title.

◆ isAnonymized()

ilForumCronNotificationDataProvider::isAnonymized ( )
Returns
bool

Definition at line 393 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 180 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 188 of file class.ilForumCronNotificationDataProvider.php.

References getObjId(), and getPostId().

Referenced by read().

189  {
190  if(ilForumProperties::isSendAttachmentsByMailEnabled())
191  {
192  // get attachments
193  include_once "./Modules/Forum/classes/class.ilFileDataForum.php";
194  $fileDataForum = new ilFileDataForum($this->getObjId(), $this->getPostId());
195  $filesOfPost = $fileDataForum->getFilesOfPost();
196 
197  foreach($filesOfPost as $attachment)
198  {
199  $this->attachments[] = $attachment['name'];
200  }
201  }
202  }
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:

◆ setNotificationType()

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

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

References $notification_type.

344  {
345  $this->notification_type = $notification_type;
346  }

◆ setPosAuthorId()

ilForumCronNotificationDataProvider::setPosAuthorId (   $pos_author_id)

Definition at line 381 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 376 of file class.ilForumCronNotificationDataProvider.php.

References $post_update_user_id.

377  {
378  $this->post_update_user_id = $post_update_user_id;
379  }

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().

◆ $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: