You are here

function apps_demo_content_form_submit in Apps 7

Submit handler for demo content form

_state

Parameters

$form:

1 string reference to 'apps_demo_content_form_submit'
apps_demo_content_form in ./apps.manifest.inc
Form callback for demo content

File

./apps.manifest.inc, line 691
Handles pulling and processing of app data from the server

Code

function apps_demo_content_form_submit($form, &$form_state) {
  $app = $form_state['values']['app'];
  $enable = $form_state['values']['demo_content_action'];
  if ($enable) {
    $cb = apps_app_callback($app, 'demo content enable callback');
    $success = $cb($app);
    if ($success) {
      drupal_set_message(t("Enabled demo content for @app", array(
        '@app' => $app['name'],
      )));
    }
  }
  else {
    $cb = apps_app_callback($app, 'demo content disable callback');
    $success = $cb($app);
    if ($success) {
      drupal_set_message(t("Disabled demo content for  @app", array(
        '@app' => $app['name'],
      )));
    }
  }
}