Phpxforms documentation

BlockHandler extends Handler
in package

Administration Handler for BlockPicker

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

Properties

$action  : string|null
$body  : string|null
$draw  : array<string, int>
$header  : string
$id  : string|int|null
$messages  : array<string, string>
$titles  : array<string, string>
$classForm  : string
$classTable  : string
$comment  : array<string, string>
$controller  : Control
$db  : SQL
$errors  : array<string|int, string>
$fileApi  : FileApi
$filters  : Filters|null
$infos  : array<string|int, string>
$log  : Logger|null
$nav  : AdminNavigation
$primary  : Form
$redirectUrl  : string|null
$sections  : Sections
$sync  : Synchronize|null
$user  : UserSession

Methods

__construct()  : mixed
action()  : void
Do demander action on controller
actionCopy()  : bool
actionDefault()  : bool
actionDelete()  : bool
actionEdit()  : bool
ID checkout is latter for CacheUpload
actionExport()  : bool
actionMultiple()  : void
Actions over multiple Records
actionNew()  : bool
actionReset()  : bool
actionSync()  : bool
Publish new version
actionView()  : bool
compile()  : void
Print module content
getController()  : Control
Retuns controller
getCss()  : array<string, mixed>
Get css for module
getData()  : array<string, mixed>|null
Get specific data for ajax requests
getErrors()  : array<string|int, string>
Returns list of error type messages
getInfos()  : array<string|int, string>
Returns list of information type messages
getPageHeader()  : string
Default header for administration
getPickerForms()  : array<string|int, Form>
getRedirectUrl()  : string|null
getScripts()  : array<string, mixed>
Get javascript
getTitle()  : string
Page title
handle()  : void
Perform given action in controller note: $this->id must be checked in Nette, it is not checked in action
handleMultiple()  : void
Perform given action on multiple records
handleTableMod()  : void
Perform given action from table
initOutside()  : mixed
Start Control for outside usage (testing)
injectSections()  : void
DI Sections
renderAlert()  : void
Show alert dialog
renderForm()  : void
Print form
renderTable()  : void
setComment()  : void
Set comment
createFilters()  : Filters
createFrom()  : FormControl
createTable()  : TableControl
formDelete()  : bool
Delete selected record
formMultiCopy()  : bool
formMultiSave()  : bool
formReset()  : bool
Reset form values
formSave()  : bool
Save POST data
formSync()  : bool
getActionBack()  : array<string, string>
getFormActions()  : array<string, array<string, string>>
getMessage()  : string
Return readable text of error message
getTableActions()  : array<string, mixed>
haveAccess()  : bool
Verify that the module has access to the row
haveRights()  : bool
Check if active user has rights to the selected action
init()  : string|void
Loads form for administration
initStart()  : bool
log()  : void
Log action
parseUrl()  : void
Parse parameters from split url
prepare()  : string|void
Test if module can be run
redirect()  : void
renderFormController()  : void
Print form controller

Properties

$draw

public array<string, int> $draw = ['body' => 1, 'head' => 1, 'alert' => 1, 'menu' => 1]

$id

public string|int|null $id

Url params - current record(s)

$messages

public array<string, string> $messages = ['Record created' => 'Záznam vytvořen', 'Changes saved' => 'Změny uloženy', 'Non-existent record' => 'Neexistující záznam', 'No record selected' => 'Nebyl vybrán žádný záznam', 'Invalid action' => 'Nepovolená akce', 'Unknown action' => 'Neznámá akce', 'No rights to section' => 'K této sekci nemáte přístup', 'No access to record' => 'K tomuto záznamu nemáte přístup', 'No rights to action' => 'K této akci nemáte dostatečná práva']

$titles

public array<string, string> $titles = ['TABLE' => 'Seznam', 'NEW' => 'Nový záznam', 'VIEW' => 'Detail záznamu', 'EDIT' => 'Editace záznamu', 'EDIT_MULTI' => 'Vícenásobná editace', 'COPY' => 'Klonování záznamu', 'COPY_MULTI' => 'Vícenásobné klonování', 'ERROR' => 'Chyba']

$classForm

protected string $classForm = \Form\Controls\FormControl::class

$classTable

protected string $classTable = \Form\Controls\TableControl::class

$comment

protected array<string, string> $comment = []

$errors

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

$infos

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

$redirectUrl

protected string|null $redirectUrl = null

Methods

actionDefault()

public actionDefault() : bool
Tags
throws
Exception
Return values
bool

actionEdit()

ID checkout is latter for CacheUpload

public actionEdit() : bool
Tags
throws
OptionalException|Exception
Return values
bool

compile()

Print module content

public abstract compile() : void

getCss()

Get css for module

public getCss() : array<string, mixed>
Return values
array<string, mixed>

getData()

Get specific data for ajax requests

public getData() : array<string, mixed>|null
Return values
array<string, mixed>|null

getErrors()

Returns list of error type messages

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

getInfos()

Returns list of information type messages

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

getPageHeader()

Default header for administration

public getPageHeader(string $name[, array<string|int, array<string, string>>|null $actions = null ][, string $extra = '' ]) : string
Parameters
$name : string
$actions : array<string|int, array<string, string>>|null = null
$extra : string = ''
Return values
string

getRedirectUrl()

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

getScripts()

Get javascript

public getScripts() : array<string, mixed>
Return values
array<string, mixed>

getTitle()

Page title

public getTitle([string $space = ' - ' ]) : string
Parameters
$space : string = ' - '
Return values
string

handle()

Perform given action in controller note: $this->id must be checked in Nette, it is not checked in action

public handle() : void
Tags
throws
OptionalException|Exception

handleMultiple()

Perform given action on multiple records

public handleMultiple() : void
Tags
throws
OptionalException|Exception

initOutside()

Start Control for outside usage (testing)

public initOutside([bool $formMode = true ]) : mixed
Parameters
$formMode : bool = true

Start in edit mode

renderAlert()

Show alert dialog

public renderAlert(array<string|int, string|int>|string|int $ids, string $text, array<string, array<string, mixed>|string> $buttons) : void
Parameters
$ids : array<string|int, string|int>|string|int
$text : string
$buttons : array<string, array<string, mixed>|string>

renderForm()

Print form

public renderForm([string|null $title = null ][, array<string|int, string>|array<string|int, int>|string|int $ids = '' ][, array<string, mixed>|bool $back = true ]) : void
Parameters
$title : string|null = null
$ids : array<string|int, string>|array<string|int, int>|string|int = ''
$back : array<string, mixed>|bool = true

renderTable()

public renderTable() : void

setComment()

Set comment

public setComment(string $comment[, string $place = 'TABLE' ]) : void
Parameters
$comment : string
$place : string = 'TABLE'

createFilters()

protected createFilters(bool $cookies) : Filters
Parameters
$cookies : bool
Return values
Filters

formDelete()

Delete selected record

protected formDelete(string|int $id) : bool
Parameters
$id : string|int
Return values
bool

formMultiCopy()

protected formMultiCopy(string|int $id) : bool
Parameters
$id : string|int
Return values
bool

formMultiSave()

protected formMultiSave(string|int $id) : bool
Parameters
$id : string|int
Return values
bool

formReset()

Reset form values

protected formReset(string|int $id) : bool
Parameters
$id : string|int
Return values
bool

formSave()

Save POST data

protected formSave() : bool
Return values
bool

formSync()

protected formSync(string|int $id) : bool
Parameters
$id : string|int
Return values
bool

getActionBack()

protected getActionBack(string $url) : array<string, string>
Parameters
$url : string
Return values
array<string, string>

getFormActions()

protected getFormActions([array<string, mixed>|bool $back = true ]) : array<string, array<string, string>>
Parameters
$back : array<string, mixed>|bool = true
Return values
array<string, array<string, string>>

getMessage()

Return readable text of error message

protected getMessage(string $message[, string|null $insert = null ]) : string
Parameters
$message : string
$insert : string|null = null
Return values
string

getTableActions()

protected getTableActions() : array<string, mixed>
Tags
throws
Exception
Return values
array<string, mixed>

haveAccess()

Verify that the module has access to the row

protected haveAccess(array<string|int, string>|array<string|int, int>|string|int $ids[, bool $exception = false ]) : bool
Parameters
$ids : array<string|int, string>|array<string|int, int>|string|int

ID of primary row, can be array

$exception : bool = false

throw exception

Tags
throws
Exception
Return values
bool

can access

haveRights()

Check if active user has rights to the selected action

protected haveRights(string $action[, bool $exception = false ]) : bool
Parameters
$action : string
$exception : bool = false
Tags
throws
OptionalException
Return values
bool

init()

Loads form for administration

protected init(Control $control) : string|void
Parameters
$control : Control
Return values
string|void

initStart()

protected initStart(Control $controller) : bool
Parameters
$controller : Control
Return values
bool

log()

Log action

protected log(string|null $action[, string|null $add = null ][, string|null $detail = null ]) : void
Parameters
$action : string|null
$add : string|null = null
$detail : string|null = null

parseUrl()

Parse parameters from split url

protected parseUrl(array<string|int, string> $param) : void
Parameters
$param : array<string|int, string>

prepare()

Test if module can be run

protected prepare() : string|void
Return values
string|void

redirect()

protected redirect([string|bool $action = false ][, array<string, mixed> $params = null ]) : void
Parameters
$action : string|bool = false
$params : array<string, mixed> = null

renderFormController()

Print form controller

protected renderFormController(array<string|int, string>|array<string|int, int>|string|int $ids) : void
Parameters
$ids : array<string|int, string>|array<string|int, int>|string|int

        
On this page

Search results