You are here

function print_update_6000 in Printer, email and PDF versions 5.x

Same name and namespace in other branches
  1. 6 print.install \print_update_6000()

Update to version 6.x-1.0

File

./print.install, line 141
Install file of the print module

Code

function print_update_6000() {
  global $conf;
  $ret = array();
  $lastversion = drupal_get_installed_schema_version('print');
  if ($lastversion >= 5300 && $lastversion < 6000) {
    return $ret;
  }
  if (isset($conf['print_settings'])) {
    $print_settings = variable_get('print_settings', '');
    variable_set('print_logo_options', $print_settings['logo_url'] ? 2 : 1);
    variable_set('print_logo_url', $print_settings['logo_url']);
    variable_set('print_css', $print_settings['css']);
    variable_set('print_urls', $print_settings['urls']);
    variable_set('print_comments', $print_settings['comments']);
    variable_set('print_newwindow', $print_settings['newwindow']);
    variable_del('print_settings');
  }
  if (isset($conf['print_sourceurl_settings'])) {
    $print_sourceurl_settings = variable_get('print_sourceurl_settings', '');
    variable_set('print_sourceurl_enabled', $print_sourceurl_settings['enabled']);
    variable_set('print_sourceurl_date', $print_sourceurl_settings['date']);
    variable_set('print_sourceurl_forcenode', $print_sourceurl_settings['forcenode']);
    variable_del('print_sourceurl_settings');
  }
  if (isset($conf['print_html_settings'])) {
    $print_html_settings = variable_get('print_html_settings', '');
    variable_set('print_html_link_pos', array(
      'link' => $print_html_settings['show_link'] ? 'link' : 0,
    ));
    variable_set('print_html_show_link', max(1, $print_html_settings['show_link']));
    variable_set('print_html_node_link_visibility', $print_html_settings['node_link_visibility']);
    variable_set('print_html_node_link_pages', $print_html_settings['node_link_pages']);
    variable_set('print_html_link_class', $print_html_settings['link_class']);
    variable_set('print_html_sys_link_visibility', $print_html_settings['sys_link_visibility']);
    variable_set('print_html_sys_link_pages', $print_html_settings['sys_link_pages']);
    variable_set('print_html_book_link', $print_html_settings['book_link']);
    variable_set('print_html_new_window', $print_html_settings['new_window']);
    variable_set('print_html_sendtoprinter', $print_html_settings['sendtoprinter']);
    variable_del('print_html_settings');
  }
  if (isset($conf['print_robot_settings'])) {
    $print_robot_settings = variable_get('print_robot_settings', '');
    variable_set('print_robots_noindex', $print_robot_settings['noindex']);
    variable_set('print_robots_nofollow', $print_robot_settings['nofollow']);
    variable_set('print_robots_noarchive', $print_robot_settings['noarchive']);
    variable_del('print_robot_settings');
  }
  return $ret;
}