You are here

function party_hat_install in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_hat/party_hat.install \party_hat_install()

Implements hook_install().

File

modules/party_hat/party_hat.install, line 113
Contains install hooks for the party hat module..

Code

function party_hat_install() {
  field_info_cache_clear();
  if (!field_info_field('party_hat')) {
    $field = array(
      'field_name' => 'party_hat',
      'type' => 'hat_reference',
      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
      'settings' => array(),
    );
    field_create_field($field);
    $instance = array(
      'field_name' => 'party_hat',
      'entity_type' => 'party',
      'bundle' => 'party',
      'label' => st('Hats'),
      'required' => FALSE,
      'description' => st("This party's hats"),
      'default_value_function' => 'party_hat_field_get_default',
      'widget' => array(
        'type' => 'options_buttons',
        'settings' => array(),
      ),
      'display' => array(
        'default' => array(
          'type' => 'hat_reference_default',
          'label' => 'inline',
        ),
      ),
    );
    field_create_instance($instance);
  }
}