ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
 getPostUserName ($user_lang)
 
 getPostDate ()
 
 getPostUpdate ()
 
 getPostUpdateUserName ($user_lang)
 
 getPostCensored ()
 
 getPostCensoredDate ()
 
 getCensorshipComment ()
 
 getAttachments ()
 
 setNotificationType ($notification_type)
 
 getPosDisplayUserId ()
 
 getPosUserAlias ()
 
 getPostUpdateUserId ()
 
 setPostUpdateUserId ($post_update_user_id)
 
 setPosAuthorId ($pos_author_id)
 
 getPosAuthorId ()
 

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 = ''
 
 $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
 
 $attachments = array()
 
 $cron_recipients = array()
 

Private Member Functions

 readAttachments ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumCronNotificationDataProvider::__construct (   $row)
Parameters
$row

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

References $row, and read().

125  {
126  $this->obj_id = $row['obj_id'];
127  $this->ref_id = $row['ref_id'];
128 
129  $this->thread_id = $row['thread_id'];
130  $this->thread_title = $row['thr_subject'];
131 
132  $this->forum_id = $row['pos_top_fk'];
133  $this->forum_title = $row['top_name'];
134 
135  $this->post_id = $row['pos_pk'];
136  $this->post_title = $row['pos_subject'];
137  $this->post_message = $row['pos_message'];
138  $this->post_date = $row['pos_date'];
139  $this->post_update = $row['pos_update'];
140  $this->post_update_user_id = $row['update_user'];
141 
142  $this->post_censored = $row['pos_cens'];
143  $this->post_censored_date = $row['pos_cens_date'];
144  $this->post_censored_comment = $row['pos_cens_com'];
145 
146  $this->pos_usr_alias = $row['pos_usr_alias'];
147  $this->pos_display_user_id = $row['pos_display_user_id'];
148  $this->pos_author_id = $row['pos_author_id'];
149 
150  $this->read();
151  }
+ Here is the call graph for this function:

Member Function Documentation

◆ addRecipient()

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

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

181  {
182  $this->cron_recipients[] = (int)$user_id;
183  }

◆ getAttachments()

ilForumCronNotificationDataProvider::getAttachments ( )
Returns
array file names

Implements ilForumNotificationMailData.

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

References $attachments.

◆ getCensorshipComment()

ilForumCronNotificationDataProvider::getCensorshipComment ( )

◆ getCronRecipients()

ilForumCronNotificationDataProvider::getCronRecipients ( )

◆ getForumId()

ilForumCronNotificationDataProvider::getForumId ( )
Returns
int frm_data.top_pk

Implements ilForumNotificationMailData.

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

References $forum_id.

◆ getForumTitle()

ilForumCronNotificationDataProvider::getForumTitle ( )
Returns
string frm_data.top_name

Implements ilForumNotificationMailData.

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

References $forum_title.

◆ getObjId()

ilForumCronNotificationDataProvider::getObjId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $pos_author_id.

Referenced by getPostUpdateUserName().

+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilForumCronNotificationDataProvider::getPosDisplayUserId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $post_censored.

◆ getPostCensoredDate()

ilForumCronNotificationDataProvider::getPostCensoredDate ( )
Returns
string frm_posts.pos_cens_date

Implements ilForumNotificationMailData.

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

References $post_censored_date.

◆ getPostDate()

ilForumCronNotificationDataProvider::getPostDate ( )
Returns
string frm_posts.pos_date

Implements ilForumNotificationMailData.

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

References $post_date.

◆ getPostId()

ilForumCronNotificationDataProvider::getPostId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $post_message.

◆ getPostTitle()

ilForumCronNotificationDataProvider::getPostTitle ( )
Returns
string frm_posts.pos_subject

Implements ilForumNotificationMailData.

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

References $post_title.

◆ getPostUpdate()

ilForumCronNotificationDataProvider::getPostUpdate ( )
Returns
string frm_posts.pos_update

Implements ilForumNotificationMailData.

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

References $post_update.

◆ getPostUpdateUserId()

ilForumCronNotificationDataProvider::getPostUpdateUserId ( )
Returns
int

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

References $post_update_user_id.

Referenced by getPostUpdateUserName().

+ Here is the caller graph for this function:

◆ getPostUpdateUserName()

ilForumCronNotificationDataProvider::getPostUpdateUserName (   $user_lang)
Parameters
$user_lang
Returns
string login

Implements ilForumNotificationMailData.

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

References $post_user_name, ilObjUser\_lookupLogin(), getPosAuthorId(), getPosDisplayUserId(), getPostUpdateUserId(), and getPosUserAlias().

309  {
310  // GET AUTHOR OF UPDATED POST
311  if($this->getPostUpdateUserId() > 0)
312  {
313  $this->post_user_name = ilObjUser::_lookupLogin($this->getPostUpdateUserId());
314  }
315 
316  if($this->getPosDisplayUserId() == 0 && $this->getPosAuthorId() == $this->getPostUpdateUserId())
317  {
318  if(strlen($this->getPosUserAlias()))
319  {
320  $this->post_user_name = $this->getPosUserAlias() . ' (' . $user_lang->txt('frm_pseudonym') . ')';
321  }
322 
323  if($this->post_user_name == '')
324  {
325  $this->post_user_name = $user_lang->txt('forums_anonymous');
326  }
327  }
328  return $this->post_user_name;
329  }
static _lookupLogin($a_user_id)
lookup login
+ Here is the call graph for this function:

◆ getPostUserName()

ilForumCronNotificationDataProvider::getPostUserName (   $user_lang)
Returns
string

Implements ilForumNotificationMailData.

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

References $post_user_name, ilObjUser\_lookupLogin(), getPosDisplayUserId(), and getPosUserAlias().

269  {
270  // GET AUTHOR OF NEW POST
271  if($this->getPosDisplayUserId())
272  {
273  $this->post_user_name = ilObjUser::_lookupLogin($this->getPosDisplayUserId());
274  }
275  else if(strlen($this->getPosUserAlias()))
276  {
277  $this->post_user_name = $this->getPosUserAlias() . ' (' . $user_lang->txt('frm_pseudonym') . ')';
278  }
279 
280  if($this->post_user_name == '')
281  {
282  $this->post_user_name = $user_lang->txt('forums_anonymous');
283  }
284 
285  return $this->post_user_name;
286  }
static _lookupLogin($a_user_id)
lookup login
+ Here is the call graph for this function:

◆ getPosUserAlias()

ilForumCronNotificationDataProvider::getPosUserAlias ( )
Returns
string frm_posts.pos_usr_alias

Implements ilForumNotificationMailData.

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

References $pos_usr_alias.

Referenced by getPostUpdateUserName(), and getPostUserName().

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

References $thread_title.

◆ read()

ilForumCronNotificationDataProvider::read ( )
protected

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

References getObjId(), and getPostId().

Referenced by read().

165  {
166  // get attachments
167  include_once "./Modules/Forum/classes/class.ilFileDataForum.php";
168  $fileDataForum = new ilFileDataForum($this->getObjId(), $this->getPostId());
169  $filesOfPost = $fileDataForum->getFilesOfPost();
170 
171  foreach($filesOfPost as $attachment)
172  {
173  $this->attachments[] = $attachment['name'];
174  }
175  }
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 366 of file class.ilForumCronNotificationDataProvider.php.

References $notification_type.

367  {
368  $this->notification_type = $notification_type;
369  }

◆ setPosAuthorId()

ilForumCronNotificationDataProvider::setPosAuthorId (   $pos_author_id)

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

References $post_update_user_id.

400  {
401  $this->post_update_user_id = $post_update_user_id;
402  }

Field Documentation

◆ $attachments

array ilForumCronNotificationDataProvider::$attachments = array()
protected

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

Referenced by getAttachments().

◆ $cron_recipients

ilForumCronNotificationDataProvider::$cron_recipients = array()
protected

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

Referenced by getCronRecipients().

◆ $forum_id

ilForumCronNotificationDataProvider::$forum_id = 0
protected

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

Referenced by getForumId().

◆ $forum_title

string ilForumCronNotificationDataProvider::$forum_title = ''
protected

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

Referenced by getForumTitle().

◆ $notification_type

ilForumCronNotificationDataProvider::$notification_type = NULL

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

Referenced by setNotificationType().

◆ $obj_id

int ilForumCronNotificationDataProvider::$obj_id = 0
protected

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

Referenced by getPosDisplayUserId().

◆ $pos_usr_alias

ilForumCronNotificationDataProvider::$pos_usr_alias = ''
protected

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

Referenced by getPosUserAlias().

◆ $post_censored

ilForumCronNotificationDataProvider::$post_censored = false
protected

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

Referenced by getPostCensored().

◆ $post_censored_comment

ilForumCronNotificationDataProvider::$post_censored_comment = ''
protected

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

Referenced by getCensorshipComment().

◆ $post_censored_date

ilForumCronNotificationDataProvider::$post_censored_date = NULL
protected

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

Referenced by getPostCensoredDate().

◆ $post_date

ilForumCronNotificationDataProvider::$post_date = NULL
protected

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

Referenced by getPostDate().

◆ $post_id

ilForumCronNotificationDataProvider::$post_id = 0
protected

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

Referenced by getPostId().

◆ $post_message

ilForumCronNotificationDataProvider::$post_message = ''
protected

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

Referenced by getPostMessage().

◆ $post_title

ilForumCronNotificationDataProvider::$post_title = ''
protected

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

Referenced by getPostTitle().

◆ $post_update

ilForumCronNotificationDataProvider::$post_update = NULL
protected

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

Referenced by getPostUpdate().

◆ $post_update_user_id

ilForumCronNotificationDataProvider::$post_update_user_id = 0

◆ $post_user_name

string ilForumCronNotificationDataProvider::$post_user_name = ''
protected

◆ $ref_id

int ilForumCronNotificationDataProvider::$ref_id = 0
protected

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

Referenced by getRefId().

◆ $thread_id

ilForumCronNotificationDataProvider::$thread_id = 0
protected

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

Referenced by getThreadId().

◆ $thread_title

string ilForumCronNotificationDataProvider::$thread_title = ''
protected

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

Referenced by getThreadTitle().


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