EditPageOption
extends Controller
in package
Edit option for any page.
Tags
Table of Contents
Properties
- $backPage : string
- Contains the url to go back.
- $columns : array<string|int, mixed>
- $empresa : Empresa
- Empresa seleccionada.
- $modals : array<string|int, mixed>
- $model : PageOption
- Details of the view configuration
- $multiRequestProtection : MultiRequestProtection
- $permissions : ControllerPermissions
- Permisos del usuario sobre este controlador.
- $request : Request
- Petición de la que podemos obtener datos.
- $rows : array<string|int, mixed>
- $selectedUser : string
- Selected user, for which the controller columns are created or modified
- $selectedViewName : string
- Selected view, for which columns are created or modified
- $title : string
- Título de la página.
- $uri : string
- URI dada, por defecto vacía.
- $user : User|false
- Usuario que ha iniciado sesión.
- $dataBase : DataBase
- Proporciona acceso directo a la base de datos.
- $response : Response
- Objeto de respuesta HTTP.
Methods
- __construct() : mixed
- Inicializa todos los objetos y propiedades.
- addExtension() : mixed
- getPageData() : array<string|int, mixed>
- Devuelve los datos básicos de esta página (nombre, título, icono, menú, etc.).
- getTemplate() : string|false
- Devuelve la plantilla a usar para este controlador.
- getUserList() : array<string|int, mixed>
- Get the list of users, excluding the user admin
- pipe() : mixed
- pipeFalse() : bool
- privateCore() : mixed
- Runs the controller's private logic.
- publicCore() : mixed
- Ejecuta la parte pública del controlador.
- redirect() : mixed
- Redirige a una url o controlador.
- request() : Request
- run() : void
- setTemplate() : bool
- Establece la plantilla a usar para este controlador.
- url() : string
- Devuelve la URL del controlador actual.
- db() : DataBase
- deleteAction() : void
- Delete configuration for view
- getClassName() : string
- Devuelve el nombre del controlador.
- loadPageOptions() : void
- Load the display options to edit.
- loadSelectedViewName() : void
- response() : Response
- saveAction() : void
- Save new configuration for view
- setCompany() : void
- Selecciona la empresa indicada, salvo que esté vacía o ya sea la cargada.
- validateFormToken() : bool
- Comprueba el token de la petición. Devuelve un error si: - el token no existe - el token no es válido - el token está duplicado
- loadPageOptionsForAll() : bool
- Loads the general display options for all users, and indicates if they exist or not.
- loadPageOptionsForUser() : bool
- Loads the display options specific to the user.
- setBackPage() : void
- setColumnOption() : void
Properties
$backPage
Contains the url to go back.
public
string
$backPage
$columns
public
array<string|int, mixed>
$columns
= []
$empresa
Empresa seleccionada.
public
Empresa
$empresa
$modals
public
array<string|int, mixed>
$modals
= []
$model
Details of the view configuration
public
PageOption
$model
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$permissions
Permisos del usuario sobre este controlador.
public
ControllerPermissions
$permissions
$request
Petición de la que podemos obtener datos.
public
Request
$request
$rows
public
array<string|int, mixed>
$rows
= []
$selectedUser
Selected user, for which the controller columns are created or modified
public
string
$selectedUser
$selectedViewName
Selected view, for which columns are created or modified
public
string
$selectedViewName
$title
Título de la página.
public
string
$title
título de la página.
$uri
URI dada, por defecto vacía.
public
string
$uri
$user
Usuario que ha iniciado sesión.
public
User|false
$user
= false
$dataBase
Proporciona acceso directo a la base de datos.
protected
DataBase
$dataBase
$response
Objeto de respuesta HTTP.
protected
Response
$response
Methods
__construct()
Inicializa todos los objetos y propiedades.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addExtension()
public
static addExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getPageData()
Devuelve los datos básicos de esta página (nombre, título, icono, menú, etc.).
public
getPageData() : array<string|int, mixed>
Esta función solamente sirve para eso. No se debe añadir aquí ningún otro código, ya que en este punto el usuario ni siquiera se ha logueado todavía.
Return values
array<string|int, mixed>getTemplate()
Devuelve la plantilla a usar para este controlador.
public
getTemplate() : string|false
Return values
string|falsegetUserList()
Get the list of users, excluding the user admin
public
getUserList() : array<string|int, mixed>
Return values
array<string|int, mixed>pipe()
public
pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
pipeFalse()
public
pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
boolprivateCore()
Runs the controller's private logic.
public
privateCore(Response &$response, User $user, ControllerPermissions $permissions) : mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
publicCore()
Ejecuta la parte pública del controlador.
public
publicCore(Response &$response) : mixed
Parameters
- $response : Response
redirect()
Redirige a una url o controlador.
public
redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
- $url : string
- $delay : int = 0
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setTemplate()
Establece la plantilla a usar para este controlador.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
boolurl()
Devuelve la URL del controlador actual.
public
url() : string
Return values
stringdb()
protected
db() : DataBase
Return values
DataBasedeleteAction()
Delete configuration for view
protected
deleteAction() : void
getClassName()
Devuelve el nombre del controlador.
protected
getClassName() : string
Return values
stringloadPageOptions()
Load the display options to edit.
protected
loadPageOptions() : void
If it does not find them in the database, it loads the default options of the xml view.
loadSelectedViewName()
protected
loadSelectedViewName() : void
response()
protected
response() : Response
Return values
ResponsesaveAction()
Save new configuration for view
protected
saveAction() : void
setCompany()
Selecciona la empresa indicada, salvo que esté vacía o ya sea la cargada.
protected
setCompany(int|null $idempresa) : void
Parameters
- $idempresa : int|null
validateFormToken()
Comprueba el token de la petición. Devuelve un error si: - el token no existe - el token no es válido - el token está duplicado
protected
validateFormToken() : bool
Return values
boolloadPageOptionsForAll()
Loads the general display options for all users, and indicates if they exist or not.
private
loadPageOptionsForAll() : bool
Return values
boolloadPageOptionsForUser()
Loads the display options specific to the user.
private
loadPageOptionsForUser() : bool
If they do not exist, look for the display options common to all users. In either case, it indicates whether it has found a configuration.
Return values
boolsetBackPage()
private
setBackPage() : void
setColumnOption()
private
setColumnOption(array<string|int, mixed> &$column, string $name, string $key, bool $isWidget, bool $allowEmpty) : void
Parameters
- $column : array<string|int, mixed>
- $name : string
- $key : string
- $isWidget : bool
- $allowEmpty : bool