You are here

function diff_admin_field_overview in Diff 7.3

Menu callback - provides an overview of Diff support and global settings.

1 string reference to 'diff_admin_field_overview'
diff_menu in ./diff.module
Implements hook_menu().

File

./diff.admin.inc, line 110
Administration page callbacks and forms.

Code

function diff_admin_field_overview() {
  $build['info'] = array(
    '#markup' => '<p>' . t('This table provides a summary of the field type support found on the system. It is recommended that you use global settings whenever possible to configure field comparison settings.') . '</p>',
  );
  $header = array(
    t('Type'),
    t('Machine name'),
    t('Module'),
    t('Operations'),
  );
  $rows = array();

  // Skip field types which have no widget types.
  $field_types = field_info_field_types();
  $widgets = array();
  foreach (field_info_widget_types() as $name => $widget_type) {
    foreach ($widget_type['field types'] as $widget_field_type) {
      if (isset($field_types[$widget_field_type])) {
        $widgets[$widget_field_type][$name] = $widget_type['label'];
      }
    }
  }
  foreach ($field_types as $field_name => $field_type) {
    if (!empty($widgets[$field_name])) {
      $row = array();
      $row[] = $field_type['label'];
      $row[] = $field_name;
      $row[] = $field_type['module'];
      $row[] = l(t('Global settings'), 'admin/config/content/diff/fields/' . $field_name);
      $rows[] = $row;
    }
  }
  $build['category_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('The system has no configurable fields.'),
  );
  return $build;
}