Phpxforms documentation

MediaDbHandler extends AdminModule
in package
Uses AlertForm

AbstractYes

Administration handler for media database

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  : int|null
$messages  : array<string, string>
$browser  : MediaDbBrowser|null
$browserOnly  : bool
$db  : SQL
$editor  : MediaDbEditor|null
$errors  : array<string|int, string>
$fileApi  : FileApi
$infos  : array<string|int, string>
$log  : Logger|null
$mediaDb  : MediaDb
$multiSelect  : bool
$nav  : AdminNavigation
$redirectUrl  : string|null
$sizeId  : int
$user  : UserSession

Methods

__construct()  : mixed
action()  : void
compile()  : void
Print module content
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
getRedirectUrl()  : string|null
getScripts()  : array<string, mixed>
Get javascript
getTitle()  : string
Page title
handle()  : void
initOutside()  : void
Start Control for outside usage (testing)
renderAlert()  : void
Prints alert form
getButtons()  : string
Prints dialog action buttons
getMessage()  : string
Return readable text of error message
handleDelete()  : void
Delete item from media database
handleModifySize()  : void
handlePreview()  : void
handleUpdate()  : void
handleUpload()  : void
haveRights()  : bool
Check if active user has rights to the selected action
log()  : void
Log action
parseUrl()  : void
Parse url for record identification and browser settings
prepare()  : string|void
redirect()  : void
renderBrowser()  : void
renderConfirm()  : void

Properties

$draw

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

$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']

$errors

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

$infos

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

$redirectUrl

protected string|null $redirectUrl = null

Methods

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

initOutside()

Start Control for outside usage (testing)

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

Start in edit mode

renderAlert()

Prints alert form

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

getButtons()

Prints dialog action buttons

protected getButtons(array<string, array<string, mixed>> $buttons) : string
Parameters
$buttons : array<string, array<string, mixed>>
Return values
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

handleDelete()

Delete item from media database

protected handleDelete(int $id) : void
Parameters
$id : int

handleModifySize()

protected handleModifySize(int $id) : void
Parameters
$id : int

handlePreview()

protected handlePreview(int $id) : void
Parameters
$id : int

handleUpdate()

protected handleUpdate(int $id) : void
Parameters
$id : int

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

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 url for record identification and browser settings

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

prepare()

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

redirect()

protected redirect([mixed $place = true ][, array<string|int, mixed> $params = null ]) : void
Parameters
$place : mixed = true
$params : array<string|int, mixed> = null

renderConfirm()

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

        
On this page

Search results