Agora
in package
The Agora:: class provides basic Agora functionality.
Copyright 2003-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Tags
Table of Contents
- AVATAR_PATH = '.horde/agora/avatars/'
- VFS_PATH = '.horde/agora/attachments/'
- The virtual path to use for VFS data.
- distribute() : mixed
- Send new posts to a distribution email address for a wider audience
- formatCategoryTree() : array<string|int, mixed>
- Formats a list of forums, showing each child of a parent with appropriate indent using '.. ' as a leader.
- formatColumnHeaders() : array<string|int, mixed>
- Formats column headers have sort links and sort arrows.
- getAgoraId() : array<string|int, mixed>
- Determines the requested forum_id, message_id and application by checking first if they are passed as the single encoded var or individual vars.
- getAvatarUrl() : mixed
- getCAPTCHA() : string
- Returns a new or the current CAPTCHA string.
- getSortBy() : string
- Returns the column to sort by, checking first if it is specified in the URL, then returning the value stored in prefs.
- getSortDir() : int
- Returns the sort direction, checking first if it is specified in the URL, then returning the value stored in prefs.
- getVFS() : VFS
- Returns a {@link VFS} instance.
- setAgoraId() : string
- Creates the Agora id.
- validateAvatar() : mixed
Constants
AVATAR_PATH
public
mixed
AVATAR_PATH
= '.horde/agora/avatars/'
VFS_PATH
The virtual path to use for VFS data.
public
mixed
VFS_PATH
= '.horde/agora/attachments/'
Methods
distribute()
Send new posts to a distribution email address for a wider audience
public
distribute(int $message_id) : mixed
Parameters
- $message_id : int
-
Identifier of message to be distributed
Tags
Return values
mixed —formatCategoryTree()
Formats a list of forums, showing each child of a parent with appropriate indent using '.. ' as a leader.
public
formatCategoryTree(array<string|int, mixed> $forums) : array<string|int, mixed>
Parameters
- $forums : array<string|int, mixed>
-
The list of forums to format.
Return values
array<string|int, mixed> —Formatted forum list.
formatColumnHeaders()
Formats column headers have sort links and sort arrows.
public
formatColumnHeaders(array<string|int, mixed> $columns, string $sort_by, string $sort_dir, string $view) : array<string|int, mixed>
Parameters
- $columns : array<string|int, mixed>
-
The columns to format.
- $sort_by : string
-
The current 'sort-by' column.
- $sort_dir : string
-
The current sort direction.
- $view : string
-
The view name, used to identify preference settings for sorting.
Return values
array<string|int, mixed> —The formated column headers to be displayed.
getAgoraId()
Determines the requested forum_id, message_id and application by checking first if they are passed as the single encoded var or individual vars.
public
getAgoraId() : array<string|int, mixed>
Return values
array<string|int, mixed> —Forum, message id and application.
getAvatarUrl()
public
getAvatarUrl(mixed $avatar_path[, mixed $scopeend_sid = true ]) : mixed
Parameters
- $avatar_path : mixed
- $scopeend_sid : mixed = true
Return values
mixed —getCAPTCHA()
Returns a new or the current CAPTCHA string.
public
getCAPTCHA([bool $new = false ]) : string
Parameters
- $new : bool = false
-
If true, a new CAPTCHA is created and returned. The current, to-be-confirmed string otherwise.
Return values
string —A CAPTCHA string.
getSortBy()
Returns the column to sort by, checking first if it is specified in the URL, then returning the value stored in prefs.
public
getSortBy(string $view) : string
Parameters
- $view : string
-
The view name, used to identify preference settings for sorting.
Return values
string —The column to sort by.
getSortDir()
Returns the sort direction, checking first if it is specified in the URL, then returning the value stored in prefs.
public
getSortDir(string $view) : int
Parameters
- $view : string
-
The view name, used to identify preference settings for sorting.
Return values
int —The sort direction, 0 = ascending, 1 = descending.
getVFS()
Returns a {@link VFS} instance.
public
getVFS() : VFS
Return values
VFS —A VFS instance.
setAgoraId()
Creates the Agora id.
public
setAgoraId(mixed $forum_id, mixed $message_id[, mixed $url = '' ][, mixed $scope = null ][, mixed $encode = false ]) : string
Parameters
- $forum_id : mixed
- $message_id : mixed
- $url : mixed = ''
- $scope : mixed = null
- $encode : mixed = false
Return values
string —If passed with the $url parameter, returns a completed url with the agora_id tacked on at the end, otherwise returns the simple agora_id.
validateAvatar()
public
validateAvatar(mixed $avatar_path) : mixed
Parameters
- $avatar_path : mixed