function draggableviews_handler::get_form_element in DraggableViews 7
Same name and namespace in other branches
- 6.3 implementations/draggableviews_handler.inc \draggableviews_handler::get_form_element()
File
- implementations/
draggableviews_handler.inc, line 35 - The parent class of all draggableviews handlers.
Class
Code
function get_form_element($value, $attributes = array()) {
switch ($this->type) {
default:
$options = array();
for ($i = $this->range_start; $i <= $this->range_end; $i++) {
$options[$i] = $i;
}
return array(
'#type' => 'select',
'#name' => $attributes['field_name'],
'#value' => $value,
'#options' => $options,
'#attributes' => array(
'class' => $attributes['class'],
),
);
break;
case 'hierarchy':
return array(
'#type' => 'hidden',
'#name' => $attributes['field_name'],
'#value' => $value,
'#attributes' => array(
'class' => $attributes['class'],
),
);
}
}