function notifications_form_confirm in Notifications 5
Form for subscription confirmation
1 string reference to 'notifications_form_confirm'
- notifications_page_subscribe in ./
notifications.admin.inc - Menu callback add subscription
File
- ./
notifications.admin.inc, line 462
Code
function notifications_form_confirm($subscription) {
$account = user_load(array(
'uid' => $subscription->uid,
));
// Pass on simple values
foreach (array(
'sid',
'uid',
'type',
'fields',
'event_type',
) as $field) {
$form[$field] = array(
'#type' => 'value',
'#value' => $subscription->{$field},
);
}
// The names will be added here
notifications_module_invoke('names', $subscription);
$form['info'] = array(
'#type' => 'item',
'#title' => t('!type subscription to', array(
'!type' => $subscription->type_name,
)),
'#value' => theme('item_list', $subscription->names),
);
// Additional parameters
$form['send_interval'] = array(
'#type' => 'select',
'#title' => t('Send interval'),
'#options' => _notifications_send_intervals(),
'#default_value' => $subscription->send_interval,
);
$send_methods = _notifications_send_methods($account);
$form['send_method'] = array(
'#type' => 'select',
'#title' => t('Send method'),
'#options' => $send_methods,
'#default_value' => $subscription->send_method,
'#disabled' => count($send_methods) < 2,
);
$form['confirm'] = array(
'#type' => 'submit',
'#value' => t('Subscribe'),
);
$form['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
);
return $form;
}