include/SugarObjects/templates/file/controller.php
\FileController
Main SugarCRM controller
- Parent(s)
- \SugarController
Properties
bool
$_processed= 'false'
Whether or not the action has been handled by $process_tasks
Inherited from: \SugarController::$$_processedfalse
Details- Type
- bool
- Inherited_from
- \SugarController::$$_processed
$action_case_file= 'array(
'editview'=>'EditView',
'detailview'=>'DetailView',
'listview'=>'ListView'
)'
Map case sensitive filenames to action. This is used for linux/unix systems where filenames are case sensitive
Inherited from: \SugarController::$$action_case_filearray(
'editview'=>'EditView',
'detailview'=>'DetailView',
'listview'=>'ListView'
)
Details- Type
- n/a
- Inherited_from
- \SugarController::$$action_case_file
$action_file_map= 'array()'
Map an action directly to a file. This will be loaded from action_file_map.php
Inherited from: \SugarController::$$action_file_maparray()
Details- Type
- n/a
- Inherited_from
- \SugarController::$$action_file_map
$action_remap= 'array('index'=>'listview')'
remap actions in here e.g. make all detail views go to edit views $action_remap = array('detailview'=>'editview');
Inherited from: \SugarController::$$action_remaparray('index'=>'listview')
Details- Type
- n/a
- Inherited_from
- \SugarController::$$action_remap
$action_view_map= 'array()'
Map an action directly to a view. This will be loaded from action_view_map.php
Inherited from: \SugarController::$$action_view_maparray()
Details- Type
- n/a
- Inherited_from
- \SugarController::$$action_view_map
$do_action= ''index''
If the action was remapped it will be set to do_action and then we will just use do_action for the actual action to perform.
Inherited from: \SugarController::$$do_action'index'
Details- Type
- n/a
- Inherited_from
- \SugarController::$$do_action
$hasAccess= 'true'
This can be set from the application to tell us whether we have authorization to process the action. If this is set we will default to the noaccess view.
Inherited from: \SugarController::$$hasAccesstrue
Details- Type
- n/a
- Inherited_from
- \SugarController::$$hasAccess
$process_tasks= 'array(
'blockFileAccess',
'handleEntryPoint',
'remapWirelessAction',
'callLegacyCode',
'remapAction',
'handle_action',
'handleActionMaps',
)'
List of options to run through within the process() method.
Inherited from: \SugarController::$$process_tasksThis list is meant to easily allow additions for new functionality as well as the ability to add a controller's own handling.
array(
'blockFileAccess',
'handleEntryPoint',
'remapWirelessAction',
'callLegacyCode',
'remapAction',
'handle_action',
'handleActionMaps',
)
Details- Type
- n/a
- Inherited_from
- \SugarController::$$process_tasks
$return_action= 'null'
null
Details- Type
- n/a
- Inherited_from
- \SugarController::$$return_action
$return_module= 'null'
null
Details- Type
- n/a
- Inherited_from
- \SugarController::$$return_module
$target_module= 'null'
null
Details- Type
- n/a
- Inherited_from
- \SugarController::$$target_module
$tasks= 'array(
'pre_action',
'do_action',
'post_action'
)'
This array holds the methods that handleAction() will invoke, in sequence.
Inherited from: \SugarController::$$tasksarray(
'pre_action',
'do_action',
'post_action'
)
Details- Type
- n/a
- Inherited_from
- \SugarController::$$tasks
$view= ''classic''
any subcontroller can modify this to change the view
Inherited from: \SugarController::$$view'classic'
Details- Type
- n/a
- Inherited_from
- \SugarController::$$view
$view_object_map= 'array()'
this array will hold the mappings between a key and an object for use within the view.
Inherited from: \SugarController::$$view_object_maparray()
Details- Type
- n/a
- Inherited_from
- \SugarController::$$view_object_map
Methods
SugarController(
)
:
void
Constructor. This ie meant tot load up the module, action, record as well as the mapping arrays.
Inherited from: \SugarController::SugarController()action_callmethoddashlet(
)
:
void
this method id used within a Dashlet when performing an ajax call
Inherited from: \SugarController::action_callmethoddashlet()action_configuredashlet(
)
:
void
this method is used within a Dashlet when the options configuration is posted
Inherited from: \SugarController::action_configuredashlet()action_default(
)
:
void
Action to handle when using a file as was done in previous versions of Sugar.
Inherited from: \SugarController::action_default()action_deleteattachment(
)
:
void
Global method to delete an attachment
Inherited from: \SugarController::action_deleteattachment()If the bean does not have a deleteAttachment method it will return 'false' as a string
blockFileAccess(
)
:
true
Given the module and action, determine whether the super/admin has prevented access to this url. In addition if any links specified for this module, load the links into GLOBALS
Inherited from: \SugarController::blockFileAccess()Type | Description |
---|---|
true | if we want to stop processing, false if processing should continue |
callLegacyCode(
)
:
void
Meant to handle old views e.g. DetailView.php.
Inherited from: \SugarController::callLegacyCode()checkEntryPointRequiresAuth(
\$entrypoint $entryPoint
)
:
bool
Checks to see if the requested entry point requires auth
Inherited from: \SugarController::checkEntryPointRequiresAuth()Name | Type | Description |
---|---|---|
$entryPoint | \$entrypoint | string name of the entrypoint |
Type | Description |
---|---|
bool | true if auth is required, false if not |
execute(
)
:
void
This method is called from SugarApplication->execute and it will bootstrap the entire controller process
Inherited from: \SugarController::execute()handleActionMaps(
)
:
void
If the action has been remapped to a different action as defined in action_file_map.php or action_view_map.php load those maps here.
Inherited from: \SugarController::handleActionMaps()handleEntryPoint(
)
:
void
This code is part of the entry points reworking. We have consolidated all entry points to go through index.php. Now in order to bring up an entry point it will follow the format: 'index.php?entryPoint=download' the download entry point is mapped in the following file: entry_point_registry.php
Inherited from: \SugarController::handleEntryPoint()handle_action(
)
:
true
This method is called from the process method. I could also be called within an action_* method.
Inherited from: \SugarController::handle_action()It allows a developer to override any one of these methods contained within, or if the developer so chooses they can override the entire action_* method.
Type | Description |
---|---|
true | if any one of the pre_, do_, or post_ methods have been defined, false otherwise. This is important b/c if none of these methods exists, then we will run the action_default() method. |
hasFunction(
\function $function
)
:
true
Determine if a given function exists on the objects
Inherited from: \SugarController::hasFunction()Name | Type | Description |
---|---|---|
$function | \function |
|
Type | Description |
---|---|
true | if the method exists on the object, false otherwise |
loadBean(
)
:
void
Given a record id load the bean. This bean is accessible from any sub controllers.
Inherited from: \SugarController::loadBean()loadMapping(
$var, $merge
=
false
)
:
void
Generic load method to load mapping arrays.
Inherited from: \SugarController::loadMapping()Name | Type | Description |
---|---|---|
$var | ||
$merge |
loadMappings(
)
:
void
Load map files for use within the Controller
Inherited from: \SugarController::loadMappings()loadPropertiesFromRequest(
)
:
void
Set properties on the Controller from the $_REQUEST
Inherited from: \SugarController::loadPropertiesFromRequest()no_access(
)
:
void
The default action handler for instances where we do not have access to process.
Inherited from: \SugarController::no_access()no_action(
)
:
void
If there is no action found then display an error to the user.
Inherited from: \SugarController::no_action()post_action(
)
:
void
Perform an action after to the specified action has occurred.
Inherited from: \SugarController::post_action()This can be overridde in a sub-class
post_delete(
)
:
void
Specify what happens after the deletion has occurred.
Inherited from: \SugarController::post_delete()post_massupdate(
)
:
void
Specify what happens after the massupdate has occurred.
Inherited from: \SugarController::post_massupdate()post_save(
)
:
void
Specify what happens after the save has occurred.
Inherited from: \SugarController::post_save()preProcess(
)
:
void
Meant to be overridden by a subclass and allows for specific functionality to be injected prior to the process() method being called.
Inherited from: \SugarController::preProcess()pre_action(
)
:
void
Perform an action prior to the specified action.
Inherited from: \SugarController::pre_action()This can be overridde in a sub-class
pre_save(
)
:
void
Do some processing before saving the bean to the database.
Inherited from: \SugarController::pre_save()process(
)
:
void
if we have a function to support the action use it otherwise use the default action
Inherited from: \SugarController::process()1) check for file 2) check for action
remapWirelessAction(
)
:
void
Remap the action to the wireless equivalent if the module supports it and the user is on a mobile device. Also, map wireless actions to normal ones if the user is not using a wireless device.
Inherited from: \SugarController::remapWirelessAction()set_redirect(
string $url
)
:
void
Set the url to which we will want to redirect
Inherited from: \SugarController::set_redirect()Name | Type | Description |
---|---|---|
$url | string | url - the url to which we will want to redirect |
setup(
$module
=
''
)
:
void
Called from SugarApplication and is meant to perform the setup operations on the controller.
Inherited from: \SugarController::setup()Name | Type | Description |
---|---|---|
$module |