LEPTON CMS 7.0.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
LEPTON_admin Class Reference

Inherits LEPTON_core.

Inherited by LEPTON_login.

Public Member Functions

 __construct (string $section_name="Pages", string $section_permission='start', bool $auto_header=true, bool $auto_auth=true)
 
 get_permission (string $name, string $type='system')
 
 get_page_details (int $page_id)
 
 get_page_permission (int|array $page, string $action='admin')
 
 get_link_permission (string $title)
 
 print_header ()
 
 print_footer ()
 
 print_success (string|array $message, string $redirect='index.php', bool $auto_footer=true)
 
 print_error (string|array $message, string $link='index.php', bool $auto_footer=true)
 
 getHeaderStorage ()
 
 resetObject ()
 

Static Public Member Functions

static getInstance ()
 
static get_user_details (int $user_id)
 
static getUserPermission (string $sPermissionName="")
 
static userHasAdminRights ()
 

Data Fields

array $header_storage
 
lib_twig_box $oTWIG = null
 

Static Public Attributes

static $instance
 

Protected Attributes

string $section_name = ""
 
string $section_permission = ""
 

Detailed Description

This file is part of LEPTON Core, released under the GNU GPL Please see LICENSE and COPYING files in your package for details, specially for terms and warranties.

NOTICE:LEPTON CMS Package has several different licenses. Please see the individual license in the header of each single file or info.php of modules and templates.

Author
LEPTON Project

Definition at line 27 of file lepton_admin.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $section_name = "Pages",
string  $section_permission = 'start',
bool  $auto_header = true,
bool  $auto_auth = true 
)

Constructor of the class

Authenticate user then auto print the header

Parameters
string$section_nameThe section name.
string$section_permissionThe section permissions belongs too.
bool$auto_headerBoolean to print out the header. Default is 'true'.
bool$auto_authBoolean for the auto authentication. Default is 'true'.

TWIG Template Engine

Droplet support

Definition at line 143 of file lepton_admin.php.

Member Function Documentation

◆ get_link_permission()

get_link_permission ( string  $title)

Returns a system permission for a menu link.

Parameters
string$titleA valid menu item name
Returns
boolean

Definition at line 404 of file lepton_admin.php.

◆ get_page_details()

get_page_details ( int  $page_id)

Get details about a given page via id

Parameters
int$page_idA valid page_id.
Returns
array An assoc array with id, title, menu_title and modif. dates.

Definition at line 327 of file lepton_admin.php.

◆ get_page_permission()

get_page_permission ( int|array  $page,
string  $action = 'admin' 
)

Function get_page_permission takes either a numerical page_id, upon which it looks up the permissions in the database, or an array with keys admin_groups and admin_users

Parameters
int | array$pageA valid page_id
string$actionCurrent backend or frontend user (default "admin")
Returns
boolean

Definition at line 355 of file lepton_admin.php.

◆ get_permission()

get_permission ( string  $name,
string  $type = 'system' 
)

Return a system permission

Parameters
string$nameA name.
string$typeA type - default is 'system'
Returns
boolean

Definition at line 269 of file lepton_admin.php.

◆ get_user_details()

static get_user_details ( int  $user_id)
static

Get details from the database about a given user (id)

Parameters
int$user_idA valid user-id.
Returns
array Assoc. array with the username and displayname

Definition at line 302 of file lepton_admin.php.

◆ getHeaderStorage()

getHeaderStorage ( )
Returns
array

Definition at line 667 of file lepton_admin.php.

◆ getInstance()

static getInstance ( )
static

Return the singleton instance of this class.

Parameters
string$section_nameThe section name.
string$section_permissionThe section permissions belongs too.
bool$auto_headerBoolean to print out the header. Default is 'true'.
bool$auto_authBoolean for the auto authentication. Default is 'true'.
Returns
object The generated instance of theis class

Definition at line 95 of file lepton_admin.php.

◆ getUserPermission()

static getUserPermission ( string  $sPermissionName = "")
static

Test a given permission-name against the systempermissions.

Parameters
string$sPermissionNameAny valid permission-name, e.g. "backend_access"
Returns
boolean

Definition at line 643 of file lepton_admin.php.

◆ print_error()

print_error ( string|array  $message,
string  $link = 'index.php',
bool  $auto_footer = true 
)

Print an error message

Parameters
string | array$messageA string or an array within the error messages.
string$linkA redirect url. Default is "index.php".
bool$auto_footerAn optional boolean to 'print' the footer. Default is true;

Definition at line 606 of file lepton_admin.php.

◆ print_footer()

print_footer ( )

Print the admin backend footer @notice: Aldus - 2023-02-13: Not clear wherever the ob-buffer started! At this point it is not entirely clear whether the backend or the frontend is meant!

Droplet support @notice This is the point! It is not(!) clear wherever the ob-buffer started! At this point it is not entirely clear whether the backend or the frontend is meant!

@notice ob - Level?

Definition at line 517 of file lepton_admin.php.

◆ print_header()

print_header ( )

Print the admin header

Try to get the current version of the backend-theme from the database

Definition at line 426 of file lepton_admin.php.

◆ print_success()

print_success ( string|array  $message,
string  $redirect = 'index.php',
bool  $auto_footer = true 
)

Print a success message which then automatically redirects the user to another page

Parameters
string | array$messageA string within the message, or an array with a couple of messages.
string$redirectA redirect url. Default is "index.php".
bool$auto_footerAn optional flag to 'print' the footer. Default is true.

Definition at line 564 of file lepton_admin.php.

◆ resetObject()

resetObject ( )

Definition at line 672 of file lepton_admin.php.

◆ userHasAdminRights()

static userHasAdminRights ( )
static

Definition at line 652 of file lepton_admin.php.

Field Documentation

◆ $header_storage

array $header_storage
Initial value:
= [
'css' => [],
'js' => [],
'html' => [],
'modules' => []
]

Public header storage for external/internal files of the used modules.

@access public @type array

Definition at line 44 of file lepton_admin.php.

◆ $instance

$instance
static

@type object The reference to the Singleton instance of this class. @notice Keep in mind that a child-object has to have his own one!

Definition at line 81 of file lepton_admin.php.

◆ $oTWIG

lib_twig_box $oTWIG = null

Definition at line 75 of file lepton_admin.php.

◆ $section_name

string $section_name = ""
protected

Definition at line 67 of file lepton_admin.php.

◆ $section_permission

string $section_permission = ""
protected

Definition at line 68 of file lepton_admin.php.


The documentation for this class was generated from the following file: