You are here

function tableofcontents_update_6001 in Table of Contents 6.3

Same name and namespace in other branches
  1. 7 tableofcontents.install \tableofcontents_update_6001()

Implementation of hook_update_#()

File

./tableofcontents.install, line 64
tableofcontents.install

Code

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

  // remove the list type variable, copy only if it were in use as 'ol'
  $sql = "SELECT format FROM {filter_formats}";
  $result = db_query($sql);
  while ($row = db_fetch_array($result)) {
    $format = $row['format'];
    if (variable_get('tableofcontents_list_type_' . $format, 'ol') == 'ol' && variable_get('tableofcontents_numbering_' . $format, 0) == 0) {
      variable_set('tableofcontents_numbering_' . $format, 4);
    }

    // To make sure people can always go back a version, keep those...

    //variable_del('tableofcontents_list_type_' . $format);
  }

  // is that automatic on an update or do we have to do it ourselves?
  // some modules do call it so I think we might have to...
  cache_clear_all('theme_registry:', 'cache', TRUE);
  return $ret;
}