Plugin events: Difference between revisions
From LimeSurvey Manual
DenisChenu (talk | contribs) →CLI Events: Fix link |
Denischenu (talk | contribs) →Global Events: beforeProcessFileUpload |
||
(18 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
As of version 5 the following events are available for plugins to subscribe to: | |||
== Global Events == | == Global Events == | ||
*[[afterFindSurvey]] | *[[afterFindSurvey]] | ||
*[[afterGenerateToken]] | |||
*[[afterPluginLoad]] | *[[afterPluginLoad]] | ||
*[[afterQuickMenuLoad]] | *[[afterQuickMenuLoad]] | ||
Line 11: | Line 10: | ||
*[[afterSurveyComplete]] | *[[afterSurveyComplete]] | ||
*[[afterSurveyDeactivate]] | *[[afterSurveyDeactivate]] | ||
*[[afterSurveyQuestionAssessment]] | *[[afterSurveyQuestionAssessment]] | ||
*[[afterSurveyQuota]] | *[[afterSurveyQuota]] | ||
*[[afterSurveySettingsSave]] | *[[afterSurveySettingsSave]] | ||
*[[beforeActivate]] | *[[beforeActivate]] | ||
*[[beforeAdminMenuRender]] | *[[beforeAdminMenuRender]] | ||
*[[beforeCloseHtml]] | |||
*[[beforeCloseHtml]] | *[[beforeControllerAction]] | ||
*[[beforeControllerAction]] | |||
*[[beforeDeactivate]] | *[[beforeDeactivate]] | ||
*[[beforeHasPermission]] | *[[beforeHasPermission]] | ||
*[[beforeLoadResponse]] | *[[beforeLoadResponse]] | ||
*[[beforePermissionSetSave]] | *[[beforePermissionSetSave]] | ||
*[[beforePluginManagerMenuRender]] | *[[beforeProcessFileUpload]] | ||
*[[beforeQuestionRender]] | *[[beforePluginManagerMenuRender]] | ||
*[[beforeRegister]] | *[[beforeQuestionRender]] | ||
*[[beforeRegisterForm]] | *[[beforeRegister]] | ||
*[[beforeSideMenuRender]] | *[[beforeRegisterForm]] | ||
*[[beforeSideMenuRender]] | |||
*[[beforeSurveyAdminView]] | *[[beforeSurveyAdminView]] | ||
*[[beforeSurveyActivate]] | *[[beforeSurveyActivate]] | ||
*[[beforeSurveyBarRender]] | *[[beforeSurveyBarRender]] | ||
*[[beforeSurveyDeactivate]] | *[[beforeSurveyDeactivate]] | ||
*[[beforeSurveyPage]] | |||
*[[beforeSurveyPage]] | |||
*[[beforeSurveySettings]] | *[[beforeSurveySettings]] | ||
*[[beforeSurveysStartpageRender]]{{DeprecatedIn|v=3.0.0}} | *[[beforeSurveysStartpageRender]]{{DeprecatedIn|v=3.0.0}} | ||
*[[ | *[[beforeTwigRenderTemplate]] | ||
*[[beforeToolsMenuRender]] | *[[beforeToolsMenuRender]] | ||
*[[beforeUrlCheck]] | |||
*[[beforeWelcomePageRender]] | |||
*[[createNewUser]] | *[[createNewUser]] | ||
*[[createRandomPassword]] | *[[createRandomPassword]] | ||
*[[checkPasswordRequirement]] | *[[checkPasswordRequirement]] | ||
*[[ExpressionManagerStart]] | *[[ExpressionManagerStart]] | ||
*[[getGlobalBasePermissions]]] | *[[getGlobalBasePermissions]] | ||
*[[ | *[[getPluginTwigPath]] | ||
*[[getValidScreenFiles]] | |||
*[[listExportOptions]] | *[[listExportOptions]] | ||
*[[listExportPlugins]] | *[[listExportPlugins]] | ||
Line 49: | Line 50: | ||
*[[newDirectRequest]] | *[[newDirectRequest]] | ||
*[[newExport]] | *[[newExport]] | ||
*[[NewQuestionAttributes|newQuestionAttributes]] | *[[NewQuestionAttributes|newQuestionAttributes]] | ||
*[[newSurveySettings]] | *[[newSurveySettings]] | ||
*[[newUnsecureRequest|NewUnsecureRequest]] | *[[newUnsecureRequest|NewUnsecureRequest]] | ||
*[[onSurveyDenied]] | *[[onSurveyDenied]] | ||
*[[ | *[[setVariableExpressionEnd]] | ||
*[[saveSurveyForm]]{{NewIn|v=5.3.8}} | |||
== CLI Events == | == CLI Events == | ||
Line 59: | Line 61: | ||
This events needs to be called with php cli command. | This events needs to be called with php cli command. | ||
*[[cron (command)|cron]] | *[[cron (command)|cron]] | ||
*[[direct (command)|direct]] | *[[direct (command)|direct]] | ||
== Authentification related events == | == Authentification related events == | ||
Line 73: | Line 75: | ||
*[[Authentication plugin development#remoteControlLogin|remoteControlLogin]] | *[[Authentication plugin development#remoteControlLogin|remoteControlLogin]] | ||
== Email related events == | |||
*[[afterReceiveOAuthResponse]] | |||
*[[afterSelectEmailPlugin]] | |||
*[[beforeEmail]] | |||
*[[beforeSurveyEmail]] | |||
*[[beforeTokenEmail]] | |||
*[[beforeEmailDispatch]] | |||
*[[beforePrepareRedirectToAuthPage]] | |||
*[[beforeRedirectToAuthPage]] | |||
*[[listEmailPlugins]] | |||
*[[MailerConstruct]] | |||
== Model Events == | == Model Events == | ||
Line 87: | Line 100: | ||
* afterSurveyDelete | * afterSurveyDelete | ||
* afterSurveySave | * afterSurveySave | ||
[https://github.com/LimeSurvey/LimeSurvey/tree/master/application/models Available model in application/models/.] | |||
=== [[Dynamic model events]]{{NewIn|v=3.15.1}}=== | === [[Dynamic model events]]{{NewIn|v=3.15.1}}=== |
Latest revision as of 12:18, 14 November 2024
As of version 5 the following events are available for plugins to subscribe to:
Global Events
- afterFindSurvey
- afterGenerateToken
- afterPluginLoad
- afterQuickMenuLoad
- afterSurveyActivate
- afterSurveyComplete
- afterSurveyDeactivate
- afterSurveyQuestionAssessment
- afterSurveyQuota
- afterSurveySettingsSave
- beforeActivate
- beforeAdminMenuRender
- beforeCloseHtml
- beforeControllerAction
- beforeDeactivate
- beforeHasPermission
- beforeLoadResponse
- beforePermissionSetSave
- beforeProcessFileUpload
- beforePluginManagerMenuRender
- beforeQuestionRender
- beforeRegister
- beforeRegisterForm
- beforeSideMenuRender
- beforeSurveyAdminView
- beforeSurveyActivate
- beforeSurveyBarRender
- beforeSurveyDeactivate
- beforeSurveyPage
- beforeSurveySettings
- beforeSurveysStartpageRender (Deprectaed from 3.0.0 )
- beforeTwigRenderTemplate
- beforeToolsMenuRender
- beforeUrlCheck
- beforeWelcomePageRender
- createNewUser
- createRandomPassword
- checkPasswordRequirement
- ExpressionManagerStart
- getGlobalBasePermissions
- getPluginTwigPath
- getValidScreenFiles
- listExportOptions
- listExportPlugins
- listQuestionPlugins
- newDirectRequest
- newExport
- newQuestionAttributes
- newSurveySettings
- NewUnsecureRequest
- onSurveyDenied
- setVariableExpressionEnd
- saveSurveyForm (New in 5.3.8 )
CLI Events
This events needs to be called with php cli command.
- newLoginForm
- afterLoginFormSubmit
- afterSuccessfulLogin
- newUserLogin
- newUserSession
- afterLogout
- afterFailedLoginAttempt
- remoteControlLogin
- afterReceiveOAuthResponse
- afterSelectEmailPlugin
- beforeEmail
- beforeSurveyEmail
- beforeTokenEmail
- beforeEmailDispatch
- beforePrepareRedirectToAuthPage
- beforeRedirectToAuthPage
- listEmailPlugins
- MailerConstruct
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');