You are here

function apps_demo_content_form in Apps 7

Form callback for demo content

_state

Parameters

$form:

$app:

Return value

array

1 string reference to 'apps_demo_content_form'
apps_app_config_page in ./apps.pages.inc
Callback for app config page

File

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

Code

function apps_demo_content_form($form, &$form_state, $app) {
  $form = array();
  $cb = apps_app_callback($app, 'demo content enabled callback');
  $enabled = $cb($app);
  $form['demo_content_group'] = array(
    '#type' => 'fieldset',
    '#title' => t("Demo Content for @app", array(
      '@app' => $app['name'],
    )),
  );
  $form['demo_content_group']['demo_content_current'] = array(
    '#markup' => filter_xss($app['demo content description']) . " <i>" . t("Demo content for @app is currently !state", array(
      '@app' => $app['name'],
      '!state' => $enabled ? t('enabled') : t('disabled'),
    )) . ".</i><br /><br />",
  );
  $form['demo_content_action'] = array(
    '#type' => 'value',
    '#value' => !$enabled,
  );
  $form['app'] = array(
    '#type' => 'value',
    '#value' => $app,
  );
  $form['demo_content_group']['demo_content_button'] = array(
    '#type' => 'button',
    '#value' => !$enabled ? t('Enable Demo Content') : t('Disable Demo Content'),
    '#submit' => array(
      'apps_demo_content_form_submit',
    ),
    '#executes_submit_callback' => TRUE,
  );
  return $form;
}