Actions

Plugin events: Difference between revisions

From LimeSurvey Manual

(Created page with "At version 2.05RC1 the following events are available for plugins to subscribe to: *afterAdminMenuLoad *afterLoginFormSubmit *afterLogout *afterPluginLoad *afterSurveyComplete...")
 
 
(87 intermediate revisions by 13 users not shown)
Line 1: Line 1:
At version 2.05RC1 the following events are available for plugins to subscribe to:
As of version 5 the following events are available for plugins to subscribe to:
*afterAdminMenuLoad
 
*afterLoginFormSubmit
== Global Events ==
*afterLogout
 
*afterPluginLoad
*[[afterFindSurvey]]
*afterSurveyComplete
*[[afterGenerateToken]]
*beforeActivate
*[[afterPluginLoad]]
*beforeDeactivate
*[[afterQuickMenuLoad]]
*beforeLogin
*[[afterSurveyActivate]]
*beforeLogout
*[[afterSurveyComplete]]
*beforePermissionSetSave
*[[afterSurveyDeactivate]]
*beforeSurveySettings
*[[afterSurveyQuestionAssessment]]
*listExportOptions
*[[afterSurveyQuota]]
*listExportPlugins
*[[afterSurveySettingsSave]]
*listQuestionPlugins
*[[beforeActivate]]
*newDirectRequest
*[[beforeAdminMenuRender]]
*newExport
*[[beforeEmail]]
*newLoginForm
*[[beforeCloseHtml]]
*newSurveySettings
*[[beforeControllerAction]]
*newUserSession
*[[beforeDeactivate]]
*[[beforeHasPermission]]
*[[beforeLoadResponse]]
*[[beforePermissionSetSave]]
*[[beforePluginManagerMenuRender]]
*[[beforeQuestionRender]]
*[[beforeRegister]]
*[[beforeRegisterForm]]
*[[beforeSideMenuRender]]
*[[beforeSurveyAdminView]]
*[[beforeSurveyActivate]]
*[[beforeSurveyBarRender]]
*[[beforeSurveyDeactivate]]
*[[beforeSurveyEmail]]
*[[beforeSurveyPage]]
*[[beforeSurveySettings]]
*[[beforeSurveysStartpageRender]]{{DeprecatedIn|v=3.0.0}}
*[[beforeTokenEmail]]
*[[beforeTwigRenderTemplate]]
*[[beforeToolsMenuRender]]
*[[beforeUrlCheck]]
*[[beforeWelcomePageRender]]
*[[createNewUser]]
*[[createRandomPassword]]
*[[checkPasswordRequirement]]
*[[ExpressionManagerStart]]
*[[getGlobalBasePermissions]]
*[[getPluginTwigPath]]
*[[getValidScreenFiles]]
*[[listExportOptions]]
*[[listExportPlugins]]
*[[listQuestionPlugins]]
*[[newDirectRequest]]
*[[newExport]]
*[[NewQuestionAttributes|newQuestionAttributes]]
*[[newSurveySettings]]
*[[newUnsecureRequest|NewUnsecureRequest]]
*[[onSurveyDenied]]
*[[setVariableExpressionEnd]]
*[[saveSurveyForm]]{{NewIn|v=5.3.8}}
 
== CLI Events ==
 
This events needs to be called with php cli command.
 
*[[cron (command)|cron]]
*[[direct (command)|direct]]
 
== Authentification related events ==
 
*[[newLoginForm]]
*[[Authentication plugin development#afterLoginFormSubmit|afterLoginFormSubmit]]
*[[afterSuccessfulLogin]]
*[[newUserLogin]]
*[[newUserSession]]
*[[Authentication plugin development#afterLogout|afterLogout]]
*[[afterFailedLoginAttempt]]
*[[Authentication plugin development#remoteControlLogin|remoteControlLogin]]
 
 
 
== Model Events ==
 
All models (Survey, Question, etc.) support a series of before & after events.
 
=== [[Specific model events|Specific Model events]] ===
 
These include model-specific events (example for Survey model):
 
* beforeSurveyDelete
* beforeSurveySave
* afterSurveyDelete
* afterSurveySave
 
[https://github.com/LimeSurvey/LimeSurvey/tree/master/application/models Available model in application/models/.]
 
=== [[Dynamic model events]]{{NewIn|v=3.15.1}}===
 
* beforeTokenDelete
* beforeTokenSave
* afterTokenDelete
* afterTokenSave
* beforeResponseDelete
* beforeResponseSave
* afterResponseDelete
* afterResponseSave
* beforeTokenDynamicDelete
* beforeTokenDynamicSave
* afterTokenDynamicDelete
* afterTokenDynamicSave
* beforeSurveyDynamicDelete
* beforeSurveyDynamicSave
* afterSurveyDynamicDelete
* afterSurveyDynamicSave
 
=== Generic events ===
 
As well as generic events independent of the model's name:
 
* [[beforeModelDelete]]
* [[beforeModelSave]]
* [[afterModelDelete]]
* [[afterModelSave]]
* [[beforeModelDeleteMany]]
 
In all of the above events, the associated model object is available as part of event data:
 
<code>$model = $this->event->get('model');</code>
 


[[Category:Development]]
[[Category:Development]]
[[Category:Plugins]]
[[Category:Plugins]]

Latest revision as of 12:17, 23 February 2024

As of version 5 the following events are available for plugins to subscribe to:

Global Events

CLI Events

This events needs to be called with php cli command.

Authentification related events


Model Events

All models (Survey, Question, etc.) support a series of before & after events.

Specific Model events

These include model-specific events (example for Survey model):

  • beforeSurveyDelete
  • beforeSurveySave
  • afterSurveyDelete
  • afterSurveySave

Available model in application/models/.

Dynamic model events (New in 3.15.1 )

  • beforeTokenDelete
  • beforeTokenSave
  • afterTokenDelete
  • afterTokenSave
  • beforeResponseDelete
  • beforeResponseSave
  • afterResponseDelete
  • afterResponseSave
  • beforeTokenDynamicDelete
  • beforeTokenDynamicSave
  • afterTokenDynamicDelete
  • afterTokenDynamicSave
  • beforeSurveyDynamicDelete
  • beforeSurveyDynamicSave
  • afterSurveyDynamicDelete
  • afterSurveyDynamicSave

Generic events

As well as generic events independent of the model's name:

In all of the above events, the associated model object is available as part of event data:

$model = $this->event->get('model');