ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumAuthorInformation Class Reference

ilForumAuthorInformation More...

+ Collaboration diagram for ilForumAuthorInformation:

Public Member Functions

 __construct ($authorEntity, $pseudonym, $importName, array $publicProfileLinkAttributes=array())
 getProfilePicture ()
 getAuthor ()
 getAuthorName ($without_short_name=false)
 getAuthorShortName ()
 getLinkedAuthorName ()
 getLinkedAuthorShortName ()
 isPseudonymUsed ()

Protected Member Functions

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

Protected Attributes

 $authorEntity
 $pseudonym
 $importName
 $publicProfileLinkAttributes = array()
 $authorName
 $authorShortName
 $linked_public_name
 $linked_short_name
 $is_pseudonym = false
 $profilePicture
 $author
 $files = array()

Detailed Description

Constructor & Destructor Documentation

ilForumAuthorInformation::__construct (   $authorEntity,
  $pseudonym,
  $importName,
array  $publicProfileLinkAttributes = array() 
)
Parameters
ilObjUser | int$authorEntity
$pseudonym
$importName
array$publicProfileLinkAttributes

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

References $authorEntity, $importName, $pseudonym, and $publicProfileLinkAttributes.

{
$this->authorEntity = $authorEntity;
$this->pseudonym = $pseudonym;
$this->importName = $importName;
$this->publicProfileLinkAttributes = $publicProfileLinkAttributes;
$this->init();
}

Member Function Documentation

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

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

References $authorName, and $authorShortName.

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

Definition at line 124 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 267 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 276 of file class.ilForumAuthorInformation.php.

References $authorName, and getAuthorShortName().

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

+ Here is the call graph for this function:

ilForumAuthorInformation::getAuthorShortName ( )
Returns
string

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

References $authorShortName.

Referenced by getAuthorName().

+ Here is the caller graph for this function:

ilForumAuthorInformation::getLinkedAuthorName ( )
Returns
string

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

References $linked_public_name.

ilForumAuthorInformation::getLinkedAuthorShortName ( )
Returns
string

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

References $linked_short_name.

ilForumAuthorInformation::getProfilePicture ( )
Returns
string

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

References $profilePicture.

{
}
ilForumAuthorInformation::initUserInstance ( )
protected

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

References $authorEntity, ilObjForumAccess\getCachedUserInstance(), ilObject\getId(), and ilForumAuthorInformationCache\getUserObjectById().

{
if($this->authorEntity instanceof ilObjUser && $this->authorEntity->getId())
{
$this->author = $this->authorEntity;
}
else if(is_numeric($this->authorEntity) && $this->authorEntity)
{
// Try to read user instance from preloaded cache array
$this->author = ilForumAuthorInformationCache::getUserObjectById($this->authorEntity);
if(!$this->author)
{
// Get a user instance from forum module's cache method
$this->author = ilObjForumAccess::getCachedUserInstance($this->authorEntity);
}
}
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 132 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:

ilForumAuthorInformation::isPseudonymUsed ( )
Returns
bool

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

References $is_pseudonym.

{
}

Field Documentation

ilForumAuthorInformation::$author
protected

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

Referenced by getAuthor().

ilForumAuthorInformation::$authorEntity
protected

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

Referenced by __construct(), and initUserInstance().

ilForumAuthorInformation::$authorName
protected

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

Referenced by buildAuthorProfileLink(), and getAuthorName().

ilForumAuthorInformation::$authorShortName
protected
ilForumAuthorInformation::$files = array()
protected

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

ilForumAuthorInformation::$importName
protected

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

Referenced by __construct().

ilForumAuthorInformation::$is_pseudonym = false
protected

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

Referenced by isPseudonymUsed().

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::$pseudonym
protected

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

Referenced by __construct().

ilForumAuthorInformation::$publicProfileLinkAttributes = array()
protected

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

Referenced by __construct().


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