You are here

function webform_update_7409 in Webform 7.4

Add progress bar columns to the webform table.

File

./webform.install, line 1766
Webform module install/schema hooks.

Code

function webform_update_7409() {
  if (!db_field_exists('webform', 'progressbar_bar')) {
    $int_schema = array(
      'type' => 'int',
      'size' => 'tiny',
      'not null' => TRUE,
      'default' => 0,
    );
    $varchar_schema = array(
      'type' => 'varchar',
      'length' => 255,
    );
    $int_schema['description'] = 'Boolean value indicating if the bar should be shown as part of the progress bar.';
    db_add_field('webform', 'progressbar_bar', $int_schema);
    $int_schema['description'] = 'Boolean value indicating if the page number should be shown as part of the progress bar.';
    db_add_field('webform', 'progressbar_page_number', $int_schema);
    $int_schema['description'] = 'Boolean value indicating if the percentage complete should be shown as part of the progress bar.';
    db_add_field('webform', 'progressbar_percent', $int_schema);
    $int_schema['description'] = 'Boolean value indicating if the pagebreak labels should be included as part of the progress bar.';
    db_add_field('webform', 'progressbar_pagebreak_labels', $int_schema);
    $int_schema['description'] = 'Boolean value indicating if the confirmation page should count as a page in the progress bar.';
    db_add_field('webform', 'progressbar_include_confirmation', $int_schema);
    $varchar_schema['description'] = 'Label for the first page of the progress bar.';
    db_add_field('webform', 'progressbar_label_first', $varchar_schema);
    $varchar_schema['description'] = 'Label for the last page of the progress bar.';
    db_add_field('webform', 'progressbar_label_confirmation', $varchar_schema);
    return t('New webform columns added.');
  }
}