You are here

function systeminfo_admin_settings in System Information 7.2

Menu callback; configues the display.

1 string reference to 'systeminfo_admin_settings'
systeminfo_menu in ./systeminfo.module
Implements of hook_menu().

File

./systeminfo.admin.inc, line 129
Admin page callbacks for the systeminfo module.

Code

function systeminfo_admin_settings($form, &$form_state) {

  // Drupal
  $form['drupal'] = array(
    '#type' => 'fieldset',
    '#title' => 'Drupal',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['drupal']['systeminfo_drupal_modules_sort'] = array(
    '#type' => 'radios',
    '#title' => t('Modules list'),
    '#default_value' => variable_get('systeminfo_drupal_modules_sort', 'name'),
    '#options' => array(
      'name' => t("Ascending sorted by module's name."),
      'filename' => t("Ascending sorted by module's filename."),
      'callup' => t("Ascending sorted by module's call-up."),
    ),
  );
  $form['drupal']['systeminfo_drupal_themes_sort'] = array(
    '#type' => 'radios',
    '#title' => t('Themes list'),
    '#default_value' => variable_get('systeminfo_drupal_themes_sort', 'name'),
    '#options' => array(
      'name' => t("Ascending sorted by theme's name."),
      'filename' => t("Ascending sorted by theme's filename."),
    ),
  );

  // PHP
  $form['php'] = array(
    '#type' => 'fieldset',
    '#title' => 'PHP',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['php']['systeminfo_php_phpinfo_parameter'] = array(
    '#type' => 'radios',
    '#title' => t('PHPinfo'),
    '#description' => t('Outputs a large amount of information about the current state of PHP.'),
    '#default_value' => variable_get('systeminfo_php_phpinfo_parameter', INFO_ALL),
    '#options' => array(
      INFO_GENERAL => t('The configuration line, php.ini location, build date, Web Server, System and more.'),
      INFO_CONFIGURATION => t('Current Local and Master values for PHP directives.'),
      INFO_MODULES => t('Loaded modules and their respective settings.'),
      INFO_ENVIRONMENT => t("Environment Variable information that's also available in \$_ENV."),
      INFO_VARIABLES => t('Shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).'),
      INFO_ALL => t('Shows all of the above.'),
    ),
  );

  // Buttons
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['actions']['cancel'] = array(
    '#markup' => l(t('Cancel'), 'admin/reports/systeminfo'),
  );
  $form['#submit'][] = 'system_settings_form_submit';
  if (!isset($form['#theme'])) {
    $form['#theme'] = 'system_settings_form';
  }
  if (!empty($_POST) && form_get_errors()) {
    drupal_set_message(t('The settings have not been saved because of the errors.'), 'error');
  }
  return $form;
}