You are here

function htaccess_admin in Htaccess 7

1 string reference to 'htaccess_admin'
htaccess_menu in ./htaccess.module
Implementation of hook_menu

File

./htaccess.module, line 61

Code

function htaccess_admin() {
  $options_www_prefix = array(
    HTACCESS_PREFIX_WWW => t('Redirect users to www prefix'),
    HTACCESS_PREFIX_NON_WWW => t('Redirect users to non www prefix'),
  );
  $options_symlinks = array(
    HTACCESS_FOLLOWSYMLINKS => t('Options +FollowSymLinks'),
    HTACCESS_SYMLINKSIFOWNERSMATCH => t('Options +SymLinksifOwnerMatch'),
  );
  $form['main'] = array(
    '#type' => 'fieldset',
    '#title' => t('Main Settings'),
    '#description' => t('When clicking on Save a new root htaccess will be created based on your selections. Test this out in a development environment as an incorrect htaccess will break your entire site!'),
    '#weight' => -50,
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['main']['htaccess_www_or_non_www'] = array(
    '#type' => 'radios',
    '#title' => t('www or non www prefix'),
    '#options' => $options_www_prefix,
    '#default_value' => variable_get('htaccess_www_or_non_www', HTACCESS_PREFIX_NON_WWW),
  );
  $form['main']['htaccess_symlinks'] = array(
    '#type' => 'radios',
    '#title' => t('follow symlinks or SymLinksifOwnerMatch '),
    '#options' => $options_symlinks,
    '#default_value' => variable_get('htaccess_symlinks', HTACCESS_FOLLOWSYMLINKS),
  );
  $form['#submit'][] = 'htaccess_admin_settings_submit';

  //dpm (variable_get('htaccess_www_or_non_www', HTACCESS_PREFIX_NON_WWW));

  //dpm(variable_get('htaccess_symlinks', HTACCESS_FOLLOWSYMLINKS));
  return system_settings_form($form);
}