You are here

function fel_fields_theme in Form element layout 7

Implements hook_theme().

File

modules/fel_fields/fel_fields.module, line 14
Field support for Form element layout (fel.module).

Code

function fel_fields_theme() {
  $theme_file = array(
    'file' => 'fel_fields.theme.inc',
  );
  $theme = array(
    'fel_fields_multiple_form' => array(
      'base hook' => 'field_multiple_value_form',
      'render element' => 'element',
    ),
  );

  // Many supported modules' theme overrides, though these may not necessarily
  // be enabled, so only add overrides for enabled modules.
  $modules = array(
    'date' => array(
      'fel_date_combo' => $theme_file + array(
        'base hook' => 'date_combo',
        'render element' => 'element',
      ),
    ),
    'matrix' => array(
      'fel_fields_matrix_table' => $theme_file + array(
        'base hook' => 'matrix_table',
        'render element' => 'form',
      ),
    ),
    'field_group' => array(
      'fel_fields_multipage_pane' => $theme_file + array(
        'base hook' => 'multipage_pane',
        'render element' => 'element',
      ),
    ),
    'socialfield' => array(
      'fel_fields_socialfield_drag_components' => $theme_file + array(
        'base hook' => 'socialfield_drag_components',
        'render element' => 'element',
      ),
    ),
  );
  foreach ($modules as $module => $module_theme) {
    if (module_exists($module)) {
      $theme += $module_theme;
    }
  }

  // Special case for 'field_collection_table' which calls drupal_get_path() on
  // a likely missing module.
  if (module_exists('field_collection_table')) {
    $theme['fel_fields_collection_table'] = $theme_file + array(
      'base hook' => 'field_collection_table_multiple_value_fields',
      'render element' => 'element',
      'includes' => array(
        drupal_get_path('module', 'field_collection_table') . '/theme/theme.inc',
      ),
    );
  }
  return $theme;
}