mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Custom field types
This commit is contained in:
parent
7b8403cdb9
commit
ec19924bea
|
@ -472,3 +472,24 @@ Form::macro('username_format', function ($name = "username_format", $selected =
|
|||
return $select;
|
||||
|
||||
});
|
||||
|
||||
|
||||
Form::macro('customfield_elements', function ($name = "customfield_elements", $selected = null, $class = null) {
|
||||
|
||||
$formats = array(
|
||||
'text' => 'Text Box',
|
||||
'listbox' => 'List Box',
|
||||
'checkbox' => 'Checkbox',
|
||||
'radio' => 'Radio Buttons',
|
||||
);
|
||||
|
||||
$select = '<select name="'.$name.'" class="'.$class.'" style="width: 100%">';
|
||||
foreach ($formats as $format => $label) {
|
||||
$select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected"' : '').'>'.$label.'</option> '."\n";
|
||||
}
|
||||
|
||||
$select .= '</select>';
|
||||
|
||||
return $select;
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue