You are here

function _notify_user_reg_fields in Notify 6

Same name and namespace in other branches
  1. 8 notify.module \_notify_user_reg_fields()
  2. 7 notify.module \_notify_user_reg_fields()
  3. 2.0.x notify.module \_notify_user_reg_fields()
  4. 1.0.x notify.module \_notify_user_reg_fields()

Returns form fields to be added to User Regsitration form

1 call to _notify_user_reg_fields()
notify_user in ./notify.module
Implementation of hook_user().

File

./notify.module, line 161
Notify module sends email digests of new content and comments.

Code

function _notify_user_reg_fields() {
  if (!user_access('access notify')) {
    return;
  }

  // Get the variable for how often the notifications are sent out
  $period = variable_get("notify_send", 86400);

  // Add a fieldset containing a checkbox for users to accept
  // getting updates on the registration form.
  $fields['notify_agree'] = array(
    '#type' => 'fieldset',
    '#title' => t('Email Notifications'),
  );

  // Add the checkbox to the fieldset
  $fields['notify_agree']['notify_decision'] = array(
    '#type' => 'checkbox',
    '#title' => t('Receive e-mail notifications of new content posted to this site. Notifications are sent every @interval.', array(
      '@interval' => format_interval($period),
    )),
    '#return_value' => 1,
    '#default_value' => variable_get('notify_reg_default', 1),
  );
  return $fields;
}