mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 00:04:05 +02:00
PropertyModifierSubstring: fix erraneous form fields
This commit is contained in:
parent
d0250dc312
commit
d7da41b789
@ -9,19 +9,25 @@ class PropertyModifierSubstring extends PropertyModifierHook
|
|||||||
{
|
{
|
||||||
public static function addSettingsFormFields(QuickForm $form)
|
public static function addSettingsFormFields(QuickForm $form)
|
||||||
{
|
{
|
||||||
$form->addElement('text', 'pattern', array(
|
$form->addElement('text', 'start', array(
|
||||||
'label' => 'Regex pattern',
|
'label' => 'Start',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'description' => sprintf(
|
||||||
|
$form->translate(
|
||||||
|
'Please see %s for detailled instructions of how start and and work'
|
||||||
|
),
|
||||||
|
'http://php.net/manual/en/function.substr.php'
|
||||||
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$form->addElement('text', 'replacement', array(
|
$form->addElement('text', 'length', array(
|
||||||
'label' => 'Replacement',
|
'label' => 'End',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transform($value)
|
public function transform($value)
|
||||||
{
|
{
|
||||||
return substr($value, $this->settings['start'], $this->settings['end'] - $this->settings['start']);
|
return substr($value, $this->getSetting('start'), $this->getSetting('length'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user