LEPTON CMS 7.2.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 $page_id, string $action='admin')
 
 get_link_permission (string $title)
 
 getGroupsPermissions (string $what)
 
 getUsersPermissions (string $what)
 
 getPagesPermissions (string $what)
 
 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 ()
 
 userHasAdminToolPermission ()
 

Static Public Member Functions

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

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 146 of file lepton_admin.php.

Member Function Documentation

◆ get_link_permission()

get_link_permission ( string $title)

Returns a system permission for a menu link. See: print_Header(). Line ~490 ff.

Parameters
string$titleA valid menu item name
Returns
boolean

Definition at line 394 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 343 of file lepton_admin.php.

◆ get_page_permission()

get_page_permission ( int $page_id,
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

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

Definition at line 371 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 286 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 318 of file lepton_admin.php.

◆ getGroupsPermissions()

getGroupsPermissions ( string $what)
Parameters
string$whatPossible values are: '*', 'view', 'add', 'modify', 'delete'. Where '*' means "min. one of them", NOT 'all'!
Returns
bool

Definition at line 415 of file lepton_admin.php.

◆ getHeaderStorage()

getHeaderStorage ( )
Returns
array

Definition at line 773 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 97 of file lepton_admin.php.

◆ getPagesPermissions()

getPagesPermissions ( string $what)
Parameters
string$whatPossible values are: '*', 'view', 'add', 'modify', 'delete'. Where '*' means "min. one of them", NOT 'all'!
Returns
bool

Definition at line 489 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 755 of file lepton_admin.php.

◆ getUsersPermissions()

getUsersPermissions ( string $what)
Parameters
string$whatPossible values are: '*', 'view', 'add', 'modify', 'delete'. Where '*' means "min. one of them", NOT 'all'!
Returns
bool

Definition at line 452 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 718 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 629 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 524 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 676 of file lepton_admin.php.

◆ resetObject()

resetObject ( )

Definition at line 778 of file lepton_admin.php.

◆ userHasAdminToolPermission()

userHasAdminToolPermission ( )
Returns
bool True, if the user has at last access to one admintool.

Definition at line 788 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 83 of file lepton_admin.php.

◆ $oTWIG

lib_twig_box $oTWIG = null

Definition at line 77 of file lepton_admin.php.

◆ $section_name

string $section_name = ""
protected

Definition at line 69 of file lepton_admin.php.

◆ $section_permission

string $section_permission = ""
protected

Definition at line 70 of file lepton_admin.php.


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