You are here

print_pdf.install in Printer, email and PDF versions 5.3

Install file of the print_pdf module

File

print_pdf/print_pdf.install
View source
<?php

/**
 * @file
 * Install file of the print_pdf module
 */

/**
 * Implementation of hook_uninstall().
 */
function print_pdf_uninstall() {
  variable_del('print_pdf_settings');
  variable_del('print_pdf_show_link');
  variable_del('print_pdf_link_pos');
  variable_del('print_pdf_node_link_visibility');
  variable_del('print_pdf_node_link_pages');
  variable_del('print_pdf_link_class');
  variable_del('print_pdf_sys_link_visibility');
  variable_del('print_pdf_sys_link_pages');
  variable_del('print_pdf_book_link');
  variable_del('print_pdf_pdf_tool');
  variable_del('print_pdf_content_disposition');
  variable_del('print_pdf_paper_size');
  variable_del('print_pdf_page_orientation');
  $settings = db_query("SELECT name FROM {variable} WHERE name LIKE 'print\\_pdf\\_display\\_%'");
  while ($variable = db_fetch_object($settings)) {
    variable_del($variable->name);
  }
}

/**
 * Update to version 6.x-1.0
 */
function print_pdf_update_6000() {
  global $conf;
  $ret = array();
  if (isset($conf['print_pdf_settings'])) {
    $print_pdf_settings = variable_get('print_pdf_settings', '');
    variable_set('print_pdf_link_pos', array(
      'link' => $print_pdf_settings['show_link'] ? 'link' : 0,
    ));
    variable_set('print_pdf_show_link', max(1, $print_pdf_settings['show_link']));
    variable_set('print_pdf_node_link_visibility', $print_pdf_settings['node_link_visibility']);
    variable_set('print_pdf_node_link_pages', $print_pdf_settings['node_link_pages']);
    variable_set('print_pdf_link_class', $print_pdf_settings['link_class']);
    variable_set('print_pdf_sys_link_visibility', $print_pdf_settings['sys_link_visibility']);
    variable_set('print_pdf_sys_link_pages', $print_pdf_settings['sys_link_pages']);
    variable_set('print_pdf_book_link', $print_pdf_settings['book_link']);
    variable_set('print_pdf_pdf_tool', $print_pdf_settings['pdf_tool']);
    variable_set('print_pdf_content_disposition', $print_pdf_settings['content_disposition']);
    variable_set('print_pdf_paper_size', $print_pdf_settings['paper_size']);
    variable_set('print_pdf_page_orientation', $print_pdf_settings['page_orientation']);
    variable_del('print_pdf_settings');
  }
  return $ret;
}

Functions

Namesort descending Description
print_pdf_uninstall Implementation of hook_uninstall().
print_pdf_update_6000 Update to version 6.x-1.0