You are here

function jstimer_update_7000 in Javascript Timer 7

Same name and namespace in other branches
  1. 8 jstimer.install \jstimer_update_7000()

Updates separate jstimer format variables to new array format.

File

./jstimer.install, line 13
Install, update and uninstall functions for the jstimer module. No db schema, just the variables.

Code

function jstimer_update_7000() {
  $formats = array();
  $formats[] = variable_get('jstimer_output_format', '');
  $formats[] = variable_get('jstimer_output_format_1', '');
  $formats[] = variable_get('jstimer_output_format_2', '');
  $formats[] = variable_get('jstimer_output_format_3', '');
  foreach ($formats as $i => $format) {
    if ($format == '') {
      unset($formats[$i]);
    }
  }
  $formats = array_values($formats);
  variable_set('jst_timer_formats', $formats);
  variable_del('jstimer_output_format');
  variable_del('jstimer_output_format_1');
  variable_del('jstimer_output_format_2');
  variable_del('jstimer_output_format_3');
  $msg = variable_get('jstimer_complete_statement', '');
  variable_set('jst_timer_complete_message', $msg);
}