You are here

function cdn_admin_advanced_settings_form in CDN 6

Form definition; advanced settings.

1 string reference to 'cdn_admin_advanced_settings_form'
cdn_menu in ./cdn.module
Implementation of hook_menu().

File

./cdn.admin.inc, line 102
Settings administration UI.

Code

function cdn_admin_advanced_settings_form() {

  // Immediately show the user the current status, unless the user is
  // currently editing the values in the form.
  if (!isset($_POST['form_build_id'])) {
    $synced_files_db = variable_get(CDN_ADVANCED_SYNCED_FILES_DB_VARIABLE, FALSE);
    if ($synced_files_db !== FALSE) {
      if (file_exists($synced_files_db) && @fopen($synced_files_db, 'r')) {
        drupal_set_message(t('The synced files database was found and can be opened for reading.'));
      }
      else {
        drupal_set_message(t('The synced files database could not be opened for reading!', 'error'));
      }
    }
  }
  $form[CDN_ADVANCED_SYNCED_FILES_DB_VARIABLE] = array(
    '#type' => 'textfield',
    '#title' => t('Synced files database'),
    '#description' => t('Enter the full path to the daemon\'s synced files database file.'),
    '#size' => 60,
    '#default_value' => variable_get(CDN_ADVANCED_SYNCED_FILES_DB_VARIABLE, ''),
  );
  return system_settings_form($form);
}