Documentation

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_website

protected Website|null $current_website = null

current website model

$layout_buttons

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

layout_buttons

$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
self

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
self

calcTokenId()

calculates JWT token id

public calcTokenId(int $uid, string $username) : string
Parameters
$uid : int
$username : string
Return values
string

checkPermission()

checks if current user has permission

public checkPermission(string $permission_name) : bool
Parameters
$permission_name : string
Tags
throws
BasicException
Return values
bool

getCurrentUser()

gets current user

public getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
$reset : bool = false
Tags
throws
DependencyException
NotFoundException
Return values
AccountModel|null

getRouteGroup()

gets route group

public static getRouteGroup() : string|null
Return values
string|null

getTokenData()

gets token data

public getTokenData() : mixed

hasLoggedUser()

checks if user is logged in

public hasLoggedUser() : bool
Tags
throws
DependencyException
NotFoundException
Return values
bool

isHomePage()

checks if current is homepage

public isHomePage() : bool
Tags
throws
BasicException
DependencyException
NotFoundException
PhpfastcacheSimpleCacheException
Return values
bool

removeAction()

removes an action link / button

public removeAction(mixed $key) : self
Parameters
$key : mixed
Return values
self

checkCredentials()

checks user credentials

protected checkCredentials() : bool
Tags
throws
BasicException
Return values
bool

renderActionButtons()

renders action buttons

protected renderActionButtons() : string
Tags
throws
DependencyException
NotFoundException
Return values
string

renderLayoutButtons()

protected renderLayoutButtons() : string
Return values
string

        
On this page

Search results