You are here

function webform_protected_downloads_update_7001 in Webform Protected Downloads 7

Add fields to store text formats. Add a field to store redirect information.

File

./webform_protected_downloads.install, line 171

Code

function webform_protected_downloads_update_7001() {
  if (!db_field_exists('wpd_node_configuration', 'text_download_access_format')) {
    db_add_field('wpd_node_configuration', 'text_download_access_format', array(
      'description' => 'The input format used for the text, above the file listing',
      'type' => 'varchar',
      'length' => '255',
      'not null' => TRUE,
      'default' => '',
    ));
  }
  if (!db_field_exists('wpd_node_configuration', 'text_download_noaccess_format')) {
    db_add_field('wpd_node_configuration', 'text_download_noaccess_format', array(
      'description' => 'The input format used for the text, if access can not be granted',
      'type' => 'varchar',
      'length' => '255',
      'not null' => TRUE,
      'default' => '',
    ));
  }
  if (!db_field_exists('wpd_node_configuration', 'redirect')) {
    db_add_field('wpd_node_configuration', 'redirect', array(
      'description' => 'Whether the user should be redirected to the downloads page after form submission',
      'type' => 'int',
      'size' => 'tiny',
      'unsigned' => TRUE,
      'not null' => TRUE,
      'default' => 0,
    ));
  }
}