You are here

function demo_admin_settings in Demonstration site (Sandbox / Snapshot) 7

Same name and namespace in other branches
  1. 5 demo.admin.inc \demo_admin_settings()
  2. 6 demo.admin.inc \demo_admin_settings()

Form builder for Demo module settings.

1 string reference to 'demo_admin_settings'
demo_menu in ./demo.module
Implements hook_menu().

File

./demo.admin.inc, line 16
Demonstration Site administrative pages.

Code

function demo_admin_settings($form, &$form_state) {
  if (!file_stream_wrapper_valid_scheme('private')) {
    form_set_error('', t('The <a href="@file-settings-url">private filesystem</a> must be configured in order to create or load snapshots.', array(
      '@file-settings-url' => url('admin/config/media/file-system', array(
        'query' => drupal_get_destination(),
      )),
    )));
  }
  $form['demo_dump_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Snapshot file system path'),
    '#field_prefix' => 'private://',
    '#default_value' => variable_get('demo_dump_path', 'demo'),
    '#required' => TRUE,
  );
  $form['#validate'][] = 'demo_admin_settings_validate';
  return system_settings_form($form);
}