summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-21 02:54:46 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-21 02:54:46 +0000
commit0e116ff9cfc117c3ab5d1354cab99175061db134 (patch)
treeee5cc5426f94328fe1683997879cdec13be6b89a
parentcc22ae663a5aafe1872549be1793d775356ae0ee (diff)
downloadbrdo-0e116ff9cfc117c3ab5d1354cab99175061db134.tar.gz
brdo-0e116ff9cfc117c3ab5d1354cab99175061db134.tar.bz2
#555142 by yched: Clean up unneeded menu-rebuild code in Field UI.
-rw-r--r--modules/field_ui/field_ui.admin.inc26
-rw-r--r--modules/field_ui/field_ui.module46
2 files changed, 19 insertions, 53 deletions
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index caaa2d062..02ce61b07 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -496,7 +496,6 @@ function field_ui_field_overview_form_submit($form, &$form_state) {
field_create_field($field);
field_create_instance($instance);
- $destinations[] = $admin_path . '/fields/refresh';
$destinations[] = $admin_path . '/fields/' . $field['field_name'] . '/field-settings';
$destinations[] = $admin_path . '/fields/' . $field['field_name'] . '/edit';
@@ -528,7 +527,6 @@ function field_ui_field_overview_form_submit($form, &$form_state) {
try {
field_create_instance($instance);
- $destinations[] = $admin_path . '/fields/refresh';
$destinations[] = $admin_path . '/fields/' . $instance['field_name'] . '/edit';
// Store new field information for any additional submit handlers.
$form_state['fields_added']['_add_existing_field'] = $instance['field_name'];
@@ -999,11 +997,7 @@ function field_ui_field_delete_form_submit($form, &$form_state) {
}
$admin_path = _field_ui_bundle_admin_path($bundle);
- $destinations = array(
- $admin_path . '/fields/refresh',
- $admin_path . '/fields',
- );
- $form_state['redirect'] = field_ui_get_destinations($destinations);
+ $form_state['redirect'] = field_ui_get_destinations(array($admin_path . '/fields'));
}
/**
@@ -1332,24 +1326,6 @@ function field_ui_next_destination($bundle) {
}
/**
- * Menu callback; rebuild the menu after adding new fields.
- *
- * Dummy function to force a page refresh so menu_rebuild() will work right
- * when creating a new field that creates a new menu item.
- */
-function field_ui_field_menu_refresh($obj_type, $bundle) {
- $bundle = field_attach_extract_bundle($obj_type, $bundle);
-
- menu_rebuild();
- $destinations = field_ui_next_destination($bundle);
- if (is_array($destinations)) {
- $path = array_shift($destinations);
- drupal_goto($path, $destinations);
- }
- drupal_goto($destinations);
-}
-
-/**
* Helper function to order fields when theming overview forms.
*/
function _field_ui_overview_order(&$form, $field_rows) {
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index ce856dd97..00db4681c 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -61,34 +61,6 @@ function field_ui_menu() {
'type' => MENU_LOCAL_TASK,
'weight' => 1,
) + $access;
- // A dummy function to trigger a page refresh so that field menus get
- // rebuilt correctly when new fields are added.
- $items["$path/fields/refresh"] = array(
- 'title' => 'Refresh menu',
- 'page callback' => 'field_ui_field_menu_refresh',
- 'page arguments' => array($obj_type, $bundle_arg),
- 'type' => MENU_CALLBACK,
- 'weight' => 1,
- ) + $access;
- $items["$path/display"] = array(
- 'title' => 'Display fields',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg),
- 'type' => MENU_LOCAL_TASK,
- 'weight' => 2,
- ) + $access;
-
- // 'Display fields' tab and context secondary tabs.
- $tabs = field_ui_build_modes_tabs($obj_type);
- foreach ($tabs as $key => $tab) {
- $items["$path/display/$key"] = array(
- 'title' => $tab['title'],
- 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg, $key),
- 'type' => $key == 'basic' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
- 'weight' => $key == 'basic' ? 0 : 1,
- ) + $access;
- }
-
$instance_position = count(explode('/', $path)) + 1;
$items["$path/fields/%field_ui_menu"] = array(
'title callback' => 'field_ui_menu_label',
@@ -126,6 +98,24 @@ function field_ui_menu() {
'page arguments' => array('field_ui_field_delete_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_LOCAL_TASK,
) + $access;
+
+ // 'Display fields' tab and context secondary tabs.
+ $items["$path/display"] = array(
+ 'title' => 'Display fields',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg),
+ 'type' => MENU_LOCAL_TASK,
+ 'weight' => 2,
+ ) + $access;
+ $tabs = field_ui_build_modes_tabs($obj_type);
+ foreach ($tabs as $key => $tab) {
+ $items["$path/display/$key"] = array(
+ 'title' => $tab['title'],
+ 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg, $key),
+ 'type' => $key == 'basic' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
+ 'weight' => $key == 'basic' ? 0 : 1,
+ ) + $access;
+ }
}
}
}