PanelController extends BaseController
Controller to edit data through the vertical panel
Table of Contents
$hasData | Indicates if the main view has data or is empty. | bool |
---|---|---|
$tabsPosition | Tabs position in page: left, bottom. | string |
$active | Indicates the active view. | string |
$codeModel | Model to use with select and autocomplete filters. | CodeModel |
$current | Indicates current view, when drawing. | string |
$exportManager | Object to export data. | ExportManager |
$views | List of views displayed by the controller. | \FacturaScripts\Core\Lib\ExtendedController\BaseView[]|\FacturaScripts\Core\Lib\ExtendedController\ListView[] |
$className | Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here) | string |
$dataBase | It provides direct access to the database. | DataBase |
$empresa | Selected company. | Empresa |
$multiRequestProtection | MultiRequestProtection | |
$permissions | User permissions on this controller. | ControllerPermissions |
$request | Request on which we can get data. | Request |
$response | HTTP Response object. | Response |
$template | Name of the file for the template. | string|bool |
$title | Title of the page. | string |
$uri | Given uri, default is empty. | string |
$user | User logged in. | User|bool |
__construct() | Starts all the objects and properties. | mixed |
getImageUrl() | string | |
privateCore() | Runs the controller's private logic. | mixed |
setTabsPosition() | Sets the tabs position, by default is set to 'left', also supported 'bottom' and 'top'. | mixed |
addEditListView() | Adds a EditList type view to the controller. | mixed |
addEditView() | Adds an Edit type view to the controller. | mixed |
addHtmlView() | Adds an HTML type view to the controller. | mixed |
addListView() | Adds a List type view to the controller. | mixed |
editAction() | Runs the data edit action. | bool |
execAfterAction() | Run the controller after actions. | mixed |
execPreviousAction() | Run the actions that alter data before reading it. | bool |
insertAction() | Runs data insert action. | bool |
createViews() | Inserts the views or tabs to display. | mixed |
loadData() | Loads the data to display. | mixed |
__construct() | Initialize all objects and properties. | mixed |
addButton() | Adds a new button to the tab. | mixed |
addCustomView() | mixed | |
getCurrentView() | BaseView|ListView | |
getMainViewName() | Returns the name assigned to the main view | string |
getSettings() | Returns the configuration value for the indicated view. | mixed |
getViewModelValue() | Return the value for a field in the model of the view. | mixed |
privateCore() | Runs the controller's private logic. | mixed |
setCurrentView() | mixed | |
setSettings() | Set value for setting of a view | mixed |
autocompleteAction() | Run the autocomplete action. | array |
checkOwnerData() | Returns true if the active user has permission to view the information of the active record in the informed model. | bool |
deleteAction() | Action to delete data. | bool |
exportAction() | mixed | |
getAutocompleteValues() | Return values from Widget Values for autocomplete action | array |
requestGet() | Return array with parameters values | array |
addExtension() | mixed | |
getPageData() | Return the basic data for this page. | array |
getTemplate() | Return the template to use for this controller. | string|bool |
pipe() | mixed | |
publicCore() | Execute the public part of the controller. | mixed |
redirect() | Redirect to an url or controller. | mixed |
setTemplate() | Set the template to use for this controller. | bool |
toolBox() | ToolBox | |
url() | Return the URL of the actual controller. | string |
checkPHPversion() | mixed | |
getClassName() | Return the name of the controller. | string |
validateFormToken() | Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated | bool |
Properties
$hasData
Indicates if the main view has data or is empty.
public
bool
$hasData
= false
$tabsPosition
Tabs position in page: left, bottom.
public
string
$tabsPosition
$active
Indicates the active view.
public
string
$active
$codeModel
Model to use with select and autocomplete filters.
public
CodeModel
$codeModel
$current
Indicates current view, when drawing.
private
string
$current
$exportManager
Object to export data.
public
ExportManager
$exportManager
$views
List of views displayed by the controller.
public
\FacturaScripts\Core\Lib\ExtendedController\BaseView[]|\FacturaScripts\Core\Lib\ExtendedController\ListView[]
$views
= []
$className
Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)
private
string
$className
$dataBase
It provides direct access to the database.
protected
DataBase
$dataBase
$empresa
Selected company.
public
Empresa
$empresa
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$permissions
User permissions on this controller.
public
ControllerPermissions
$permissions
$request
Request on which we can get data.
public
Request
$request
$response
HTTP Response object.
protected
Response
$response
$template
Name of the file for the template.
private
string|bool
$template
$title
Title of the page.
public
string
$title
$uri
Given uri, default is empty.
public
string
$uri
$user
User logged in.
public
User|bool
$user
= false
Methods
__construct()
Starts all the objects and properties.
public
__construct(
$className :
string
[, $uri :
string
= '' ]
)
: mixed
Parameters
- $className : string
- $uri : string = ''
Return values
mixedgetImageUrl()
public
getImageUrl(
)
: string
Return values
stringprivateCore()
Runs the controller's private logic.
public
privateCore(
&$response :
Response
, $user :
User
, $permissions :
ControllerPermissions
)
: mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
Return values
mixedsetTabsPosition()
Sets the tabs position, by default is set to 'left', also supported 'bottom' and 'top'.
public
setTabsPosition(
$position :
string
)
: mixed
Parameters
- $position : string
Return values
mixedaddEditListView()
Adds a EditList type view to the controller.
protected
addEditListView(
$viewName :
string
, $modelName :
string
, $viewTitle :
string
[, $viewIcon :
string
= 'fas fa-bars' ]
)
: mixed
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fas fa-bars'
Return values
mixedaddEditView()
Adds an Edit type view to the controller.
protected
addEditView(
$viewName :
string
, $modelName :
string
, $viewTitle :
string
[, $viewIcon :
string
= 'fas fa-edit' ]
)
: mixed
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fas fa-edit'
Return values
mixedaddHtmlView()
Adds an HTML type view to the controller.
protected
addHtmlView(
$viewName :
string
, $fileName :
string
, $modelName :
string
, $viewTitle :
string
[, $viewIcon :
string
= 'fab fa-html5' ]
)
: mixed
Parameters
- $viewName : string
- $fileName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fab fa-html5'
Return values
mixedaddListView()
Adds a List type view to the controller.
protected
addListView(
$viewName :
string
, $modelName :
string
, $viewTitle :
string
[, $viewIcon :
string
= 'fas fa-list' ]
)
: mixed
Parameters
- $viewName : string
- $modelName : string
- $viewTitle : string
- $viewIcon : string = 'fas fa-list'
Return values
mixededitAction()
Runs the data edit action.
protected
editAction(
)
: bool
Return values
boolexecAfterAction()
Run the controller after actions.
protected
execAfterAction(
$action :
string
)
: mixed
Parameters
- $action : string
Return values
mixedexecPreviousAction()
Run the actions that alter data before reading it.
protected
execPreviousAction(
$action :
string
)
: bool
Parameters
- $action : string
Return values
boolinsertAction()
Runs data insert action.
protected
insertAction(
)
: bool
Return values
boolcreateViews()
Inserts the views or tabs to display.
protected
abstract createViews(
)
: mixed
Return values
mixedloadData()
Loads the data to display.
protected
abstract loadData(
$viewName :
string
, $view :
BaseView
)
: mixed
Parameters
- $viewName : string
- $view : BaseView
Return values
mixed__construct()
Initialize all objects and properties.
public
__construct(
$className :
string
[, $uri :
string
= '' ]
)
: mixed
Parameters
- $className : string
- $uri : string = ''
Return values
mixedaddButton()
Adds a new button to the tab.
public
addButton(
$viewName :
string
, $btnArray :
array
)
: mixed
Parameters
- $viewName : string
- $btnArray : array
Return values
mixedaddCustomView()
public
addCustomView(
$viewName :
string
, $view :
BaseView|ListView
)
: mixed
Parameters
Return values
mixedgetCurrentView()
public
getCurrentView(
)
: BaseView|ListView
Return values
BaseView|ListViewgetMainViewName()
Returns the name assigned to the main view
public
getMainViewName(
)
: string
Return values
stringgetSettings()
Returns the configuration value for the indicated view.
public
getSettings(
$viewName :
string
, $property :
string
)
: mixed
Parameters
- $viewName : string
- $property : string
Return values
mixedgetViewModelValue()
Return the value for a field in the model of the view.
public
getViewModelValue(
$viewName :
string
, $fieldName :
string
)
: mixed
Parameters
- $viewName : string
- $fieldName : string
Return values
mixedprivateCore()
Runs the controller's private logic.
public
privateCore(
&$response :
Response
, $user :
User
, $permissions :
ControllerPermissions
)
: mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
Return values
mixedsetCurrentView()
public
setCurrentView(
$viewName :
string
)
: mixed
Parameters
- $viewName : string
Return values
mixedsetSettings()
Set value for setting of a view
public
setSettings(
$viewName :
string
, $property :
string
, $value :
mixed
)
: mixed
Parameters
- $viewName : string
- $property : string
- $value : mixed
Return values
mixedautocompleteAction()
Run the autocomplete action.
protected
autocompleteAction(
)
: array
Returns a JSON string for the searched values.
Return values
arraycheckOwnerData()
Returns true if the active user has permission to view the information of the active record in the informed model.
protected
checkOwnerData(
$model :
ModelClass
)
: bool
Parameters
- $model : ModelClass
Return values
booldeleteAction()
Action to delete data.
protected
deleteAction(
)
: bool
Return values
boolexportAction()
protected
exportAction(
)
: mixed
Return values
mixedgetAutocompleteValues()
Return values from Widget Values for autocomplete action
protected
getAutocompleteValues(
$viewName :
string
, $fieldName :
string
)
: array
Parameters
- $viewName : string
- $fieldName : string
Return values
arrayrequestGet()
Return array with parameters values
protected
requestGet(
$keys :
array
)
: array
Parameters
- $keys : array
Return values
arrayaddExtension()
public
static addExtension(
$extension :
mixed
)
: mixed
Parameters
- $extension : mixed
Return values
mixedgetPageData()
Return the basic data for this page.
public
getPageData(
)
: array
Return values
arraygetTemplate()
Return the template to use for this controller.
public
getTemplate(
)
: string|bool
Return values
string|boolpipe()
public
pipe(
$name :
string
, ...$arguments :
array
)
: mixed
Parameters
- $name : string
- $arguments : array
Return values
mixedpublicCore()
Execute the public part of the controller.
public
publicCore(
&$response :
Response
)
: mixed
Parameters
- $response : Response
Return values
mixedredirect()
Redirect to an url or controller.
public
redirect(
$url :
string
, $delay :
int
)
: mixed
Parameters
- $url : string
- $delay : int
Return values
mixedsetTemplate()
Set the template to use for this controller.
public
setTemplate(
$template :
string|bool
)
: bool
Parameters
- $template : string|bool
Return values
booltoolBox()
public
static toolBox(
)
: ToolBox
Return values
ToolBoxurl()
Return the URL of the actual controller.
public
url(
)
: string
Return values
stringcheckPHPversion()
private
checkPHPversion(
$min :
float
)
: mixed
Parameters
- $min : float
Return values
mixedgetClassName()
Return the name of the controller.
protected
getClassName(
)
: string
Return values
stringvalidateFormToken()
Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
protected
validateFormToken(
)
: bool