LDAP Account Manager

htmlDataTable extends htmlElement
in package

Table component for client-side controlled data tables.

Table of Contents

ALIGN_BOTTOM  = 3
align to bottom
ALIGN_CENTER  = 4
align to center
ALIGN_LEFT  = 1
align to left
ALIGN_RIGHT  = 2
align to right
ALIGN_TOP  = 0
align to top
DATA_ACTION  = 'action'
DATA_AJAX_URL  = 'ajaxurl'
DATA_OK_TEXT  = 'oktext'
DATA_TOKEN_NAME  = 'tokenname'
DATA_TOKEN_VALUE  = 'tokenvalue'
SORT_ASC  = 'asc'
SORT_DESC  = 'desc'
$alignment  : mixed
alignment when inside a table
$colspan  : mixed
colspan if inside a table
$rowspan  : mixed
rowspan if inside a table
$cssClasses  : mixed
CSS classes
$tableCellCssClasses  : mixed
table cell CSS classes
$accessibilityLabel  : string|null
accessibility label
$columns  : array<string|int, mixed>
$dataAttributes  : mixed
data attributes
$height  : mixed
$id  : string
$initialSortColumn  : string|null
$initialSortOrder  : string|null
$onRowClick  : string
$searchFieldId  : string
__construct()  : mixed
Constructor
addDataAttribute()  : mixed
Adds a data attribute.
generateHTML()  : array<string|int, mixed>
Prints the HTML code for this element.
getAccessibilityMarkup()  : string
Returns the markup for the accessibility data.
getAlignmentString()  : string
Returns the HTML attributes for the alignment.
getColspanString()  : string
Returns the HTML attribute for the colspan.
getCSSClasses()  : array<string|int, mixed>
Returns the CSS classes of this element.
getRowspanString()  : string
Returns the HTML attribute for the rowspan.
getTableCellCSSClasses()  : array<string|int, mixed>
Returns the CSS classes of the surrounding table cell for this element.
setAccessibilityLabel()  : void
Sets the accessibility label.
setCSSClasses()  : mixed
Adds CSS classes to this element.
setInitialSorting()  : void
Sets the initial sort order.
setOnRowClick()  : void
Sets the row click handler.
setSearchField()  : void
Sets the search field.
setTableCellCSSClasses()  : mixed
Adds CSS classes to the surrounding table cell for this element.
getDataAttributesAsString()  : string
Returns the data attributes as rendered string.

Constants

ALIGN_BOTTOM

align to bottom

public mixed ALIGN_BOTTOM = 3

ALIGN_CENTER

align to center

public mixed ALIGN_CENTER = 4

ALIGN_LEFT

align to left

public mixed ALIGN_LEFT = 1

ALIGN_RIGHT

align to right

public mixed ALIGN_RIGHT = 2

ALIGN_TOP

align to top

public mixed ALIGN_TOP = 0

DATA_ACTION

public mixed DATA_ACTION = 'action'

DATA_AJAX_URL

public mixed DATA_AJAX_URL = 'ajaxurl'

DATA_OK_TEXT

public mixed DATA_OK_TEXT = 'oktext'

DATA_TOKEN_NAME

public mixed DATA_TOKEN_NAME = 'tokenname'

DATA_TOKEN_VALUE

public mixed DATA_TOKEN_VALUE = 'tokenvalue'

SORT_ASC

public mixed SORT_ASC = 'asc'

SORT_DESC

public mixed SORT_DESC = 'desc'

Properties

$alignment

alignment when inside a table

public mixed $alignment

$colspan

colspan if inside a table

public mixed $colspan

$rowspan

rowspan if inside a table

public mixed $rowspan

$cssClasses

CSS classes

protected mixed $cssClasses = []

$tableCellCssClasses

table cell CSS classes

protected mixed $tableCellCssClasses = []

$accessibilityLabel

accessibility label

private string|null $accessibilityLabel = \null

$columns

private array<string|int, mixed> $columns

$dataAttributes

data attributes

private mixed $dataAttributes = []

$height

private mixed $height

$initialSortColumn

private string|null $initialSortColumn = \null

$initialSortOrder

private string|null $initialSortOrder = \null

$onRowClick

private string $onRowClick = ''

$searchFieldId

private string $searchFieldId = ''

Methods

__construct()

Constructor

public __construct(string $id, array<string|int, htmlDataTableColumn$columns[, int|string $height = 300 ]) : mixed
Parameters
$id : string

table ID

$columns : array<string|int, htmlDataTableColumn>

columns

$height : int|string = 300

table height

Return values
mixed

addDataAttribute()

Adds a data attribute.

public addDataAttribute(string $key, string $value) : mixed
Parameters
$key : string

attribute name (without "data-")

$value : string

attribute value

Return values
mixed

generateHTML()

Prints the HTML code for this element.

public generateHTML(mixed $module, mixed $input, mixed $values, mixed $restricted, mixed $scope) : array<string|int, mixed>
Parameters
$module : mixed

Name of account module

$input : mixed

List of meta-HTML elements

$values : mixed

List of values which override the defaults in $input (name => value)

$restricted : mixed

If true then no buttons will be displayed

$scope : mixed

Account type

Tags
inheritDoc
Return values
array<string|int, mixed>

List of input field names and their type (name => type)

getAccessibilityMarkup()

Returns the markup for the accessibility data.

public getAccessibilityMarkup() : string
Return values
string

markup to be included in HTML tag (starting with space)

getAlignmentString()

Returns the HTML attributes for the alignment.

public getAlignmentString() : string
Return values
string

alignment HTML attributes (e.g. align="right" valign="top")

getColspanString()

Returns the HTML attribute for the colspan.

public getColspanString() : string
Return values
string

colspan HTML attribute (e.g. colspan=3)

getCSSClasses()

Returns the CSS classes of this element.

public getCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed>

$classes CSS class names

getRowspanString()

Returns the HTML attribute for the rowspan.

public getRowspanString() : string
Return values
string

rowspan HTML attribute (e.g. rowspan=3)

getTableCellCSSClasses()

Returns the CSS classes of the surrounding table cell for this element.

public getTableCellCSSClasses() : array<string|int, mixed>
Return values
array<string|int, mixed>

CSS classes

setAccessibilityLabel()

Sets the accessibility label.

public setAccessibilityLabel(string|null $accessibilityLabel) : void
Parameters
$accessibilityLabel : string|null

label

Return values
void

setCSSClasses()

Adds CSS classes to this element.

public setCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
$classes : array<string|int, mixed>

CSS class names

Return values
mixed

setInitialSorting()

Sets the initial sort order.

public setInitialSorting(string $columnName, string $sortOrder) : void
Parameters
$columnName : string

column name

$sortOrder : string

htmlDataTable::SORT_ASC|htmlDataTable::SORT_DESC

Return values
void

setOnRowClick()

Sets the row click handler.

public setOnRowClick(string $callback) : void
Parameters
$callback : string

callback code

Return values
void

setSearchField()

Sets the search field.

public setSearchField(string $searchFieldId) : void
Parameters
$searchFieldId : string

ID of field

Return values
void

setTableCellCSSClasses()

Adds CSS classes to the surrounding table cell for this element.

public setTableCellCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
$classes : array<string|int, mixed>

CSS class names

Return values
mixed

getDataAttributesAsString()

Returns the data attributes as rendered string.

protected getDataAttributesAsString() : string
Return values
string

data attributes

Search results