--- legal.module 2008-08-02 09:36:32.000000000 -0400
+++ legal.module-offlein001 2009-04-17 18:16:01.000000000 -0400
@@ -9,7 +9,7 @@ function legal_help($path, $arg) {
switch ($path) {
case 'admin/help#legal':
- $output .= t('Display a Terms & Conditions statement on the registration page, require visitor to accept T&C to register.');
+ $output .= t('Display a Terms & Conditions statement on the registration page, require visitor to accept T&C to register.');
$output .= t('When a user creates an account they are required to accept your Terms & Conditions to complete their registration.');
break;
case 'admin/settings/legal':
@@ -48,13 +48,13 @@ function legal_menu() {
'description' => 'Display Terms and Conditions statement on the registration page.',
);
$items['legal'] = array(
- 'title' => 'Terms and Conditions',
+ 'title' => variable_get('legal_terminology', 'Terms & Conditions of Use'),
'page callback' => 'legal_page',
'access arguments' => array('view Terms and Conditions'),
'type' => MENU_CALLBACK
);
$items['legal_accept/%/%'] = array(
- 'title' => 'Terms and Conditions',
+ 'title' => variable_get('legal_terminology', 'Terms & Conditions of Use'),
'page callback' => 'drupal_get_form',
'page arguments' => array('legal_login', 1, 2),
'access callback' => TRUE,
@@ -80,7 +80,7 @@ function legal_theme() {
function legal_display_fields($conditions) {
$form = array();
- $accept_label = t('Accept Terms & Conditions of Use');
+ $accept_label = t('Accept ' . variable_get('legal_terminology', 'Terms & Conditions of Use'));
$form['current_id'] = array(
'#type' => 'value',
@@ -99,7 +99,7 @@ function legal_display_fields($condition
$form['legal'] = array(
'#type' => 'fieldset',
- '#title' => t('Terms and Conditions of Use'),
+ '#title' => t(variable_get('legal_terminology', 'Terms & Conditions of Use')),
'#weight' => 29,
);
@@ -115,13 +115,13 @@ function legal_display_fields($condition
$form['legal']['conditions'] = array(
'#value' => ' ',
);
- $accept_label = t('Accept !terms of Use', array('!terms' => l('Terms & Conditions', 'legal')));
+ $accept_label = t('Accept !terms', array('!terms' => l(variable_get('legal_terminology', 'Terms & Conditions of Use'), 'legal')));
break;
default: // scroll box (HTML)
$form['legal']['conditions'] = array(
'#type' => 'textarea',
- '#title' => t('Terms & Conditions'),
+ '#title' => t(variable_get('legal_terminology', 'Terms & Conditions of Use')),
'#default_value' => $conditions['conditions'],
'#value' => $conditions['conditions'],
'#rows' => 10,
@@ -187,11 +187,21 @@ function legal_administration() {
'#description' => t('Your Terms & Conditions'),
'#required' => TRUE,
);
-
+
// overide accept checbox requirement on preview
$form['legal']['legal_accept']['#required'] = FALSE;
// overide display setting
+
+ $form['terminology'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Terminology for T&C'),
+ '#default_value' => variable_get('legal_terminology', 'Terms & Conditions Of Use'),
+ '#size' => 60,
+ '#required' => TRUE,
+ '#weight' => -1,
+ );
+
$form['display'] = array(
'#type' => 'radios',
'#title' => t('Display Style'),
@@ -272,24 +282,24 @@ function legal_preview($form, $form_valu
$form['legal']['conditions'] = array(
'#value' => filter_xss_admin($form['conditions']['#value']),
);
- $form['legal']['legal_accept']['#title'] = t('Accept Terms & Conditions of Use');
+ $form['legal']['legal_accept']['#title'] = t('Accept ' . $form_values['values']['terminology']);
break;
case 3: // Page Link
$form['legal']['conditions'] = array(
'#value' => ' ',
);
- $form['legal']['legal_accept']['#title'] = t('Accept !terms of Use', array('!terms' => l('Terms & Conditions', 'legal')));
+ $form['legal']['legal_accept']['#title'] = t('Accept !terms', array('!terms' => l($form_values['values']['terminology'], 'legal')));
break;
default: // scroll box (HTML)
$form['legal']['conditions'] = array(
'#type' => 'textarea',
- '#title' => t('Terms & Conditions'),
+ '#title' => t($form_values['values']['terminology']),
'#value' => $form['conditions']['#value'],
'#parents' => array('legal'),
'#rows' => 10,
'#attributes' => array('readonly' => 'readonly'),
);
- $form['legal']['legal_accept']['#title'] = t('Accept Terms & Conditions of Use');
+ $form['legal']['legal_accept']['#title'] = t('Accept ' . $form_values['values']['terminology'] . ' of Use');
}
// overide additional checkboxes in preview
@@ -313,6 +323,7 @@ function legal_preview($form, $form_valu
function legal_administration_validate($form, &$form_state) {
if ( empty($form_state['values']['conditions']) ) form_set_error('conditions', t('Terms & Conditions must be entered.'));
+ if ( empty($form_state['values']['terminology']) ) form_set_error('terminology', t('Terminology must be entered.'));
return;
}
@@ -321,6 +332,11 @@ function legal_administration_submit($fo
$values = $form_state['values'];
if ($form_state['clicked_button']['#value'] == t('Preview')) return;
+ if ( variable_get('legal_terminology', '0') != $form_state['values']['terminology'] ) {
+ variable_set('legal_terminology', $form_state['values']['terminology']);
+ drupal_set_message(t('Terminology setting has been saved.'));
+ }
+
if ( variable_get('legal_display', '0') != $form_state['values']['display'] ) {
variable_set('legal_display', $form_state['values']['display']);
drupal_set_message(t('Display setting has been saved.'));