Phpxforms documentation

Filters
in package

Filtering support in administration tables

Tags
author

DaVee

version
0.87dev
license

Lesser General Public License 2.1 or later; see http://www.gnu.org/licenses/lgpl-2.1.html

Table of Contents

Constants

INP_CHECK  = 'check'
INP_CUSTOM  = 'custom'
INP_NUMBER  = 'number'
INP_OPTION  = 'option'
INP_TEXT  = 'text'

Properties

$exportTypes  : array<string, string>
$optionNumber  : array<string|int, array<string, string>>
$columns  : array<string, array<string, mixed>>
$cookieColumns  : array<string|int, string>
$cookieFilter  : array<string|int, array<string|int, string>>
$cookieSearch  : array<string|int, string>
$filters  : array<string, array<string, mixed>>
$groups  : array<string|int, array<string|int, string>>
$groupsTitle  : array<string|int, string>
$load  : string|null
$nav  : AdminNavigation

Methods

__construct()  : mixed
getFilter()  : string|null
Returns SQL conditions for active filters
getScript()  : string|null
Returns javascript for interaction with filters
getSearch()  : string|null
Returns SQL conditions for active search requests
isCustomColumns()  : bool
Check if custom columns is active
loadInputs()  : void
Load inputs from forms
render()  : void
Print tabs for columns, filters, search and optional export
showColumn()  : bool
Should be the selected column be visible in table view
addInput()  : void
Add input
getSelect()  : string
Returns input select element
loadColumn()  : bool
Load Column setting from cookie
loadCookies()  : void
Read settings from cookies
loadFilter()  : array<string|int, array<string|int, string>|string>
Load Filter setting from cookie
loadPost()  : void
Remove settings from cookies and load them from post, if sent
renderColumns()  : void
Prints all allowed columns for display/hide in table view
renderFilter()  : string|null
Prints selected filter
renderFilters()  : void
Prints active filters
renderSearch()  : void
Prints (full) search input
setCookies()  : void
Save settings into cookies

Constants

INP_CHECK

public mixed INP_CHECK = 'check'

INP_CUSTOM

public mixed INP_CUSTOM = 'custom'

INP_NUMBER

public mixed INP_NUMBER = 'number'

INP_OPTION

public mixed INP_OPTION = 'option'

INP_TEXT

public mixed INP_TEXT = 'text'

Properties

$exportTypes

public static array<string, string> $exportTypes = ['csv' => 'CSV', 'html' => 'HTML', 'ods' => 'ODS', 'xlsx' => 'XLSX']

$optionNumber

public static array<string|int, array<string, string>> $optionNumber = [0 => ['NAME' => 'od', 'SQL' => '>='], 1 => ['NAME' => 'rovno', 'SQL' => '='], 2 => ['NAME' => 'do', 'SQL' => '<=']]

Number options

$columns

protected array<string, array<string, mixed>> $columns = []

$cookieColumns

protected array<string|int, string> $cookieColumns = []

$cookieFilter

protected array<string|int, array<string|int, string>> $cookieFilter = []

$cookieSearch

protected array<string|int, string> $cookieSearch = []

$filters

protected array<string, array<string, mixed>> $filters = []

$groups

protected array<string|int, array<string|int, string>> $groups = []

$groupsTitle

protected array<string|int, string> $groupsTitle = []

$load

protected string|null $load

Filter mode

Methods

__construct()

public __construct(AdminNavigation $nav, string $mark[, string|null $show = null ][, bool $cookies = true ]) : mixed
Parameters
$nav : AdminNavigation
$mark : string
$show : string|null = null
$cookies : bool = true

getFilter()

Returns SQL conditions for active filters

public getFilter(string $mark) : string|null
Parameters
$mark : string
Return values
string|null

getScript()

Returns javascript for interaction with filters

public getScript() : string|null
Return values
string|null

getSearch()

Returns SQL conditions for active search requests

public getSearch(string $mark, int $formId) : string|null
Parameters
$mark : string
$formId : int
Return values
string|null

isCustomColumns()

Check if custom columns is active

public isCustomColumns() : bool
Return values
bool

loadInputs()

Load inputs from forms

public loadInputs(array<string|int, Form$forms) : void
Parameters
$forms : array<string|int, Form>

render()

Print tabs for columns, filters, search and optional export

public render([bool $export = false ]) : void
Parameters
$export : bool = false

showColumn()

Should be the selected column be visible in table view

public showColumn(string $mark) : bool
Parameters
$mark : string
Return values
bool

addInput()

Add input

protected addInput(string $mark, Input $input, string|int $id) : void
Parameters
$mark : string
$input : Input
$id : string|int

getSelect()

Returns input select element

protected static getSelect(string|null $elmId, string $name, array<string|int, string|int> $list[, string $select = '' ]) : string
Parameters
$elmId : string|null
$name : string
$list : array<string|int, string|int>
$select : string = ''
Return values
string

loadColumn()

Load Column setting from cookie

protected loadColumn(string $mark, bool $show) : bool
Parameters
$mark : string
$show : bool
Return values
bool

loadCookies()

Read settings from cookies

protected loadCookies(string $mark, string $module) : void
Parameters
$mark : string
$module : string

loadFilter()

Load Filter setting from cookie

protected loadFilter(string $mark, array<string, string>|string $type) : array<string|int, array<string|int, string>|string>
Parameters
$mark : string
$type : array<string, string>|string
Return values
array<string|int, array<string|int, string>|string>

loadPost()

Remove settings from cookies and load them from post, if sent

protected loadPost() : void

renderColumns()

Prints all allowed columns for display/hide in table view

protected renderColumns() : void

renderFilter()

Prints selected filter

protected renderFilter(string $elmId, string $mark, Input $input[, array<string|int, string>|string $value = '' ]) : string|null
Parameters
$elmId : string
$mark : string
$input : Input
$value : array<string|int, string>|string = ''
Return values
string|null

renderFilters()

Prints active filters

protected renderFilters() : void

renderSearch()

Prints (full) search input

protected renderSearch() : void

setCookies()

Save settings into cookies

protected setCookies(string $mark, string $module) : void
Parameters
$mark : string
$module : string

        
On this page

Search results