You are here

function terms_of_use_admin_settings in Terms of Use 6

Same name and namespace in other branches
  1. 7 terms_of_use.admin.inc \terms_of_use_admin_settings()

Menu callback; show settings form.

See also

terms_of_use_admin_settings_validate()

2 string references to 'terms_of_use_admin_settings'
terms_of_use_js in ./terms_of_use.pages.inc
Menu callback for AHAH addition.
terms_of_use_menu in ./terms_of_use.module
Implementation of hook_menu().

File

./terms_of_use.module, line 47
Adds Terms of Use to the 'user_register' form.

Code

function terms_of_use_admin_settings() {

  // Adding the fieldset for node specification.
  $form['terms_of_use_text'] = array(
    '#type' => 'fieldset',
    '#prefix' => '<div id="fieldset-wrapper">',
    '#suffix' => '</div>',
  );
  $form['terms_of_use_text']['terms_of_use_node_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title of the post where your Terms of Use are published'),
    '#default_value' => variable_get('terms_of_use_node_title', ''),
    '#description' => t('Node <em>title</em> of the page or story (or blog entry or book page) where your Terms of Use are published.'),
    '#autocomplete_path' => 'node/autocomplete',
  );
  $form['terms_of_use_text']['terms_of_use_pick_node_id'] = array(
    '#type' => 'button',
    '#value' => t('I prefer to specify the node id'),
    '#weight' => 10,
    '#ahah' => array(
      'path' => 'terms_of_use/js',
      'wrapper' => 'fieldset-wrapper',
    ),
  );

  // Adding the fieldset for form specification.
  $form['terms_of_use_form'] = array(
    '#type' => 'fieldset',
  );
  $form['terms_of_use_form']['terms_of_use_fieldset_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Label for the fieldset'),
    '#default_value' => variable_get('terms_of_use_fieldset_name', t('Terms of Use')),
    '#description' => t('The text for the Terms of Use and the [x] checkbox are contained in a fieldset. Type here the title for that fieldset.'),
  );
  $form['terms_of_use_form']['terms_of_use_checkbox_label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label for the checkbox'),
    '#default_value' => variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')),
    '#description' => t('Type here something like "I agree with these terms." or "I CERTIFY THAT I AM OVER THE AGE OF 18 YEARS OLD.", without quotes. You can use the token @link to insert a link to the Terms in this label. For example, the label can be: "I agree with the @link.", without quotes. You may want to link to the Terms if you prefer not to show the full text of the Terms in the registration form. If you use the token, the Terms will not be shown.'),
  );
  return system_settings_form($form);
}