ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumAuthorInformation Class Reference

ilForumAuthorInformation More...

+ Collaboration diagram for ilForumAuthorInformation:

Public Member Functions

 __construct ($author_id, $display_id, $alias, $import_name, array $public_profile_link_attributes=array())
 getProfilePicture ()
 getAuthor ()
 getAuthorName ($without_short_name=false)
 getAuthorShortName ()
 getLinkedAuthorName ()
 getLinkedAuthorShortName ()
 hasSuffix ()
 getSuffix ()

Protected Member Functions

 initUserInstance ()
 doesAuthorAccountExists ()
 isAuthorAnonymous ()
 buildAuthorProfileLink ($with_profile_link=false)

Protected Attributes

 $display_id
 $alias
 $import_name
 $public_profile_link_attributes = array()
 $author_name
 $author_short_name
 $linked_public_name
 $linked_short_name
 $suffix = ''
 $profilePicture
 $author
 $files = array()
 $author_id

Detailed Description

Constructor & Destructor Documentation

ilForumAuthorInformation::__construct (   $author_id,
  $display_id,
  $alias,
  $import_name,
array  $public_profile_link_attributes = array() 
)
Parameters
int$author_id
int$display_id
string$alias
string$import_name
array$public_profile_link_attributes

Definition at line 87 of file class.ilForumAuthorInformation.php.

References $alias, $author_id, $display_id, $import_name, and $public_profile_link_attributes.

{
$this->author_id = $author_id;
$this->display_id = $display_id;
$this->alias = $alias;
$this->import_name = $import_name;
$this->public_profile_link_attributes = $public_profile_link_attributes;
$this->init();
}

Member Function Documentation

ilForumAuthorInformation::buildAuthorProfileLink (   $with_profile_link = false)
protected
Parameters
bool$with_profile_link

Definition at line 155 of file class.ilForumAuthorInformation.php.

References $author_name, and $author_short_name.

{
$link = '';
if($with_profile_link && $this->public_profile_link_attributes)
{
$link = '<a';
foreach($this->public_profile_link_attributes as $attr => $value)
{
$link .= ' ' . $attr . '="' . $value . '"';
}
$link .= '>';
}
$linked_login = $link . $this->author_short_name;
if($with_profile_link && $this->public_profile_link_attributes)
{
$link .= '</a>';
$linked_login .= '</a>';
}
$this->linked_public_name = $link;
$this->linked_short_name = $linked_login;
}
ilForumAuthorInformation::doesAuthorAccountExists ( )
protected
Returns
bool

Definition at line 126 of file class.ilForumAuthorInformation.php.

References getAuthor().

Referenced by isAuthorAnonymous().

{
return $this->getAuthor() instanceof ilObjUser && $this->getAuthor()->getId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilForumAuthorInformation::getAuthor ( )
Returns
ilObjUser

Definition at line 281 of file class.ilForumAuthorInformation.php.

References $author.

Referenced by doesAuthorAccountExists(), and isAuthorAnonymous().

{
return $this->author;
}

+ Here is the caller graph for this function:

ilForumAuthorInformation::getAuthorName (   $without_short_name = false)
Parameters
bool$without_short_name
Returns
string

Definition at line 290 of file class.ilForumAuthorInformation.php.

References $author_name, and getAuthorShortName().

{
if(!$without_short_name)
{
}
else
{
return trim(preg_replace('/\(' . $this->getAuthorShortName() . '\)/', '', $this->author_name));
}
}

+ Here is the call graph for this function:

ilForumAuthorInformation::getAuthorShortName ( )
Returns
string

Definition at line 305 of file class.ilForumAuthorInformation.php.

References $author_short_name.

Referenced by getAuthorName().

+ Here is the caller graph for this function:

ilForumAuthorInformation::getLinkedAuthorName ( )
Returns
string

Definition at line 313 of file class.ilForumAuthorInformation.php.

References $linked_public_name.

ilForumAuthorInformation::getLinkedAuthorShortName ( )
Returns
string

Definition at line 321 of file class.ilForumAuthorInformation.php.

References $linked_short_name.

ilForumAuthorInformation::getProfilePicture ( )
Returns
string

Definition at line 273 of file class.ilForumAuthorInformation.php.

References $profilePicture.

{
}
ilForumAuthorInformation::getSuffix ( )
Returns
string

Definition at line 337 of file class.ilForumAuthorInformation.php.

References $suffix.

{
return $this->suffix;
}
ilForumAuthorInformation::hasSuffix ( )
Returns
bool

Definition at line 329 of file class.ilForumAuthorInformation.php.

{
return strlen($this->suffix);
}
ilForumAuthorInformation::initUserInstance ( )
protected

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

References ilObjForumAccess\getCachedUserInstance(), and ilForumAuthorInformationCache\getUserObjectById().

{
if(is_numeric($this->display_id) && $this->display_id > 0)
{
// Try to read user instance from preloaded cache array
$this->author = ilForumAuthorInformationCache::getUserObjectById($this->display_id);
if(!$this->author)
{
// Get a user instance from forum module's cache method
$this->author = ilObjForumAccess::getCachedUserInstance($this->display_id);
}
}
if(!$this->author)
{
$this->author = new ilObjUser();
$this->author->setId(0);
$this->author->setPref('public_profile', 'n');
$this->author->setGender('');
}
}

+ Here is the call graph for this function:

ilForumAuthorInformation::isAuthorAnonymous ( )
protected
Returns
bool

Definition at line 134 of file class.ilForumAuthorInformation.php.

References doesAuthorAccountExists(), and getAuthor().

{
return $this->doesAuthorAccountExists() && $this->getAuthor()->getId() == ANONYMOUS_USER_ID;
}

+ Here is the call graph for this function:

Field Documentation

ilForumAuthorInformation::$alias
protected

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

Referenced by __construct().

ilForumAuthorInformation::$author
protected

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

Referenced by getAuthor().

ilForumAuthorInformation::$author_id
protected

Definition at line 78 of file class.ilForumAuthorInformation.php.

Referenced by __construct().

ilForumAuthorInformation::$author_name
protected

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

Referenced by buildAuthorProfileLink(), and getAuthorName().

ilForumAuthorInformation::$author_short_name
protected
ilForumAuthorInformation::$display_id
protected

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

Referenced by __construct().

ilForumAuthorInformation::$files = array()
protected

Definition at line 73 of file class.ilForumAuthorInformation.php.

ilForumAuthorInformation::$import_name
protected

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

Referenced by __construct().

ilForumAuthorInformation::$linked_public_name
protected

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

Referenced by getLinkedAuthorName().

ilForumAuthorInformation::$linked_short_name
protected

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

Referenced by getLinkedAuthorShortName().

ilForumAuthorInformation::$profilePicture
protected

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

Referenced by getProfilePicture().

ilForumAuthorInformation::$public_profile_link_attributes = array()
protected

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

Referenced by __construct().

ilForumAuthorInformation::$suffix = ''
protected

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

Referenced by getSuffix().


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