| 1 |
<?php |
<?php |
| 2 |
// $Id: field_ui.admin.inc,v 1.26 2009/10/29 07:21:04 webchick Exp $ |
// $Id: field_ui.admin.inc,v 1.27 2009/11/03 05:27:18 webchick Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 812 |
$field = field_read_field($field['field_name']); |
$field = field_read_field($field['field_name']); |
| 813 |
} |
} |
| 814 |
|
|
| 815 |
$field_type = field_info_field_types($field['type']); |
drupal_set_title($instance['label']); |
|
|
|
|
$info_function = $field['module'] . '_field_info'; |
|
|
$info = $info_function(); |
|
|
$description = '<p><strong>' . $info[$field['type']]['label'] . ':</strong> '; |
|
|
$description .= $info[$field['type']]['description'] . '</p>'; |
|
|
$form['#prefix'] = '<div class="description">' . $description . '</div>'; |
|
| 816 |
|
|
| 817 |
$description = '<p>' . t('These settings apply to the %field field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.', array('%field' => $instance['label'])) . '</p>'; |
$description = '<p>' . t('These settings apply to the %field field everywhere it is used. These settings impact the way that data is stored in the database and cannot be changed once data has been created.', array('%field' => $instance['label'])) . '</p>'; |
| 818 |
|
|
| 819 |
// Create a form structure for the field values. |
// Create a form structure for the field values. |
| 820 |
$form['field'] = array( |
$form['field'] = array( |
| 821 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 822 |
'#title' => t('%field field settings', array('%field' => $instance['label'])), |
'#title' => t('Field settings'), |
| 823 |
'#description' => $description, |
'#description' => $description, |
| 824 |
'#tree' => TRUE, |
'#tree' => TRUE, |
| 825 |
); |
); |
| 850 |
// responsible for not returning settings that cannot be changed if |
// responsible for not returning settings that cannot be changed if |
| 851 |
// the field already has data. |
// the field already has data. |
| 852 |
$form['field']['settings'] = array(); |
$form['field']['settings'] = array(); |
| 853 |
$additions = module_invoke($field_type['module'], 'field_settings_form', $field, $instance, $has_data); |
$additions = module_invoke($field['module'], 'field_settings_form', $field, $instance, $has_data); |
| 854 |
if (is_array($additions)) { |
if (is_array($additions)) { |
| 855 |
$form['field']['settings'] = $additions; |
$form['field']['settings'] = $additions; |
| 856 |
} |
} |
| 1132 |
field_ui_default_value_widget($field, $instance, $form, $form_state); |
field_ui_default_value_widget($field, $instance, $form, $form_state); |
| 1133 |
} |
} |
| 1134 |
|
|
|
$info = field_info_field_types($field['type']); |
|
|
$description = '<p><strong>' . $info['label'] . ':</strong> '; |
|
|
$description .= $info['description'] . '</p>'; |
|
|
$form['#prefix'] = '<div class="description">' . $description . '</div>'; |
|
|
|
|
| 1135 |
$has_data = field_has_data($field); |
$has_data = field_has_data($field); |
| 1136 |
if ($has_data) { |
if ($has_data) { |
| 1137 |
$description = '<p>' . t('These settings apply to the %field field everywhere it is used. Because the field already has data, some settings can no longer be changed.', array('%field' => $instance['label'])) . '</p>'; |
$description = '<p>' . t('These settings apply to the %field field everywhere it is used. Because the field already has data, some settings can no longer be changed.', array('%field' => $instance['label'])) . '</p>'; |