AdminBody
extends Body
in package
Basic body for administration
Tags
Table of Contents
Properties
- $body : string|null
- $css : array<string, mixed>
- $db : SQL
- $dynamicTag : string|null
- $errors : array<string|int, string>
- $infos : array<string|int, string>
- $nav : AdminNavigation
- $scripts : array<string, mixed>
- $sections : Sections|null
- $title : string
- $user : UserSession
Methods
- __construct() : mixed
- addCss() : void
- Add CSS
- addScript() : void
- Add javascript
- compile() : void
- Print whole page
- getAlert() : string
- Get bootstrap like alert
- getCSS() : array<string, mixed>
- Get CSS
- getScript() : array<string, mixed>
- Get javascript
- checkLogin() : void
- User login and redirect on user homepage
- getFooter() : void
- Html body footer
- getHeader() : void
- Html body header
- getPageContent() : void
- Login form page
- getPageFooter() : void
- Page footer
- getTitle() : string
- Get page title
- loadAlert() : string
- Load and escape error messages
- renderErrors() : void
- Show error alerts
Properties
$body
protected
string|null
$body
= null
$css
protected
array<string, mixed>
$css
= ['FILE' => ['flags/flags.css' => 'all', 'fontawesome-6/all.css' => 'all', 'jquery/jquery-ui-1.13.custom.css' => 'all', 'admin/admin.css' => 'all', 'admin/admin-custom.css' => 'all']]
$db
protected
SQL
$db
$dynamicTag
protected
string|null
$dynamicTag
= null
$errors
protected
array<string|int, string>
$errors
= []
$infos
protected
array<string|int, string>
$infos
= []
$nav
protected
AdminNavigation
$nav
$scripts
protected
array<string, mixed>
$scripts
= ['FILE' => ['jquery/jquery-3.7.1.min.js', 'jquery/jquery-ui-1.13.2.min.js', 'xform/jDialog.js']]
$sections
protected
Sections|null
$sections
$title
protected
string
$title
= 'Administrace'
$user
protected
UserSession
$user
Methods
__construct()
public
__construct(SQL $db, AdminNavigation $nav, UserSession $user[, Sections|null $sections = null ]) : mixed
Parameters
- $db : SQL
- $nav : AdminNavigation
- $user : UserSession
- $sections : Sections|null = null
addCss()
Add CSS
public
final addCss(string $type, string $value[, string $media = 'all' ]) : void
Parameters
- $type : string
-
FILE,CODE
- $value : string
-
depends on type
- $media : string = 'all'
-
css media type
addScript()
Add javascript
public
final addScript(string $type, array<string, mixed>|string|null $value) : void
Parameters
- $type : string
-
FILE,READY,GLOBAL,ARRAY
- $value : array<string, mixed>|string|null
-
depends on type
compile()
Print whole page
public
compile() : void
getAlert()
Get bootstrap like alert
public
static getAlert(string $text[, string $type = 'danger' ]) : string
Parameters
- $text : string
- $type : string = 'danger'
-
alert type
Return values
stringgetCSS()
Get CSS
public
final getCSS() : array<string, mixed>
Return values
array<string, mixed>getScript()
Get javascript
public
final getScript() : array<string, mixed>
Return values
array<string, mixed>checkLogin()
User login and redirect on user homepage
protected
checkLogin() : void
getFooter()
Html body footer
protected
getFooter() : void
getHeader()
Html body header
protected
getHeader() : void
getPageContent()
Login form page
protected
getPageContent() : void
getPageFooter()
Page footer
protected
getPageFooter() : void
getTitle()
Get page title
protected
getTitle([string $split = ' - ' ]) : string
Parameters
- $split : string = ' - '
Return values
stringloadAlert()
Load and escape error messages
protected
loadAlert(string $mark) : string
Parameters
- $mark : string
Return values
stringrenderErrors()
Show error alerts
protected
renderErrors() : void