You are here

function og_menu_update_7301 in Organic Groups Menu (OG Menu) 7.3

Enable OG Menu functionality for all group content types (backwards compatibility).

File

./og_menu.install, line 182
Install, update and uninstall functions for the og_menu module.

Code

function og_menu_update_7301(&$sandbox) {
  $node_types = node_type_get_types();
  $group_content_types = array();
  foreach ($node_types as $type) {
    if (og_is_group_content_type('node', $type->type)) {
      variable_set('og_menu_enable_' . $type->type, TRUE);
      $group_content_types[$type->type] = $type->name;
    }
  }
  if (!empty($group_content_types)) {
    drupal_set_message(t("For backwards compatibility reasons, this update has\n      enabled OG Menu functionality for the following group content types:\n      %types. You can manually disable this on the !ctypes settings page.", array(
      '%types' => implode(', ', $group_content_types),
      '!ctypes' => l(t('content types'), 'admin/structure/types'),
    )));
  }
}