Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes description
Some additionals hooks needed for advancedforms.
Two very simple hooks:
formcreator_question_description
triggered when displaying a question's descriptionformcreator_question_default_value
triggered when displaying a question's default valueAnd a more complex hook
formcreator_actors_type
that allow to define custom actors.This hooks expect a class name, which must implement the new
PluginFormcreatorPluginTarget
interface.You'll find an example here: https://gist.github.com/AdrienClairembault/89346d3e545260651f8375a772fc06e6, which allow to select an actor specified in a question from a previous form of the same workflow.
The only impact on existing code is a rewrite of the
changeActor
javascript which handle hiding/showing the custom html forms for each actors types.This javascript code now rely on data attributes instead of specific instructions, which was needed to allow plugins using the
formcreator_actors_type
hook to have their specific html forms displayed.Also it seems that the same
changeActor
was written twice, I've deleted the second occurrence.