You are here

function _commons_convert_administrator_to_group in Drupal Commons 7.3

BatchAPI callback.

See also

commons_demo_content()

1 string reference to '_commons_convert_administrator_to_group'
commons_install_additional_modules in ./commons.install
Task callback: uses Batch API to enable modules based on user selection.

File

./commons.install_callbacks.inc, line 221
Contains Batch API callbacks used during installation.

Code

function _commons_convert_administrator_to_group($operation, &$context) {
  $context['message'] = t('@operation', array(
    '@operation' => $operation,
  ));
  $wrapper = entity_metadata_wrapper('user', 1);
  $wrapper->{OG_GROUP_FIELD}
    ->set(TRUE);
  $wrapper
    ->save();

  // Don't display the 'registration settings have been saved' message.
  drupal_get_messages('status', TRUE);
  drupal_get_messages('completed', TRUE);

  // Delete the demo content variable
  variable_del('commons_selected_extras');
}