You are here

function ife_install in Inline Form Errors 7

Same name and namespace in other branches
  1. 6.2 ife.install \ife_install()
  2. 6 ife.install \ife_install()
  3. 7.2 ife.install \ife_install()

Implements hook_install().

File

./ife.install, line 56
Install file

Code

function ife_install() {

  // TODO The drupal_(un)install_schema functions are called automatically in D7.
  // drupal_install_schema('ife')
  // TODO Please review the conversion of this statement to the D7 database API syntax.

  /* db_query("UPDATE {system} SET weight = 1000 WHERE name = 'ife'") */
  db_update('system')
    ->fields(array(
    'weight' => 1000,
  ))
    ->condition('name', 'ife')
    ->execute();

  // insert some defaults
  $form_ids = array(
    'comment_form',
    'contact_mail_user',
    'contact_mail_page',
    'user_register_form',
    'user_pass',
    'user_login',
    'user_login_block',
    'forum_node_form',
  );
  foreach ($form_ids as $form_id) {

    // TODO Please review the conversion of this statement to the D7 database API syntax.

    /* db_query("INSERT INTO {ife} (form_id, field_types, status) VALUES ('%s', NULL, 0)", $form_id) */
    $id = db_insert('ife')
      ->fields(array(
      'form_id' => $form_id,
      'field_types' => NULL,
      'status' => 0,
    ))
      ->execute();
  }
}