Actions

Translations

Translations:Plugins - advanced/110/de

From LimeSurvey Manual

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

'globalsettings.general',
new TextInput([
'name' => 'myinput', 
'label' => 'Label',
'disabled' => true,
'tooltip' => 'Moo muh muh',
'help' => 'Einige Hilfetexte', 
'save' => function($request, $connection) {
$value = $request->getPost('myinput');
if ($value === 'irgendein ungültiger Wert') {
throw new SaveFailedException("Die benutzerdefinierte Eingabe 'myinput' konnte nicht gespeichert werden");
} else {
SettingGlobal::setSetting('myinput', $value);
}
} ,
'load' => function () {
return getGlobalSetting('myinput');
}
])

); </syntaxhighlight>