Documentation

Folder
in package

Represents a personal message folder (i.e. "inbox" or "sent items")

The main purpose of this class is to handle displaying personal messages.

Table of Contents

Properties

$current_label  : string
$current_label_id  : int
$descending  : bool
$is_inbox  : bool
$mode  : int
$per_page  : int
$requested_pm  : object
$sort_methods  : array<string|int, mixed>

Methods

__construct()  : mixed
Constructor.
prepareMessageContext()  : bool|array<string|int, mixed>
Get a personal message for the theme. (used to save memory.)
show()  : void
Shows the personal messages in a folder, ie. inbox/sent etc.
changeDisplayMode()  : void
Lets the user quickly cycle between display modes.
prepareSubjectContext()  : array<string|int, mixed>
Helper for prepareMessageContext() that handles subject-only display.
setPaginationAndLinks()  : void
Constructs page index, sets next/prev/up links, etc.
showAll()  : array<string|int, mixed>
Gets as many personal messages for display as will fit on one page.
showConversation()  : array<string|int, mixed>
Gets a conversation for display.
showOne()  : array<string|int, mixed>
Gets a single personal message for display.
showSubjects()  : void
Gets the list of subjects for display.

Properties

$current_label

public string $current_label = ''

Name of the current label.

$current_label_id

public int $current_label_id = -1

ID number of the current label, or -1 for the main inbox folder.

$descending

public bool $descending = true

Whether to show results in descending or ascending order.

$is_inbox

public bool $is_inbox

Whether this is the inbox or the sent items folder.

$mode

public int $mode

The display mode. Value must be one of the PMAction::VIEW_* constants.

$per_page

public int $per_page

Items to show per page.

$requested_pm

public object $requested_pm

Instance of SMF\PersonalMessage\PM for a personal message that was requested via $_GET['pmid'] or $_GET['pmsg'].

$sort_methods

public static array<string|int, mixed> $sort_methods = ['date' => 'pm.id_pm', 'name' => 'COALESCE(mem.real_name, \'\')', 'subject' => 'pm.subject']

Instructions for sorting the personal messages.

Methods

__construct()

Constructor.

public __construct([bool $is_inbox = true ]) : mixed
Parameters
$is_inbox : bool = true

Whether this is the inbox or the sent items folder.

prepareMessageContext()

Get a personal message for the theme. (used to save memory.)

public prepareMessageContext([string $type = 'subject' ][, bool $check = false ]) : bool|array<string|int, mixed>
Parameters
$type : string = 'subject'

The type of message

$check : bool = false

Checks whether we have some messages to show.

Return values
bool|array<string|int, mixed>

False on failure, otherwise an array of info

show()

Shows the personal messages in a folder, ie. inbox/sent etc.

public show() : void

changeDisplayMode()

Lets the user quickly cycle between display modes.

protected changeDisplayMode() : void

prepareSubjectContext()

Helper for prepareMessageContext() that handles subject-only display.

protected prepareSubjectContext() : array<string|int, mixed>
Return values
array<string|int, mixed>

Constructs page index, sets next/prev/up links, etc.

protected setPaginationAndLinks() : void

showAll()

Gets as many personal messages for display as will fit on one page.

protected showAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

The IDs of the personal messages to be shown.

showConversation()

Gets a conversation for display.

protected showConversation() : array<string|int, mixed>
Return values
array<string|int, mixed>

The IDs of the personal messages to be shown.

showOne()

Gets a single personal message for display.

protected showOne() : array<string|int, mixed>
Return values
array<string|int, mixed>

The IDs of the personal messages to be shown.

showSubjects()

Gets the list of subjects for display.

protected showSubjects() : void

        
On this page

Search results