You are here

function notifications_subscription_form in Notifications 6

Same name and namespace in other branches
  1. 6.4 notifications.module \notifications_subscription_form()
  2. 6.2 notifications.pages.inc \notifications_subscription_form()
  3. 6.3 notifications.pages.inc \notifications_subscription_form()
  4. 7 notifications.module \notifications_subscription_form()

Edit subscription

1 string reference to 'notifications_subscription_form'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.pages.inc, line 377
User pages for Notifications

Code

function notifications_subscription_form($form_state, $subscription) {

  // 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),
  );

  // Subscription values
  $form['subscription'] = array(
    '#type' => 'value',
    '#value' => $subscription,
  );
  $form['send_interval'] = array(
    '#type' => 'select',
    '#title' => t('Send interval'),
    '#options' => _notifications_send_intervals(),
    '#default_value' => $subscription->send_interval,
  );
  $send_methods = _notifications_send_methods();
  $form['send_method'] = array(
    '#type' => 'select',
    '#title' => t('Send method'),
    '#options' => $send_methods,
    '#default_value' => $subscription->send_method,
  );
  $form['status'] = array(
    '#type' => 'radios',
    '#title' => t('Status'),
    '#options' => _notifications_subscription_status(),
    '#default_value' => $subscription->status,
  );
  $form['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
  );
  return $form;
}