PHP Class MessagesController, vanilla

Inheritance: extends GardenController
Exibir arquivo Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$ConversationModel ConversationModel
$Form Gdn_Form
$Offset The current offset of the paged data set. Defined and used by $this->Index and $this->All.
$RecipientData A dataset of users taking part in this discussion. Used by $this->Index.
$Uses Models to include.

Public Methods

Method Description
add ( string $Recipient = '', string $Subject = '' ) Start a new conversation.
addMessage ( integer $ConversationID = '' ) Add a message to a conversation.
all ( string $Page = '' ) Show all conversations for the currently authenticated user.
bookmark ( integer $ConversationID = '', string $TransientKey = '' ) Allows users to bookmark conversations.
clear ( integer $ConversationID = false, string $TransientKey = '' ) Clear the message history for a specific conversation & user.
getNew ( $ConversationID, null $LastMessageID = null )
inbox ( string $Page = '' ) Show bookmarked conversations for the current user.
index ( integer $ConversationID = false, integer $Offset, integer $Limit = '' ) Shows all uncleared messages within a conversation for the viewing user
initialize ( ) Highlight route and include JS, CSS, and modules used by all methods.
leave ( integer $conversationID ) Leave a conversation that a user is participating in.
popin ( )

Method Details

add() public method

Start a new conversation.
Since: 2.0.0
public add ( string $Recipient = '', string $Subject = '' )
$Recipient string Username of the recipient.
$Subject string Subject of the message.

addMessage() public method

Add a message to a conversation.
Since: 2.0.0
public addMessage ( integer $ConversationID = '' )
$ConversationID integer Unique ID of the conversation.

all() public method

Show all conversations for the currently authenticated user.
Since: 2.0.0
public all ( string $Page = '' )
$Page string The page number argument.

bookmark() public method

Allows users to bookmark conversations.
public bookmark ( integer $ConversationID = '', string $TransientKey = '' )
$ConversationID integer Unique ID of conversation to view.
$TransientKey string Single-use hash to prove intent.

clear() public method

Clear the message history for a specific conversation & user.
public clear ( integer $ConversationID = false, string $TransientKey = '' )
$ConversationID integer Unique ID of conversation to clear.
$TransientKey string The CSRF token.

getNew() public method

public getNew ( $ConversationID, null $LastMessageID = null )
$ConversationID
$LastMessageID null

inbox() public method

Show bookmarked conversations for the current user.
public inbox ( string $Page = '' )
$Page string The page number string.

index() public method

Shows all uncleared messages within a conversation for the viewing user
Since: 2.0.0
public index ( integer $ConversationID = false, integer $Offset, integer $Limit = '' )
$ConversationID integer Unique ID of conversation to view.
$Offset integer Number to skip.
$Limit integer Number to show.

initialize() public method

Always called by dispatcher before controller's requested method.
Since: 2.0.0
public initialize ( )

leave() public method

Leave a conversation that a user is participating in.
public leave ( integer $conversationID )
$conversationID integer The ID of the conversation to leave.

popin() public method

public popin ( )

Property Details

$ConversationModel public_oe property

public ConversationModel $ConversationModel
return ConversationModel

$Form public_oe property

public Gdn_Form $Form
return Gdn_Form

$Offset public_oe property

The current offset of the paged data set. Defined and used by $this->Index and $this->All.
public $Offset

$RecipientData public_oe property

A dataset of users taking part in this discussion. Used by $this->Index.
public $RecipientData

$Uses public_oe property

Models to include.
public $Uses