You are here

function apps_app_disable in Apps 7

Callback for app disable

1 string reference to 'apps_app_disable'
apps_menu in ./apps.module
Implements hook_menu().

File

./apps.pages.inc, line 370
The page callbacks for the Apps module.

Code

function apps_app_disable($app) {
  $token_name = 'disable-' . $app['machine_name'];
  if ($confirm_form = apps_display_confirm_form(t('Are you sure you want to disable @name?', array(
    '@name' => $app['name'],
  )), $token_name)) {
    return $confirm_form;
  }

  // Force the user to disable demo content before disabling the app
  if (($is_cb = apps_app_callback($app, "demo content enabled callback")) && $is_cb($app)) {
    $next = apps_app_page_path($app, 'configure');
    drupal_set_message(t("Please disable demo content before disabling the app"));
    drupal_goto($next);
  }
  module_disable(array(
    $app['machine_name'],
  ));
  drupal_flush_all_caches();
  drupal_set_message(t("Disabled @name app", array(
    '@name' => $app['name'],
  )));
  $next = apps_app_page_path($app);
  drupal_goto($next);
}