function subscriptions_add_form in Subscriptions 7
Same name and namespace in other branches
- 5.2 subscriptions.admin.inc \subscriptions_add_form()
- 6 subscriptions.admin.inc \subscriptions_add_form()
- 2.0.x subscriptions.admin.old.php \subscriptions_add_form()
Provide the form definition for adding subscriptions via subscriptions/add/... link.
Callback of _subscriptions_menu() in subscriptions.module.
_state
Parameters
array $form:
string $stype: Subscription type.
mixed $sid: Subscription parameter (depends on type).
int|null $author_uid: User ID for author-specific subscriptions or NULL/-1 for all authors.
Return value
array
See also
_subscriptions_menu()
1 string reference to 'subscriptions_add_form'
- subscriptions_menu in ./
subscriptions.module - Implements hook_menu().
File
- ./
subscriptions.admin.inc, line 997 - Subscriptions module (load-on-demand admin functions).
Code
function subscriptions_add_form(array $form, array &$form_state, $stype, $sid, $author_uid = NULL) {
global $user;
$form['sid'] = array(
'#type' => 'value',
'#value' => $sid,
);
$form['uid'] = array(
'#type' => 'value',
'#value' => $user->uid,
);
$form['stype'] = array(
'#type' => 'value',
'#value' => $stype,
);
$form['author_uid'] = array(
'#type' => 'value',
'#value' => $author_uid,
);
$form['send_interval'] = array(
'#title' => t('Send interval'),
'#type' => 'select',
'#options' => _subscriptions_send_intervals(),
'#default_value' => _subscriptions_get_setting('send_interval', $user),
'#access' => _subscriptions_get_setting('send_interval_visible', $user),
);
$form['updates'] = array(
'#type' => 'checkbox',
'#title' => 'On updates',
'#default_value' => _subscriptions_get_setting('send_updates', $user),
'#access' => _subscriptions_get_setting('send_updates_visible', $user),
);
$form['comments'] = array(
'#type' => 'checkbox',
'#title' => 'On comments',
'#default_value' => _subscriptions_get_setting('send_comments', $user),
'#access' => _subscriptions_get_setting('send_comments_visible', $user),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Subscribe'),
);
return $form;
}