You are here

function subscriptions_add_form in Subscriptions 5.2

Same name and namespace in other branches
  1. 6 subscriptions.admin.inc \subscriptions_add_form()
  2. 7 subscriptions.admin.inc \subscriptions_add_form()
  3. 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.

Parameters

$stype: Subscription type.

$sid: Subscription parameter (depends on type).

$author_uid: User ID for author-specific subscriptions or NULL/-1 for all authors.

See also

_subscriptions_menu()

1 string reference to 'subscriptions_add_form'
_subscriptions_menu in ./subscriptions.module
Given a base url, returns the user menu definition for given user account.

File

./subscriptions.admin.inc, line 618

Code

function subscriptions_add_form($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;
}