You are here

function notifications_update_5 in Notifications 6.3

Same name and namespace in other branches
  1. 5 notifications.install \notifications_update_5()
  2. 6.4 notifications.install \notifications_update_5()
  3. 6 notifications.install \notifications_update_5()
  4. 6.2 notifications.install \notifications_update_5()

Update content type and taxonomy options

File

./notifications.install, line 291

Code

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

  // Content types
  if ($omitted = variable_get('notifications_omitted_content_types', array())) {
    $allowed = array();
    $types = node_get_types();
    foreach ($types as $type => $info) {
      if (!isset($omitted[$type])) {
        $allowed[$type] = $type;
      }
    }
    variable_set('notifications_content_types', $allowed);
  }

  // Vocabularies
  if ($omitted = variable_get('notifications_omitted_taxa', array())) {
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($omitted as $vid) {
      unset($vocabularies[$vid]);
    }
    variable_set('notifications_tags_vocabularies', array_combine(array_keys($vocabularies), array_keys($vocabularies)));
  }
  return $ret;
}