1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
function modulename_get_field_name($content_type){
$fields = array(); $field_map = field_info_field_map(); $instances = field_info_instances('node', $content_type); $extra_fields = field_info_extra_fields('node', $content_type, 'form');
foreach ($instances as $name => $instance) { $field = field_info_field($instance['field_name']); $fields[$instance['field_name']] = array( 'field_name' => $instance['field_name'], 'title' => $instance['label'], 'weight' => $instance['widget']['weight'], 'type' => $field_map[$instance['field_name']]['type'], ); } foreach ($extra_fields as $name => $extra_field) { $fields[$name] = array( 'title' => $extra_field['label'], 'weight' => $extra_field['weight'], ); } return $fields; }
|