You are here

nodeformsettings.install in Node and Comments Form Settings 7.2

Install, update and uninstall functions for the nodeformsettings module.

File

nodeformsettings.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the nodeformsettings module.
 */

/**
 * Implements hook_install().
 *
 * Display a welcome message.
 */
function nodeformsettings_install() {

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

  /* db_query("UPDATE {system} SET weight = 1 WHERE name = 'nodeformsettings'") */
  db_update('system')
    ->fields(array(
    'weight' => 1,
  ))
    ->condition('name', 'nodeformsettings')
    ->execute();
  drupal_set_message(st('Node Form Settings is now installed. Customize your content types at <a href="@contenttypes">the content types settings page</a>.', array(
    '@contenttypes' => url('admin/structure/types'),
  )));
}

/**
 * Implements hook_uninstall().
 *
 * Remove the variables this module created.
 */
function nodeformsettings_uninstall() {

  // Remove all variables we created.
  $variables = db_query('SELECT name FROM {variable} WHERE name LIKE :name', array(
    ':name' => 'nodeformsettings%%',
  ));
  foreach ($variables as $variable) {
    variable_del($variable->name);
  }

  // @todo update_sql has been removed. Use the database API for any schema or data changes.
  array();
}

Functions