Custom field types
This commit is contained in:
parent
7b8403cdb9
commit
ec19924bea
1 changed files with 21 additions and 0 deletions
|
@ -472,3 +472,24 @@ Form::macro('username_format', function ($name = "username_format", $selected =
|
||||||
return $select;
|
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…
Add table
Reference in a new issue