You are here

function bootstrap_tour_setup_step_field in Bootstrap Tour 7.2

2 calls to bootstrap_tour_setup_step_field()
bootstrap_tour_install in ./bootstrap_tour.install
Implements hook_install().
bootstrap_tour_update_7200 in ./bootstrap_tour.install
Upgrade old 1.x tours to the new 2.x Entity format, then delete the old DB table.

File

./bootstrap_tour.install, line 322

Code

function bootstrap_tour_setup_step_field() {
  $field = array(
    'field_name' => 'bootstrap_tour_step_reference',
    'type' => 'entityreference',
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
    'settings' => array(
      'target_type' => 'bootstrap_tour_step',
      'handler_settings' => array(
        'target_bundles' => NULL,
      ),
    ),
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'bootstrap_tour_step_reference',
    'entity_type' => 'bootstrap_tour',
    'bundle' => 'bootstrap_tour',
    'label' => 'Tour Steps',
    'widget' => array(
      'weight' => '10',
      'type' => 'inline_entity_form',
      'module' => 'inline_entity_form',
      'active' => 1,
      'settings' => array(
        'fields' => array(),
        'type_settings' => array(
          'allow_existing' => 0,
          'match_operator' => 'CONTAINS',
          'delete_references' => 1,
          'override_labels' => 1,
          'label_singular' => 'step',
          'label_plural' => 'steps',
        ),
      ),
    ),
    'settings' => array(
      'target_type' => 'bootstrap_tour_step',
      'handler_settings' => array(
        'target_bundles' => NULL,
      ),
    ),
    'display' => array(
      'default' => array(
        'label' => 'inline',
        'type' => 'entityreference_label',
      ),
    ),
  );
  field_create_instance($instance);
}