You are here

function og_update_5701 in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og.install \og_update_5701()
  2. 5.3 og.install \og_update_5701()
  3. 5.7 og.install \og_update_5701()
  4. 6.2 og.install \og_update_5701()
  5. 6 og.install \og_update_5701()

Update variables to new content type system. Also rebuild node_access for new grants system.

Return value

void

File

./og.install, line 477

Code

function og_update_5701() {
  $ret = array();
  $types = node_get_types();
  foreach ($types as $type) {
    if (in_array($type->type, variable_get('og_node_types', array(
      'og',
    )))) {
      variable_set('og_content_type_usage_' . $type->type, 'group');
    }
    elseif (in_array($type->type, variable_get('og_omitted', array(
      'og',
    )))) {
      variable_set('og_content_type_usage_' . $type->type, 'omitted');
    }
    elseif (in_array($type->type, variable_get('og_omitted_email_node_types', array(
      'og',
    )))) {
      variable_set('og_content_type_usage_' . $type->type, 'group_post_standard_nomail');
    }
    else {
      variable_set('og_content_type_usage_' . $type->type, 'group_post_standard_mail');
    }
  }
  node_access_rebuild();
  return $ret;
}