You are here

function pmnote_default_field_instances in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 pmnote/includes/pmnote.field_instance.inc \pmnote_default_field_instances()
  2. 7.2 pmnote/includes/pmnote.field_instance.inc \pmnote_default_field_instances()

Field instance definitions for PM Note.

2 calls to pmnote_default_field_instances()
pmnote_migrate_create_fields in pmnote/includes/pmnote.migrate.inc
Creates and attaches fields to Drupal user.
pmnote_update_7300 in pmnote/pmnote.install
Add entityreference_prepopulate behaviour to pmnote_parent.

File

pmnote/includes/pmnote.field_instance.inc, line 10
Field instance definitions for the PM Note module.

Code

function pmnote_default_field_instances() {
  $field_instances = array();

  // Exported field_instance: 'node-pmnote-body'
  $field_instances['node-pmnote-body'] = array(
    'bundle' => 'pmnote',
    'default_value' => NULL,
    'deleted' => 0,
    'description' => '',
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_default',
        'weight' => 0,
      ),
      'teaser' => array(
        'label' => 'hidden',
        'module' => 'text',
        'settings' => array(
          'trim_length' => 600,
        ),
        'type' => 'text_summary_or_trimmed',
        'weight' => 0,
      ),
    ),
    'entity_type' => 'node',
    'field_name' => 'body',
    'label' => 'Description',
    'required' => FALSE,
    'settings' => array(
      'display_summary' => TRUE,
      'text_processing' => 1,
      'user_register_form' => FALSE,
    ),
    'widget' => array(
      'module' => 'text',
      'settings' => array(
        'rows' => 20,
        'summary_rows' => 5,
      ),
      'type' => 'text_textarea_with_summary',
      'weight' => 3,
    ),
  );

  // Exported field_instance: 'node-pmnote-pmnote_parent'.
  $field_instances['node-pmnote-pmnote_parent'] = array(
    'bundle' => 'pmnote',
    'default_value' => NULL,
    'default_value_function' => 'entityreference_prepopulate_field_default_value',
    'deleted' => 0,
    'description' => '',
    'display' => array(
      'default' => array(
        'label' => 'inline',
        'module' => 'entityreference',
        'settings' => array(
          'link' => FALSE,
        ),
        'type' => 'entityreference_label',
        'weight' => 1,
      ),
      'teaser' => array(
        'label' => 'inline',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 0,
      ),
    ),
    'entity_type' => 'node',
    'field_name' => 'pmnote_parent',
    'label' => 'Organization/Project/Task',
    'required' => 0,
    'settings' => array(
      'behaviors' => array(
        'prepopulate' => array(
          'action' => 'disable',
          'action_on_edit' => 0,
          'fallback' => 'none',
          'providers' => array(
            'og_context' => FALSE,
            'url' => 1,
          ),
          'skip_perm' => 0,
          'status' => 1,
        ),
      ),
      'user_register_form' => FALSE,
    ),
    'widget' => array(
      'active' => 1,
      'module' => 'entityreference',
      'settings' => array(
        'match_operator' => 'CONTAINS',
        'path' => '',
        'size' => 60,
      ),
      'type' => 'entityreference_autocomplete',
      'weight' => 2,
    ),
  );

  // Translatables
  // Included for use with string extractors like potx.
  t('Description');
  t('Organization/Project/Task');
  return $field_instances;
}