You are here

function demo_admin_settings in Demonstration site (Sandbox / Snapshot) 6

Same name and namespace in other branches
  1. 5 demo.admin.inc \demo_admin_settings()
  2. 7 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() {
  global $base_url;
  $form['status'] = array(
    '#type' => 'fieldset',
    '#title' => t('Status'),
    '#collapsible' => FALSE,
  );
  if (variable_get('demo_reset_last', 0)) {
    $reset_date = format_date(variable_get('demo_reset_last', 0));
  }
  else {
    $reset_date = t('Never');
  }
  $form['status'][] = array(
    '#value' => t('<p><strong>Last reset:</strong> !date</p>', array(
      '!date' => $reset_date,
    )),
  );
  $fileconfig = demo_get_fileconfig();
  $form['dump'] = array(
    '#type' => 'fieldset',
    '#title' => t('Dump settings'),
  );
  $form['dump']['demo_dump_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Dump path'),
    '#default_value' => $fileconfig['path'],
    '#description' => t('Enter a writable directory where dump files of this demonstration site are stored, f.e. %files. The name of this site (e.g. %confpath) is automatically appended to this directory, if required.<br /><br /><strong>Note: For security reasons you should store site dumps outside of the document root of your webspace!</strong>', array(
      '%files' => file_directory_path() . '/demo',
      '%confpath' => $fileconfig['site'],
    )),
    '#required' => TRUE,
  );
  $form['#validate'][] = 'demo_admin_settings_validate';
  return system_settings_form($form);
}