You are here

function faq_install in Frequently Asked Questions 7

Same name and namespace in other branches
  1. 8 faq.install \faq_install()
  2. 5.2 faq.install \faq_install()
  3. 5 faq.install \faq_install()
  4. 6 faq.install \faq_install()

Implements hook_install().

Inserts the FAQ module's schema in the SQL database.

File

./faq.install, line 84
FAQ module install file.

Code

function faq_install() {
  variable_set('node_type_faq', array(
    'status',
  ));
  $t = get_t();

  // Ensure the FAQ node type is available.
  node_types_rebuild();
  $types = node_type_get_types();
  node_add_body_field($types['faq']);

  // Change the default label on the body field.
  $body_instance = field_info_instance('node', 'body', 'faq');
  $body_instance['label'] = $t('Answer');
  field_update_instance($body_instance);

  // Add the detailed question field.
  _faq_add_custom_fields();

  // Shift all fields below the body field one down and put detailed question field where the body field was.
  _faq_shift_fields_down();
}