You are here

function drupal_sites_registry_settings in Drupal 5

1 string reference to 'drupal_sites_registry_settings'
drupal_menu in modules/drupal/drupal.module
Implementation of hook_menu().

File

modules/drupal/drupal.module, line 48
Lets users log in using a Drupal ID and can notify a central server about your site.

Code

function drupal_sites_registry_settings() {

  // Check if all required fields are present
  if (variable_get('site_name', 'Drupal') == 'Drupal' || variable_get('site_name', 'Drupal') == '') {
    form_set_error('drupal_directory', t('You must set the name of your site on the <a href="@url">administer &raquo; settings &raquo; site information</a> page.', array(
      '@url' => url('admin/settings/site-information'),
    )));
  }
  else {
    if (variable_get('site_mail', ini_get('sendmail_from')) == '') {
      form_set_error('drupal_directory', t('You must set an e-mail address for your site on the <a href="@url">site information settings page</a>.', array(
        '@url' => url('admin/settings/site-information'),
      )));
    }
    else {
      if (variable_get('site_slogan', '') == '') {
        form_set_error('drupal_directory', t('You must set your site slogan on the <a href="@url">site information settings page</a>.', array(
          '@url' => url('admin/settings/site-information'),
        )));
      }
      else {
        if (variable_get('site_mission', '') == '') {
          form_set_error('drupal_directory', t('You must set your site mission on the <a href="@url">site information settings page</a>.', array(
            '@url' => url('admin/settings/site-information'),
          )));
        }
      }
    }
  }
  $options = array(
    '1' => t('Enabled'),
    '0' => t('Disabled'),
  );
  $form['drupal_register'] = array(
    '#type' => 'radios',
    '#title' => t('Register with a Drupal server'),
    '#default_value' => variable_get('drupal_register', 0),
    '#options' => $options,
    '#description' => t("If enabled, your Drupal site will register itself with the specified Drupal XML-RPC server. For this to work properly, you must set your site's name, e-mail address, slogan and mission statement. When the Drupal XML-RPC server field is set to %drupal-xml-rpc, your web site will register itself with drupal.org. Requires the cron feature to be enabled.", array(
      "%drupal-xml-rpc" => "http://drupal.org/xmlrpc.php",
    )),
  );
  $form['drupal_server'] = array(
    '#type' => 'textfield',
    '#title' => t('Drupal XML-RPC server'),
    '#default_value' => variable_get('drupal_server', 'http://drupal.org/xmlrpc.php'),
    '#description' => t('The URL of the Drupal XML-RPC server you wish to register with.'),
  );
  $form['drupal_system'] = array(
    '#type' => 'radios',
    '#title' => t('Send system information'),
    '#default_value' => variable_get('drupal_system', 0),
    '#options' => $options,
    '#description' => t("If enabled, your site will send information on its installed components (modules, themes, and theme engines). This information can help in compiling statistics on usage of Drupal projects."),
  );
  $form['drupal_statistics'] = array(
    '#type' => 'radios',
    '#title' => t('Send statistics'),
    '#default_value' => variable_get('drupal_statistics', 0),
    '#options' => $options,
    '#description' => t("If enabled, your site will send summary statistics on the number of registered users and the total number of posts. No private information will be sent. These data help to improve the ranking statistics of Drupal projects."),
  );
  $form['drupal_client_service'] = array(
    '#type' => 'radios',
    '#title' => t('Allow other Drupal sites to register'),
    '#default_value' => variable_get('drupal_client_service', 0),
    '#options' => $options,
    '#description' => t('If enabled, your Drupal site will allow other sites to register with your site and send information to this site. This functionality can be used to maintain a list of related sites.'),
  );
  return system_settings_form($form);
}