You are here

function glossary_update_5103 in Glossary 5.2

Implementation of hook_update_N(). We have moved the settings, so we'll remind the user of this.

File

./glossary.install, line 45
Install file for Glossary module.

Code

function glossary_update_5103() {
  $ret = array();

  // Find out how many input formats are set.
  $filter_count = db_result(db_query('SELECT MAX( format ) FROM {filters}'));
  for ($i = 0; $i <= $filter_count; ++$i) {
    $name = 'glossary_absolute_' . $i;
    $abs = variable_get($name, NULL);
    if (is_null($abs)) {
      continue;
    }
    $link = 'glossary_link_' . $i;
    if ($abs) {
      $value = 'absolute';
    }
    else {
      $value = 'normal';
    }
    variable_del($name);
    variable_set($link, $value);
    watchdog('Glossary', t('Glossary variable %abs deleted; %link set to %new', array(
      '%abs' => $name,
      '%link' => $link,
      '%new' => $value,
    )));
  }
  return $ret;
}