You are here

function fillpdf_update_7003 in FillPDF 7

Same name and namespace in other branches
  1. 7.2 fillpdf.install \fillpdf_update_7003()

Convert legacy config variables to new fillpdf_service variable and delete.

File

./fillpdf.install, line 217
Install.

Code

function fillpdf_update_7003() {
  $default = FALSE;
  global $conf;
  foreach (array(
    'fillpdf_remote_service',
    'fillpdf_local_service',
    'fillpdf_local_php',
  ) as $variable_name) {
    if (isset($conf[$variable_name])) {
      if ($conf[$variable_name]) {
        $default = $variable_name;
      }
      variable_del($variable_name);
    }
  }
  if ($default) {
    $variable_name_map = array(
      'fillpdf_local_php' => 'pdftk',
      'fillpdf_local_service' => 'local',
      'fillpdf_remote_service' => 'remote',
    );
    variable_set('fillpdf_service', $variable_name_map[$default]);
  }
}