You are here

function fb_enable in Drupal for Facebook 7.4

Implements hook_enable().

Configure applications designed to work with modules/fb.

1 call to fb_enable()
fb_update_7400 in ./fb.install
Install modules/fb 4.x schema.

File

./fb.install, line 128

Code

function fb_enable() {
  if (!variable_get('fb_enable_eg_apps', FALSE)) {

    // Don't enable starter apps on this site.
    return;
  }
  try {
    require_once drupal_get_path('module', 'fb') . '/fb.admin.inc';
    foreach (array(
      // Electric Groups application supports posting to facebook and other features.
      '138744759520314',
    ) as $fba) {
      $form_state = array(
        'values' => array(
          'fba' => $fba,
        ),
      );
      @drupal_form_submit('fb_admin_application_edit_form', $form_state);
    }
  } catch (Exception $e) {
    fb_log_exception($e, t('Error configuring default Facebook applications.'));
    drupal_set_message(t('Drupal for Facebook enabled, but did not configure default applications.'), 'warning');
  }
}