subscribe('beforeSurveySettings'); $this->subscribe('newSurveySettings'); } /** * This event is fired by the administration panel to gather extra settings * available for a survey. * The plugin should return setting meta data. * @internal param PluginEvent $event */ public function beforeSurveySettings() { $event = $this->event; $event->set("surveysettings.{$this->id}", [ 'name' => get_class($this), 'settings' => [ 'checkboxTest' => [ 'type' => 'checkbox', 'label' => 'Checkbox', 'current' => $this->get('checkboxTest', 'Survey', $event->get('survey')) ] ] ]); } /** * Save the settings */ public function newSurveySettings() { $event = $this->event; foreach ($event->get('settings') as $name => $value) { $this->set($name, $value, 'Survey', $event->get('survey')); } } }