You are here

function socialmedia_setup_0_form in Social media 7

Checks if dependencies are installed

_state

Parameters

$form:

1 string reference to 'socialmedia_setup_0_form'
socialmedia_apps_app_configure_form in ./socialmedia.app.inc

File

./socialmedia.setup.inc, line 30
Setup wizard

Code

function socialmedia_setup_0_form($form, &$form_state) {
  $form = array();
  $output = '';
  $enabled = FALSE;
  if (!module_exists('widgets') && !($enabled = module_enable(array(
    'widgets',
  )))) {
    $output = t('In order to setup Social media you need to !install.', array(
      '!install' => l(t('install the Widgets module'), 'admin/modules'),
    ));
  }
  else {

    // check if module was just enabled, clear menu cache if yes
    if ($enabled) {
      menu_rebuild(TRUE);
      menu_cache_clear_all();
      cache_clear_all('theme_registry', 'cache', TRUE);
    }
    drupal_goto('admin/config/media/socialmedia/setup/1');
  }
  return $form;
}