Actions

Translations

Translations:Plugins - advanced/110/nl

From LimeSurvey Manual

// Inside init() Yii::app()->formExtensionService->add(

'globalsettings.general',
new TextInput([
'name' => 'myinput', 
'label' => 'Label',
'disabled' => true,
'tooltip' => 'Moo moo moo',
'help' => 'Enige helptekst', 
'save' => function($request, $connection) {
$value = $request->getPost('myinput');
if ($value === 'een ongeldige waarde') {
throw new SaveFailedException("Kon aangepaste invoer 'myinput'" niet opslaan);
} else {
SettingGlobal::setSetting('myinput', $value);
}
} ,
'load' => function () {
return getGlobalSetting('myinput');
}
])

); </syntaxhighlight>