function _notify_user_reg_fields in Notify 7
Same name and namespace in other branches
- 8 notify.module \_notify_user_reg_fields()
- 6 notify.module \_notify_user_reg_fields()
- 2.0.x notify.module \_notify_user_reg_fields()
- 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_form_user_register_form_alter in ./
notify.module - Implements hook_form_FORM_ID_alter().
File
- ./
notify.module, line 374 - Notify module sends e-mail digests of new content and comments.
Code
function _notify_user_reg_fields() {
if (!user_access('access notify')) {
return array();
}
// Get the variable for how often the notifications are sent out.
$period = variable_get("notify_period", 86400);
// Add a fieldset containing a checkbox for users to accept
// getting updates on the registration form.
$fields['notify_agree'] = array(
'#weight' => variable_get('notify_weightur', 0),
'#type' => 'fieldset',
'#title' => t('E-mail 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;
}