? .cache ? .settings Index: modules/field/modules/list/tests/list.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/tests/list.test,v retrieving revision 1.2 diff -u -p -r1.2 list.test --- modules/field/modules/list/tests/list.test 29 Dec 2009 19:43:31 -0000 1.2 +++ modules/field/modules/list/tests/list.test 12 Jan 2010 20:23:07 -0000 @@ -189,7 +189,7 @@ class ListFieldUITestCase extends FieldT ); field_create_instance($instance); - $admin_path = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $field_name; + $admin_path = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $field_name . '/edit'; return $admin_path; } Index: modules/field_ui/field_ui.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v retrieving revision 1.35 diff -u -p -r1.35 field_ui.admin.inc --- modules/field_ui/field_ui.admin.inc 3 Jan 2010 21:01:04 -0000 1.35 +++ modules/field_ui/field_ui.admin.inc 12 Jan 2010 20:19:07 -0000 @@ -124,7 +124,7 @@ function field_ui_field_overview_form($f 'edit' => array( '#type' => 'link', '#title' => t('edit'), - '#href' => $admin_field_path, + '#href' => $admin_field_path . '/edit', '#options' => array('attributes' => array('title' => t('Edit instance settings.'))), ), 'delete' => array( @@ -807,8 +807,9 @@ function field_ui_existing_field_options /** * Menu callback; presents the field settings edit page. */ -function field_ui_field_settings_form($form, &$form_state, $obj_type, $bundle, $instance) { +function field_ui_field_settings_form($form, &$form_state, $obj_type, $bundle, $field_name) { $bundle = field_extract_bundle($obj_type, $bundle); + $instance = field_info_instance($obj_type, $field_name, $bundle); $field = field_info_field($instance['field_name']); // When a field is first created, we have to get data from the db. @@ -817,7 +818,7 @@ function field_ui_field_settings_form($f $field = field_read_field($field['field_name']); } - drupal_set_title($instance['label']); + drupal_set_title(t($instance['label'])); $description = '
' . 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'])) . '
'; @@ -904,9 +905,12 @@ function field_ui_field_settings_form_su /** * Menu callback; select a widget for the field. */ -function field_ui_widget_type_form($form, &$form_state, $obj_type, $bundle, $instance) { +function field_ui_widget_type_form($form, &$form_state, $obj_type, $bundle, $field_name) { $bundle = field_extract_bundle($obj_type, $bundle); - $field = field_read_field($instance['field_name']); + $instance = field_info_instance($obj_type, $field_name, $bundle); + $field = field_info_field($instance['field_name']); + + drupal_set_title(t($instance['label'])); $field_type = field_info_field_types($field['type']); $widget_type = field_info_widget_types($instance['widget']['type']); @@ -964,9 +968,11 @@ function field_ui_widget_type_form_submi /** * Menu callback; present a form for removing a field from a content type. */ -function field_ui_field_delete_form($form, &$form_state, $obj_type, $bundle, $instance) { +function field_ui_field_delete_form($form, &$form_state, $obj_type, $bundle, $field_name) { $bundle = field_extract_bundle($obj_type, $bundle); + $instance = field_info_instance($obj_type, $field_name, $bundle); $field = field_info_field($instance['field_name']); + $admin_path = _field_ui_bundle_admin_path($obj_type, $bundle); $form['object_type'] = array('#type' => 'value', '#value' => $obj_type); @@ -1021,12 +1027,15 @@ function field_ui_field_delete_form_subm /** * Menu callback; presents the field instance edit page. */ -function field_ui_field_edit_form($form, &$form_state, $obj_type, $bundle, $instance) { +function field_ui_field_edit_form($form, &$form_state, $obj_type, $bundle, $field_name) { $bundle = field_extract_bundle($obj_type, $bundle); - + $instance = field_info_instance($obj_type, $field_name, $bundle); $field = field_info_field($instance['field_name']); + $form['#field'] = $field; + drupal_set_title(t($instance['label'])); + if (!empty($field['locked'])) { $form['locked'] = array( '#markup' => t('The field %field is locked and cannot be edited.', array('%field' => $instance['label'])), @@ -1038,9 +1047,6 @@ function field_ui_field_edit_form($form, $widget_type = field_info_widget_types($instance['widget']['type']); $bundles = field_info_bundles(); - $title = isset($instance['label']) ? $instance['label'] : $instance['field_name']; - drupal_set_title(check_plain($title)); - // Create a form structure for the instance values. $form['instance'] = array( '#tree' => TRUE, Index: modules/field_ui/field_ui.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.module,v retrieving revision 1.22 diff -u -p -r1.22 field_ui.module --- modules/field_ui/field_ui.module 3 Jan 2010 21:01:04 -0000 1.22 +++ modules/field_ui/field_ui.module 12 Jan 2010 20:08:12 -0000 @@ -66,45 +66,28 @@ function field_ui_menu() { 'weight' => 1, 'file' => 'field_ui.admin.inc', ) + $access; - $items["$path/fields/%field_ui_menu"] = array( - 'title callback' => 'field_ui_menu_label', - 'title arguments' => array($instance_position), - 'load arguments' => array($obj_type, $bundle_arg), - 'page callback' => 'drupal_get_form', - 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), - 'type' => MENU_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', - ) + $access; - $items["$path/fields/%field_ui_menu/edit"] = array( + $items["$path/fields/%/edit"] = array( 'title' => 'Edit instance settings', - 'load arguments' => array($obj_type, $bundle_arg), 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), - 'type' => MENU_DEFAULT_LOCAL_TASK, 'file' => 'field_ui.admin.inc', ) + $access; - $items["$path/fields/%field_ui_menu/field-settings"] = array( + $items["$path/fields/%/field-settings"] = array( 'title' => 'Edit field settings', - 'load arguments' => array($obj_type, $bundle_arg), 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_settings_form', $obj_type, $bundle_arg, $instance_position), - 'type' => MENU_LOCAL_TASK, 'file' => 'field_ui.admin.inc', ) + $access; - $items["$path/fields/%field_ui_menu/widget-type"] = array( + $items["$path/fields/%/widget-type"] = array( 'title' => 'Change widget type', - 'load arguments' => array($obj_type, $bundle_arg), 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_widget_type_form', $obj_type, $bundle_arg, $instance_position), - 'type' => MENU_LOCAL_TASK, 'file' => 'field_ui.admin.inc', ) + $access; - $items["$path/fields/%field_ui_menu/delete"] = array( + $items["$path/fields/%/delete"] = array( 'title' => 'Delete instance', - 'load arguments' => array($obj_type, $bundle_arg), 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_delete_form', $obj_type, $bundle_arg, $instance_position), - 'type' => MENU_LOCAL_TASK, 'file' => 'field_ui.admin.inc', ) + $access; @@ -135,24 +118,6 @@ function field_ui_menu() { } /** - * Menu loader; Load a field instance based on its name. - */ -function field_ui_menu_load($field_name, $obj_type, $bundle_name) { - $bundle_name = strtr($bundle_name, array('-' => '_')); - if ($instance = field_info_instance($obj_type, $field_name, $bundle_name)) { - return $instance; - } - return FALSE; -} - -/** - * Menu title callback; Return a field label based on its instance. - */ -function field_ui_menu_label($instance) { - return t($instance['label']); -} - -/** * Implements hook_theme(). */ function field_ui_theme() { Index: modules/field_ui/field_ui.test =================================================================== RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.test,v retrieving revision 1.6 diff -u -p -r1.6 field_ui.test --- modules/field_ui/field_ui.test 2 Dec 2009 19:26:22 -0000 1.6 +++ modules/field_ui/field_ui.test 12 Jan 2010 20:22:21 -0000 @@ -120,7 +120,7 @@ class FieldUITestCase extends DrupalWebT */ function updateField() { // Go to the field edit page. - $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $this->field_name); + $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $this->field_name . '/edit'); // Populate the field settings with new settings. $string = 'updated dummy test string'; @@ -176,13 +176,13 @@ class FieldUITestCase extends DrupalWebT $this->assertNull(field_info_instance('node', 'body', $this->type), t('Field instance settings were deleted.')); // Re-load the manage fields page. - $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields/'); + $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields'); $this->assertNoText(t('Body'), t('Body field was deleted.')); // Re-add body field by visiting the content type edit page. $edit = array('body_label' => 'New body field'); $this->drupalPost('admin/structure/types/manage/' . $this->hyphen_type, $edit, t('Save content type')); - $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields/'); + $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields'); $this->assertText(t('New body field'), t('New body field was found.')); // Reset the fields info. @@ -235,7 +235,7 @@ class FieldUITestCase extends DrupalWebT field_create_instance($instance); $langcode = LANGUAGE_NONE; - $admin_path = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $field_name; + $admin_path = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields/' . $field_name . '/edit'; $element_id = "edit-instance-default-value-widget-$field_name-$langcode-0-value"; $element_name = "instance[default_value_widget][$field_name][$langcode][0][value]";