You are here

function signature_forum_update_1 in Signatures for Forums 5.2

Same name and namespace in other branches
  1. 5 signature_forum.install \signature_forum_update_1()

Implementation of hook_update()

File

./signature_forum.install, line 61

Code

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

  // Get values and put into new array structure
  foreach (node_get_types('names') as $type => $name) {
    $settings['signature_forum_show_for_' . $type] = variable_get('signature_forum_show_for_' . $type, 0);
    variable_del('signature_forum_show_for_' . $type);
  }
  $settings['signature_forum_template'] = variable_get('signature_forum_template', "__________________\n<p>%s</p>");
  $settings['signature_forum_format'] = variable_get('signature_forum_format', FILTER_FORMAT_DEFAULT);
  $settings['signature_forum_line_limit'] = variable_get('signature_forum_line_limit', 0);
  $settings['signature_forum_min_content_length'] = variable_get('signature_forum_min_content_length', 0);
  $settings['signature_forum_min_content_length_action'] = variable_get('signature_forum_min_content_length_action', 0);
  $settings['signature_forum_min_content_length_filter'] = variable_get('signature_forum_min_content_length_filter', FILTER_FORMAT_DEFAULT);
  variable_set('signature_forum_settings', $settings);

  // Delete values
  variable_del('signature_forum_template');
  variable_del('signature_forum_format');
  variable_del('signature_forum_line_limit');
  variable_del('signature_forum_min_content_length');
  variable_del('signature_forum_min_content_length_action');
  variable_del('signature_forum_min_content_length_filter');
  variable_del('signature_forum_roles');
  return $ret;
}