Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: added beforeGetTemplate plugin event #3816

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions application/models/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ public static function getTemplatePath($sTemplateName = "")
*/
public static function getTemplateConfiguration($sTemplateName = null, $iSurveyId = null, $iSurveyGroupId = null, $bForceXML = false, $abstractInstance = false)
{
$event = new PluginEvent('beforeGetTemplate');
$event->set('surveyId', $iSurveyId);
$event->set('template', $sTemplateName);
$event = App()->getPluginManager()->dispatchEvent($event);
$sTemplateName = $event->get('template');

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getTemplateConfiguration already must be improved …

Working at c6bed76 i see we need more optimization on TemplateCOnfiguration system.

Here i think it's more in

public static function getInstance($sTemplateName = null, $iSurveyId = null, $iSurveyGroupId = null, $bForceXML = null, $abstractInstance = false, $last = false)
you need an event ?


// First we try to get a configuration row from DB
if (!$bForceXML) {
Expand Down
Loading