You are here

language_hierarchy_test.install in Language Hierarchy 7

File

tests/modules/language_hierarchy_test.install
View source
<?php

/**
 * Implements hook_install().
 */
function language_hierarchy_test_install() {

  // Add a title field to the page node type.
  $field = array(
    'field_name' => 'field_title',
    'type' => 'text',
    'entity_types' => array(
      'node',
    ),
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'field_title',
    'entity_type' => 'node',
    'bundle' => 'page',
    'label' => t('Title'),
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'settings' => array(
      'display_summary' => TRUE,
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'text_plain',
      ),
    ),
  );
  field_create_instance($instance);
  $field = array(
    'field_name' => 'field_not_title',
    'type' => 'text',
    'entity_types' => array(
      'node',
    ),
    'translatable' => TRUE,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'field_not_title',
    'entity_type' => 'node',
    'bundle' => 'page',
    'label' => t('Not Title'),
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'settings' => array(
      'display_summary' => TRUE,
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'text_plain',
      ),
    ),
  );
  field_create_instance($instance);
}

Functions