Documentation

Toggle extends Ajax
in package

Toggle a flag field in a bean

Table of Contents

$context  : Context
$controller  : Ajax
$permissions  : array<string|int, mixed>
__construct()  : mixed
Constructor
handle()  : void
Handle AJAX operations
requires()  : array<string|int, mixed>
Return permission requirements
checkAccess()  : void
Check access to a bean
fieldExists()  : bool
Check that a bean has a field. Do not allow id field to be manipulated.
restCheck()  : array<string|int, mixed>
Check URL string for n parameter values and pull them out
checkPerms()  : void
Check that user has the permissions that are specified in an array

Properties

$permissions

private static array<string|int, mixed> $permissions = [ ConfigFramework::CONFIG => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['local', 'fixed', 'defer', 'async']], ConfigFramework::FORM => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['multipart']], // FW::FORMFIELD => [ TRUE, [[FW::FWCONTEXT, FW::ADMINROLE]], [] ], ConfigFramework::PAGE => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['needlogin', 'mobileonly', 'active', 'needajax', 'needfwutils', 'needparsley', 'neededitable']], ConfigFramework::ROLECONTEXT => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['fixed']], ConfigFramework::ROLENAME => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['fixed']], // FW::TABLE => [ TRUE, [[FW::FWCONTEXT, FW::ADMINROLE]], [] ], ConfigFramework::TEST => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::DEVELROLE]], ['tog']], // table does not always exist ConfigFramework::USER => [TRUE, [[ConfigFramework::FWCONTEXT, ConfigFramework::ADMINROLE]], ['active', 'confirm', ConfigFramework::ADMINROLE, ConfigFramework::DEVELROLE]], ]

Methods

__construct()

Constructor

public __construct(Context $context, Ajax $controller) : mixed
Parameters
$context : Context
$controller : Ajax
Return values
mixed

handle()

Handle AJAX operations

public abstract handle() : void
Return values
void

requires()

Return permission requirements

public requires() : array<string|int, mixed>
Return values
array<string|int, mixed>

checkAccess()

Check access to a bean

protected final checkAccess(OODBBean|null $user, array<string|int, mixed> $permissions, string $bean[, string $field = '' ][, bool $idOK = FALSE ]) : void
Parameters
$user : OODBBean|null
$permissions : array<string|int, mixed>
$bean : string
$field : string = ''
$idOK : bool = FALSE
Tags
throws
Forbidden
Return values
void

fieldExists()

Check that a bean has a field. Do not allow id field to be manipulated.

protected final fieldExists(string $type, string $field[, bool $idok = FALSE ]) : bool
Parameters
$type : string

The type of bean

$field : string

The field name

$idok : bool = FALSE

Allow the id field

Tags
throws
BadValue
Return values
bool

restCheck()

Check URL string for n parameter values and pull them out

protected restCheck(int $count) : array<string|int, mixed>

The value in $rest[0] is assumed to be an opcode so we always start at $rest[1]

Parameters
$count : int

The number to check for

Tags
throws
ParameterCount
Return values
array<string|int, mixed>

The parameter values in an array indexed from 0 with last parameter, anything left in an array

checkPerms()

Check that user has the permissions that are specified in an array

private checkPerms(OODBBean|null $user, array<string|int, mixed> $pairs) : void
Parameters
$user : OODBBean|null

The current user or NULL

$pairs : array<string|int, mixed>

The permission array

Tags
throws
Forbidden
psalm-suppress

PossiblyNullReference

Return values
void

Search results