AdminModule
in package
AbstractYes
Administration - support functions for administration
Tags
Table of Contents
Properties
- $action : string|null
- $body : string|null
- $draw : array<string, int>
- $header : string
- $messages : array<string, string>
- $db : SQL
- $errors : array<string|int, string>
- $fileApi : FileApi
- $infos : array<string|int, string>
- $log : Logger|null
- $nav : AdminNavigation
- $redirectUrl : string|null
- $user : UserSession
Methods
- __construct() : mixed
- 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
- initOutside() : mixed
- Start Control for outside usage (testing)
- getMessage() : string
- Return readable text of error message
- haveRights() : bool
- Check if active user has rights to the selected action
- log() : void
- Log action
- parseUrl() : void
- Parse parameters from split url
Properties
$action
public
string|null
$action
$body
public
string|null
$body
= null
$draw
public
array<string, int>
$draw
= ['body' => 1, 'head' => 1, 'alert' => 1, 'menu' => 1]
$header
public
string
$header
= ''
$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']
$db
protected
SQL
$db
$errors
protected
array<string|int, string>
$errors
= []
$fileApi
protected
FileApi
$fileApi
$infos
protected
array<string|int, string>
$infos
= []
$log
protected
Logger|null
$log
$nav
protected
AdminNavigation
$nav
$redirectUrl
protected
string|null
$redirectUrl
= null
$user
protected
UserSession
$user
Methods
__construct()
public
__construct(SQL $db, AdminNavigation $nav, UserSession $user[, FileApi|null $fileApi = null ][, Logger|null $log = null ]) : mixed
Parameters
- $db : SQL
- $nav : AdminNavigation
- $user : UserSession
- $fileApi : FileApi|null = null
- $log : Logger|null = null
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>|nullgetErrors()
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
stringgetRedirectUrl()
public
getRedirectUrl() : string|null
Return values
string|nullgetScripts()
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
stringinitOutside()
Start Control for outside usage (testing)
public
initOutside([bool $formMode = true ]) : mixed
Parameters
- $formMode : bool = true
-
Start in edit mode
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
stringhaveRights()
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
Return values
boollog()
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>