You are here

function ds_custom_manage in Display Suite 7

Same name and namespace in other branches
  1. 7.2 modules/ds_ui/includes/ds.fields.inc \ds_custom_manage()

Manage a field. This will redirect to the exact form.

1 string reference to 'ds_custom_manage'
ds_menu in ./ds.module
Implements hook_menu().

File

./ds.fields.inc, line 83
Administrative functions for managing custom fields for every entity.

Code

function ds_custom_manage($field_key = '') {
  $redirect = '';
  ctools_include('export');
  $custom_fields = ctools_export_crud_load_all('ds_fields');
  if (isset($custom_fields[$field_key])) {
    $field = $custom_fields[$field_key];
    switch ($field->field_type) {
      case DS_FIELD_TYPE_CODE:
        $redirect = 'admin/structure/ds/fields/manage_custom/' . $field_key;
        break;
      case DS_FIELD_TYPE_BLOCK:
        $redirect = 'admin/structure/ds/fields/manage_block/' . $field_key;
        break;
      case DS_FIELD_TYPE_CTOOLS:
        $redirect = 'admin/structure/ds/fields/manage_ctools/' . $field_key;
        break;
      case DS_FIELD_TYPE_PREPROCESS:
        $redirect = 'admin/structure/ds/fields/manage_preprocess/' . $field_key;
        break;
      default:
        drupal_set_message(t('Field not found'));
        $redirect = 'admin/structure/ds/fields';
        break;
    }
  }
  drupal_goto($redirect);
}