You are here

function custom_pub_update_6120 in Custom Publishing Options 6

Implements hook_update_N().

File

./custom_pub.install, line 24
Install and update functions for Custom Publishing Options.

Code

function custom_pub_update_6120() {
  $types = variable_get('custom_pub_types', array());
  $node_types = variable_get('custom_pub_node_types', array());
  foreach ($types as $type => $name) {
    $new_types[$type]['type'] = $type;
    $new_types[$type]['name'] = $name;
  }
  foreach ($node_types as $node_type => $types_on) {
    foreach ($types_on as $type => $name) {
      $new_types[$type]['node_types'][$node_type] = TRUE;
    }
  }
  variable_set('custom_pub_types', $new_types);
  variable_del('custom_pub_node_types');
  return array();
}