You are here

function course_field_extra_fields in Course 7

Same name and namespace in other branches
  1. 7.2 course.module \course_field_extra_fields()

Implements hook_field_extra_fields().

File

./course.module, line 1699
course.module Core functionality for Courses.

Code

function course_field_extra_fields() {
  $extra = array();
  foreach (entity_get_info() as $entity_type => $entity_info) {
    if ($entity_type == 'node') {
      foreach (array_keys($entity_info['bundles']) as $bundle) {
        if (in_array($bundle, course_get_types())) {
          $extra[$entity_type][$bundle]['form']['course'] = array(
            'label' => t('Course'),
            'description' => t('Course form elements.'),
            'weight' => 0,
          );
          $extra[$entity_type][$bundle]['display']['course'] = array(
            'label' => t('Take course link'),
            'weight' => 0,
          );
          $extra[$entity_type][$bundle]['display']['course_messages'] = array(
            'label' => t('Course messages'),
            'weight' => 0,
          );
        }
      }
    }
  }
  $extra['course_object']['course_object']['display']['course_outline_image'] = array(
    'label' => t('Status image'),
    'weight' => 0,
  );
  $extra['course_object']['course_object']['display']['course_outline_link'] = array(
    'label' => t('Link to the course object'),
    'weight' => 1,
  );
  $extra['course_object']['course_object']['display']['course_outline_status'] = array(
    'label' => t('Status text'),
    'weight' => 2,
  );
  return $extra;
}