AdminTrait uses trait:short, trait:short
Administration pages Trait
Table of Contents
Properties
- $action_buttons : array<string|int, mixed>
- $current_user : array<string|int, mixed>|object|null
- $current_user_model : AccountModel|null
- $current_website : Website|null
- $layout_buttons : array<string|int, mixed>
- $locale : string|null
- $route_info : RouteInfo|null
- $template_data : array<string|int, mixed>
Methods
- addActionButton() : self
- adds an action button
- addActionLink() : self
- adds an action link
- calcTokenId() : string
- calculates JWT token id
- checkPermission() : bool
- checks if current user has permission
- getCurrentUser() : AccountModel|null
- gets current user
- getCurrentWebsite() : Website
- returns current website
- getRouteGroup() : string|null
- gets route group
- getTokenData() : mixed
- gets token data
- hasLoggedUser() : bool
- checks if user is logged in
- isCrud() : bool
- isHomePage() : bool
- checks if current is homepage
- isWeb() : bool
- removeAction() : self
- removes an action link / button
- checkCredentials() : bool
- checks user credentials
- renderActionButtons() : string
- renders action buttons
- renderLayoutButtons() : string
Properties
$action_buttons
protected
array<string|int, mixed>
$action_buttons
= []
action_buttons
$current_user
protected
array<string|int, mixed>|object|null
$current_user
= null
current user data
$current_user_model
protected
AccountModel|null
$current_user_model
= null
current user model
$current_website
protected
Website|null
$current_website
= null
current website model
$layout_buttons
protected
array<string|int, mixed>
$layout_buttons
= []
layout_buttons
$locale
protected
string|null
$locale
= null
locale
$route_info
protected
RouteInfo|null
$route_info
route info object
$template_data
protected
array<string|int, mixed>
$template_data
= []
template data
Methods
addActionButton()
adds an action button
public
addActionButton(string $key, string $button_id, string $button_text[, string $button_class = 'btn btn-sm btn-light' ][, array<string|int, mixed> $attributes = [] ][, int|null $order = null ]) : self
Parameters
- $key : string
- $button_id : string
- $button_text : string
- $button_class : string = 'btn btn-sm btn-light'
- $attributes : array<string|int, mixed> = []
- $order : int|null = null
Return values
selfaddActionLink()
adds an action link
public
addActionLink(mixed $key, mixed $link_id, mixed $link_text[, string $link_href = '#' ][, string $link_class = 'btn btn-sm btn-light' ][, array<string|int, mixed> $attributes = [] ][, int|null $order = null ]) : self
Parameters
- $key : mixed
- $link_id : mixed
- $link_text : mixed
- $link_href : string = '#'
- $link_class : string = 'btn btn-sm btn-light'
- $attributes : array<string|int, mixed> = []
- $order : int|null = null
Return values
selfcalcTokenId()
calculates JWT token id
public
calcTokenId(int $uid, string $username) : string
Parameters
- $uid : int
- $username : string
Return values
stringcheckPermission()
checks if current user has permission
public
checkPermission(string $permission_name) : bool
Parameters
- $permission_name : string
Tags
Return values
boolgetCurrentUser()
gets current user
public
getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
- $reset : bool = false
Tags
Return values
AccountModel|nullgetCurrentWebsite()
returns current website
public
getCurrentWebsite() : Website
Return values
WebsitegetRouteGroup()
gets route group
public
static getRouteGroup() : string|null
Return values
string|nullgetTokenData()
gets token data
public
getTokenData() : mixed
hasLoggedUser()
checks if user is logged in
public
hasLoggedUser() : bool
Tags
Return values
boolisCrud()
public
isCrud(RouteInfo $routeInfo) : bool
Parameters
- $routeInfo : RouteInfo
Return values
boolisHomePage()
checks if current is homepage
public
isHomePage() : bool
Tags
Return values
boolisWeb()
public
isWeb(RouteInfo $routeInfo) : bool
Parameters
- $routeInfo : RouteInfo
Return values
boolremoveAction()
removes an action link / button
public
removeAction(mixed $key) : self
Parameters
- $key : mixed
Return values
selfcheckCredentials()
checks user credentials
protected
checkCredentials() : bool
Tags
Return values
boolrenderActionButtons()
renders action buttons
protected
renderActionButtons() : string
Tags
Return values
stringrenderLayoutButtons()
protected
renderLayoutButtons() : string