You are here

function rules_link_field_extra_fields in Rules Link 7

Same name and namespace in other branches
  1. 7.2 rules_link.module \rules_link_field_extra_fields()

Implements hook_field_extra_fields().

File

./rules_link.module, line 557
Rules Link - module file.

Code

function rules_link_field_extra_fields() {
  $return = array();
  $rules_links = rules_link_get_links();
  foreach ($rules_links as $rules_link) {
    if ($rules_link->settings['entity_link']) {
      $entity_info = entity_get_info($rules_link->entity_type);
      $bundles = empty($rules_link->settings['bundles']) ? array_keys($entity_info['bundles']) : $rules_link->settings['bundles'];
      foreach ($bundles as $bundle) {
        $return[$rules_link->entity_type][$bundle]['display']['rules_links_' . $rules_link->name]['label'] = $rules_link->label;
        $return[$rules_link->entity_type][$bundle]['display']['rules_links_' . $rules_link->name]['description'] = '';
        $return[$rules_link->entity_type][$bundle]['display']['rules_links_' . $rules_link->name]['weight'] = 0;
      }
    }
  }
  return $return;
}