You are here

function webform2pdf_schema in Webform2PDF 6.2

Same name and namespace in other branches
  1. 6 webform2pdf.install \webform2pdf_schema()
  2. 7.4 webform2pdf.install \webform2pdf_schema()
  3. 7.3 webform2pdf.install \webform2pdf_schema()

Implementation of hook_schema().

File

./webform2pdf.install, line 49
Webform2pdf module install/schema hooks.

Code

function webform2pdf_schema() {
  $schema['webform2pdf'] = array(
    'description' => 'Database containing the settings of webform2pdf.',
    'fields' => array(
      'nid' => array(
        'description' => 'The node identifier of a webform2pdf.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'enabled' => array(
        'description' => 'Show if a pdf will be generated: 0: OFF, 1: ON.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'download' => array(
        'description' => 'Download PDF file after submitting the form.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'pdf_send_email' => array(
        'description' => 'Attach PDF file as an attachment to the e-mail.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'no_send_email_addr' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_format' => array(
        'description' => 'Size of a page in the PDF document.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => 'A4',
      ),
      'page_orientation' => array(
        'description' => 'Orientation of the PDF document.',
        'type' => 'varchar',
        'length' => 1,
        'not null' => TRUE,
        'default' => 'P',
      ),
      'h_left_logo' => array(
        'description' => 'Logo on the left side of the header.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'h_right_logo' => array(
        'description' => 'Logo on the right side of the header.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'f_left_logo' => array(
        'description' => 'Logo on the left side of the footer.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'f_right_logo' => array(
        'description' => 'Logo on the right side of the footer.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'h_font_size' => array(
        'description' => 'Header text font size.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 10,
      ),
      'p_font_size' => array(
        'description' => 'Body text font size.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 12,
      ),
      'f_font_size' => array(
        'description' => 'Footer text font size.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 10,
      ),
      'h_txt_align' => array(
        'description' => 'Alignment of the header text.',
        'type' => 'varchar',
        'length' => 1,
        'not null' => TRUE,
        'default' => 'L',
      ),
      'h_font_family' => array(
        'description' => 'Header text font type.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => 'dejavuserif',
      ),
      'p_txt_align' => array(
        'description' => 'Alignment of the body text.',
        'type' => 'varchar',
        'length' => 1,
        'not null' => TRUE,
        'default' => 'L',
      ),
      'p_font_family' => array(
        'description' => 'Font type of the body.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => 'dejavuserif',
      ),
      'f_txt_align' => array(
        'description' => 'Footer text aligment.',
        'type' => 'varchar',
        'length' => 1,
        'not null' => TRUE,
        'default' => 'L',
      ),
      'f_font_family' => array(
        'description' => 'Footer text font type.',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
        'default' => 'dejavuserif',
      ),
      'h_txt' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'normal',
        'description' => 'Header text.',
      ),
      'f_txt' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'normal',
        'description' => 'Footer text.',
      ),
      'p_body' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'normal',
        'description' => 'Text of the body.',
      ),
      'format' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Text input format type.',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}