Actions

Plugin events: Difference between revisions

From LimeSurvey Manual

No edit summary
(ExpressionManagerStart are not renamed)
(45 intermediate revisions by 11 users not shown)
Line 1: Line 1:
At version 2.50 build 160425 the following events are available for plugins to subscribe to:
At version 2.50 build 160425 the following events are available for plugins to subscribe to:
*[[Authentication plugin development#afterLoginFormSubmit|afterLoginFormSubmit]]
 
*[[Authentication plugin development#afterLogout|afterLogout]]
NB: Version 2.60.0 is not the same as version 2.6, which is the new number for version 2.06. 2.60.0 comes after 2.59.1.
*[[afterFailedLoginAttempt]]
 
== Global Events ==
 
*[[afterFindSurvey]]
*[[afterPluginLoad]]
*[[afterPluginLoad]]
*[[afterQuickMenuLoad]]
*[[afterSurveyActivate]]
*[[afterSurveyComplete]]
*[[afterSurveyComplete]]
*[[afterSurveyDeactivate]]
*[[afterSurveyQuestionAssessment]]{{NewIn|v=2.62|b=170207}}
*[[afterSurveyQuota]]{{NewIn|v=2.05|b=141006}}
*[[afterSurveyQuota]]{{NewIn|v=2.05|b=141006}}
*[[afterSurveySettingsSave]]
*[[beforeActivate]]
*[[beforeActivate]]
*[[beforeAdminMenuRender]] {{NewIn|v=2.50|b=160426}}
*[[beforeEmail]]{{NewIn|v=4.0.0}}
*[[beforeCloseHtml]]{{NewIn|v=2.60.0}}
*[[beforeControllerAction]]{{NewIn|v=2.50|b=160425}}
*[[beforeControllerAction]]{{NewIn|v=2.50|b=160425}}
*[[beforeDeactivate]]
*[[beforeDeactivate]]
*[[beforeHasPermission]]{{NewIn|v=2.06}}
*[[beforeHasPermission]]{{NewIn|v=2.06}}
*[[beforeLoadResponse]]
*[[beforeLoadResponse]]
*[[beforeLogin]]
*[[beforePermissionSetSave]]
*[[beforeLogout]]
*[[beforePluginManagerMenuRender]]{{NewIn|v=4.0.0}}
*[[beforeQuestionRender]]{{NewIn|v=2.05|b=140922}}
*[[beforeQuestionRender]]{{NewIn|v=2.05|b=140922}}
*[[beforeParticipantSave]]
*[[beforeParticipantDelete]]
*[[beforePermissionSetSave]]
*[[beforeRegister]]{{NewIn|v=2.06}}
*[[beforeRegister]]{{NewIn|v=2.06}}
*[[beforeRegisterForm]]{{NewIn|v=2.06}}
*[[beforeRegisterForm]]{{NewIn|v=2.06}}
*[[beforeSideMenuRender]]{{NewIn|v=2.51}}
*[[beforeSideMenuRender]]{{NewIn|v=2.51.0}}
*[[beforeTokenDelete]]
*[[beforeSurveyAdminView]]
*[[beforeTokenSave]]
*[[beforeSurveyActivate]] {{NewIn|v=3.15|b=181017}}
*[[beforeSurveyActivate]]{{NewIn|v=2.5}}
*[[beforeSurveyBarRender]] {{NewIn|v=3.15|b=181017}}
*[[beforeSurveyDeactivate]]{{NewIn|v=2.5}}
*[[beforeSurveyDeactivate]]{{NewIn|v=2.5}}
*[[beforeSurveyEmail]]{{NewIn|v=4.0.0}}
*[[beforeSurveyPage]]{{NewIn|v=2.05|b=140109}}
*[[beforeSurveyPage]]{{NewIn|v=2.05|b=140109}}
*[[beforeSurveySettings]]
*[[beforeSurveySettings]]
*[[beforeSurveysStartpageRender]]{{DeprecatedIn|v=3.0.0}}
*[[beforeTokenEmail]]{{NewIn|v=2.05|b=140404}}
*[[beforeTokenEmail]]{{NewIn|v=2.05|b=140404}}
*[[beforeUserSave]]
*[[beforeToolsMenuRender]]
*[[beforeUserDelete]]
*[[beforeUrlCheck]]{{NewIn|v=3.12.2}}
*[[cron]]{{NewIn|v=2.05|b=140404}}
*[[createNewUser]]
*[[createRandomPassword]]{{NewIn|v=4.0.0|b=190523}}
*[[checkPasswordRequirement]]{{NewIn|v=4.0.0|b=190523}}
*[[ExpressionManagerStart]] WIP {{NewIn|v=4.0.0-dev}}
*[[getGlobalBasePermissions]]]{{NewIn|v=3.0.0}}
*[[getPluginTwigPath]]{{NewIn|v=3.10.0}}
*[[listExportOptions]]
*[[listExportOptions]]
*[[listExportPlugins]]
*[[listExportPlugins]]
Line 35: Line 50:
*[[newDirectRequest]]
*[[newDirectRequest]]
*[[newExport]]
*[[newExport]]
*[[newLoginForm]]
*[[NewQuestionAttributes|newQuestionAttributes]]{{NewIn|v=2.50|b=160731}}
*[[NewQuestionAttributes|newQuestionAttributes]]{{NewIn|v=2.50|b=160731}}
*[[newSurveySettings]]
*[[newSurveySettings]]
*[[newUnsecureRequest|NewUnsecureRequest]]
*[[onSurveyDenied]]{{NewIn|v=3.0.0}}
*[[setVariableExpressionEnd]]{{NewIn|v=4.0.0}}
== CLI Events ==
This events needs to be called with php cli command.
*[[cron (command)|cron]]{{NewIn|v=2.05|b=140404}}
*[[direct (command)|direct]]{{NewIn|v=2.63.0|b=170304}}
== Authentification related events ==
*[[newLoginForm]]
*[[Authentication plugin development#afterLoginFormSubmit|afterLoginFormSubmit]]
*[[afterSuccessfulLogin]]
*[[newUserLogin]]
*[[newUserSession]]
*[[newUserSession]]
*[[onSurveyDenied]]{{NewIn|v=2.5}}
*[[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]]

Revision as of 18:55, 26 February 2020

At version 2.50 build 160425 the following events are available for plugins to subscribe to:

NB: Version 2.60.0 is not the same as version 2.6, which is the new number for version 2.06. 2.60.0 comes after 2.59.1.

Global Events

CLI Events

This events needs to be called with php cli command.

  • cron (New in 2.05 build 140404)
  • direct (New in 2.63.0 build 170304)

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');