You are here

system_status.admin.inc in System Status 6.2

Same filename and directory in other branches
  1. 7 system_status.admin.inc

Admin forms for system_status

File

system_status.admin.inc
View source
<?php

/**
 * @file
 * Admin forms for system_status
 */

/**
 * Page callback: System settings settings.
 *
 * @see system_status_menu()
 */
function system_status_form(&$form_state) {
  $form['system_status_service_allow_drupalstatus'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow reporting to DrupalStatus.org'),
    '#description' => t('Allow reports to be generated by DrupalStatus. The reports will be stored and send using encryption and are only accessible using your account credentials on DrupalStatus.org'),
    '#default_value' => variable_get('system_status_service_allow_drupalstatus', '1'),
    '#disabled' => TRUE,
  );
  $form['add_site'] = array(
    '#type' => 'submit',
    '#value' => t('Add this site to your DrupalStatus.org overview'),
    '#submit' => array(
      'system_status_add_site',
    ),
  );
  return $form;
}
function system_status_add_site($form, &$form_state) {
  global $base_url;
  $site_url = urlencode($base_url);
  $site_url .= "|" . variable_get('system_status_token', 'Error-no-token');
  $site_url .= "|" . variable_get('system_status_encrypt_token', 'Error-no-token');
  $url = "https://www.drupalstatus.org/addsite?op=addSite&siteUrl={$site_url}";
  if (module_exists('overlay') && overlay_get_mode() == 'child') {
    unset($_GET['destination']);
    overlay_close_dialog($url, array(
      'external' => TRUE,
    ));
    $form_state['redirect'] = FALSE;
  }
  else {
    $form_state['redirect'] = $url;
  }
}

Functions

Namesort descending Description
system_status_add_site
system_status_form Page callback: System settings settings.