function accessibility_install

cis7 accessibility.install accessibility_install()
cle7 accessibility.install accessibility_install()
elmsmedia7 accessibility.install accessibility_install()
icor7 accessibility.install accessibility_install()
meedjum_blog7 accessibility.install accessibility_install()
mooc7 accessibility.install accessibility_install()

Implements hook_install().

File

sites/all/modules/ulmus/accessibility/accessibility.install, line 6

Code

function accessibility_install() {
  $field = field_info_field('error_description');
  $instance = field_info_instance('accessibility_test', 'error_description', 'accessibility_test');
  if (empty($field)) {
    $field = array(
      'field_name' => 'error_description',
      'type' => 'text_with_summary',
      'entity_types' => array('accessibility_test'),
    );
    $field = field_create_field($field);
  }
  if (empty($instance)) {
    $instance = array(
      'field_name' => 'error_description',
      'entity_type' => 'accessibility_test',
      'bundle' => 'accessibility_test',
      'label' => st('Error description'),
      'widget' => array('type' => 'text_textarea_with_summary'),
      'settings' => array('display_summary' => TRUE),
      'display' => array(
        'default' => array(
          'label' => 'hidden',
          'type' => 'text_default',
        ),
        'popup' => array(
          'label' => 'hidden',
          'type' => 'text_default',
        ),
        'teaser' => array(
          'label' => 'hidden',
          'type' => 'text_summary_or_trimmed',
        ),
      ),
    );
    $instance = field_create_instance($instance);
  }

  $display_settings = array(
    'view_modes' => array(
      'popup' => array(
        'custom_settings' => TRUE,
      ),
      'full' => array(
        'custom_settings' => FALSE,
      ),
    ),
    'extra_fields' => array(
      'form' => array(),
      'display' => array(
        'quail_name' => array(
          'default' => array(
            'weight' => '3',
            'visible' => FALSE,
          ),
          'popup' => array(
            'weight' => '3',
            'visible' => FALSE,
          ),
        ),
        'severity' => array(
          'default' => array(
            'weight' => '2',
            'visible' => FALSE,
          ),
          'popup' => array(
            'weight' => '2',
            'visible' => FALSE,
          ),
        ),
        'status' => array(
          'default' => array(
            'weight' => '1',
            'visible' => FALSE,
          ),
          'popup' => array(
            'weight' => '1',
            'visible' => FALSE,
          ),
        ),
      ),
    ),
  );
  field_bundle_settings('accessibility_test', 'accessibility_test', $display_settings);
}